Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Does the program-user have /sbin in its PATH? What happens if you explicitly call /sbin/start-stop-daemon? –  andol Jul 10 '10 at 22:22
    
/sbin/start-stop-daemon works –  s5804 Jul 11 '10 at 9:57
add comment

1 Answer

up vote 2 down vote accepted

start-stop-daemon is in /sbin which is often not included in a user's PATH. It's also probably not in the default PATH for cron. 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 a crontab or in a script run from a crontab, just add the full path like this: /sbin/start-stop-daemon ....

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.