I have a custom version of CENTOS that I need to run a perl script as a daemon in at all times.

To do this I want to get it to run on startup as a daemon.

When the machine is on I can daemonize the script with the command

daemonize /var/myfolder/myscript.pl

And this works fine.

So I have an rc1 script which has a number of commands that run when the machine starts, and the very last line in it is where I try to daemonize that script. Everything else in the rc1 script runs fine, and the script doesn't output any errors, however when I check to see if the daemon is running on start up, it isn't running.

Is there another way that I can get the script to run on startup? Or any ideas on why this method doesn't work?

  • The contents of your rc1 script might help if you don't mind :p – John WH Smith Aug 10 '15 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.