Ubuntu Lucid.
I am writing a start/stop script for a program. The program shall be started/stopped by the crontab.
Running it as program-user, error message: start-stop-daemon command not found. However, if I try it with sudo start-stop-daemon, it works.
Is there a way to get it to work running on program-user crontab?
start-stop-daemon
is in/sbin
which is often not included in a user'sPATH
. It's also probably not in the defaultPATH
forcron
. You can add it for a particular user in their~/.bashrc
or for all users in/etc/bash.bashrc
. If you're starting it in acrontab
or in a script run from acrontab
, just add the full path like this:/sbin/start-stop-daemon ...
.