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?
Did you make sure to source the
/etc/init.d/functions
library in your service's init.d script?You'd need this in your init.d script:
If this is already there, can you please post your daemon's start script?
If you are missing the scripts, you can simply (re)install them this should get
daemon: command not found
issue resolvedHope this helps