I'm trying to daemonize a process under a different user.
In my init.d, I have a service which looks a little bit like this:
...
start() {
echo "Starting mydaemon..."
daemon --user someuser --name mydaemon mycommand
}
...
(entire script here: http://pastebin.com/bvpnsHgn)
However, all I get is daemon: command not found
.
I checked that daemon()
is declared in /etc/init.d/functions
, but still, I cannot seem to use it.
How can I resolve this?