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-24-2008, 02:23 AM   #1
Anshul Pathak
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
Question How to run shell script from rc.local


Hello,

Can anybody tell me, How to run shell script at boot time ?

Regards,
Anshul Pathak
 
Old 11-24-2008, 02:27 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You've sort of answered your question in the title, so what's not working?
 
Old 11-24-2008, 03:37 AM   #3
Anshul Pathak
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by billymayday View Post
You've sort of answered your question in the title, so what's not working?
Hi,

Actually i have created a java layer and i want to run it on linux at boot time.I have also created the shell script to run that layer and now i want to know what to write in "rc.local" to run my script file at boot time.

Regards,
Anshul Pathak
 
Old 11-24-2008, 09:22 AM   #4
rohit_k
LQ Newbie
 
Registered: Oct 2007
Location: Pune
Distribution: RHEL, SOLARIS, SUSE
Posts: 18

Rep: Reputation: 1
Just add your lines in rc.local (in end ).
eg:
/complete/path/to/binary/my_program &

HTH.
 
Old 11-24-2008, 12:18 PM   #5
salter
Member
 
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
You can also install a script in /etc/init.d
The script should handle at least the start, stop and status input commands
Then use chkconfig -add <your-script> to set your script to be launched during booting, or just run
/etc/init.d/<your-script> start
This is how a lot of other services are being started

Last edited by Tinkster; 10-30-2010 at 06:13 PM.
 
Old 11-24-2008, 01:11 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Which user do you want this script to run as?
If you just put the /path/to/script into rc.local, it'll be run as root, with no GUI, and you are unlikely to see any error-reporting.
This may not be what you want.
 
  


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
MySQL Updates With Null When Perl Script Run From Shell Script ThisGuyIKnow Programming 6 08-12-2008 10:56 AM
Restrict a Shell Script to run from a shell bharaniks Linux - Security 7 08-26-2007 11:57 PM
clamd upgradation in remote mach through local mac by script to be run on local mach Narayandutt Programming 3 11-29-2006 11:00 AM
shell script to compare filese b/w local and remote and delete files from local serve dsids Linux - Networking 9 08-23-2006 08:20 AM
local rsync shell script eradrix Programming 13 07-09-2005 01:57 AM


All times are GMT -5. The time now is 02:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration