LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-26-2008, 06:45 AM   #1
nscjagan
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Unhappy 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.
 
Old 11-26-2008, 07:19 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,167

Rep: Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting vncserver at boot using rc.local promethious Linux - General 3 10-14-2005 07:57 AM
Starting a Script from rc.local dazz Linux - Newbie 9 07-03-2005 05:03 AM
starting the script at boot time hudy_rob Mandriva 4 12-09-2004 10:29 AM
iptables & rc.local starting script = applications are slowing down. immer Linux - Networking 3 12-13-2003 09:11 AM
problems running a perl script from rc.local bobthebuilder Linux - General 2 06-16-2003 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration