Running a Daemon at boot

Hi there

I have installed the Tiny Tiny RSS server and want to use the update daemon that it supplies.

I cannot, for the life of me, remember how to make sure that this update daemon runs when the server boots.

Many thanks

Status: 
Closed (fixed)

Comments

Howdy -- if the daemon comes with an init script (as most do), you can have it start on bootup by going into Webmin -> System -> Bootup and Shutdown, and in there check the "At boot" checkbox.

Hi there

It doesn't seem to be listed in there.

Is it possible to use the "Create a new bootup and shutdown action" option?

The command I need to use is:

php /home/DOMAIN/domains/SUBDOMAIN/public_html/update.php --daemon

Thanks

Edit also, it really needs to run under a different user than root. Thanks **

Sure, you can do that.

If you want it to run as a different user, change the command to :

su someuser -c "/usr/bin/php /home/DOMAIN/domains/SUBDOMAIN/public_html/update.php --daemon"

It unfortunately seems as if that particular app wasn't really designed to be run as an init script.

What you may want to do, rather than creating an init script, is just to use cron to handle that.

What you can do is create a cron job, using this particular user to create it (not as root). And when setting up the scheduled cron job, instead of picking something like hourly or daily for when to run, pick "When system boots".

That will make sure this PHP script starts each time the system boots.

Or you can do what Jamie just said :-)

Thanks to you both :)

I followed Jamies option, and the daemon is running perfectly :)

Many many thanks for your help as always guys.

Cheers

Dave

Automatically closed -- issue fixed for 2 weeks with no activity.