Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer

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.