I wrote a Perl script which will serve as a daemon, so I'd like to let the OS (in my case, Ubuntu Linux) automatically run my Perl script after it has booted up.

How can I do that?

link|improve this question

33% accept rate
feedback

1 Answer

up vote 2 down vote accepted

Make a shell script wrapper for your perl script

#!/bin/sh - script.sh
# your perl program goes here

/bin/perl /path/to/foobar.pl

Make sure that you have given executable permission using

  chmod +x script.sh

and execute the following,

sudo update-rc.d script.sh defaults

This will run perl script on each startup.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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