LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   perl script in rc.local file not starting at boot up time (https://www.linuxquestions.org/questions/linux-newbie-8/perl-script-in-rc-local-file-not-starting-at-boot-up-time-686307/)

nscjagan 11-26-2008 06:45 AM

perl script in rc.local file not starting at boot up time
 
Hello All,

I am trying to make a perl script start automatically when my linux box starts. I had included the mysql server and the perl script to be started in rc.local file. But the mysql server starts but the perl script does not. The script is no way related to mysql. can any one of you kindly help me how to make the script run. I am pasting the line I had included in the rc.local file.

/bin/sh /var/www/html/autoclose.pl &

Regards,
Jag.

chrism01 11-26-2008 07:19 AM

You can't call a Perl prog as a shell script. It makes no sense.
Ensure the first line of the Perl prog says

#!/usr/bin/perl -w

or wherever your perl is installed. Use the following invocation in /etc/rc.local

nohup /var/www/html/autoclose.pl &

Note that this will be run as root, whereas scripts under www are usually owned by Apache or httpd.


All times are GMT -5. The time now is 07:40 PM.