LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-03-2012, 07:32 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
Auto Startup Service


Hi,

I have a script (start-myproc.sh) which should be executed as the machine reboots.

I've googled and find different alternatives. One is to add the command in the "/etc/rc.d/rc.local". The other is to write another startup-script under /etc/init.d/.

Which is better? The first one seems easier to me.
 
Old 09-03-2012, 08:01 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
What distribution are you using?
 
Old 09-03-2012, 08:16 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by andrewthomas View Post
what distribution are you using?
rhel 5.6
 
Old 09-03-2012, 08:31 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,747

Rep: Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925
rc.local is the last script to run for all run levels before the user logs in.

With init.d you can control what level and when the script is started and stopped in the boot/shutdown process. If none of that matters then rc.local would be the simplest.
 
Old 09-03-2012, 08:42 AM   #5
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
I would suspect that best-practice would be to use /etc/rc.d/rc.local

http://www.centos.org/docs/5/html/In...-run-boot.html
 
  


Reply



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
Service httpd auto stop AppleH Linux - Server 3 04-24-2011 02:01 AM
Auto startup service ust Linux - Server 1 02-12-2009 05:32 AM
How to configure auto login & after login auto startup some program. hocheetiong Linux - Newbie 1 02-18-2008 12:49 AM
Service to auto restart jamiehenderson Linux - Software 3 08-08-2005 01:44 PM
auto restart service st3reo Linux - Newbie 4 12-07-2004 12:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:58 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