LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-04-2011, 06:13 AM   #1
emcykm
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Rep: Reputation: 0
Scripts needs to run after restarting the server also


i am having a script which is running as a daemon, the script should run even if i restarted my server also. kindly guide me how can i acieve the same.
 
Old 05-04-2011, 06:15 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

If you tell us what distro and version you are using then we might be able to give you the correct commands without having to list all possibilities.

Kind regards,

Eric
 
Old 05-05-2011, 01:27 AM   #3
emcykm
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Its LINUX redhat 5 enterprise version

Its LINUX redhat 5 enterprise version which is running on virtual machine... My script is having infinte loop which is achieved by using while loop.
 
Old 05-05-2011, 01:48 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

There are several ways. The easiest one is to include the startup line for your script in /etc/rc.d/rc.local. In doing that your script will start after all the other init scripts. That way you can avoid the second, more complicated way which is to create a startup script for your daemon, place that in /etc/init.d/ and add it to the appropriate run levels using the chkconfig command.

Kind regards,

Eric
 
1 members found this post helpful.
Old 05-23-2011, 02:58 PM   #5
emcykm
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Thnks alot

Thnks alot, its working properly
 
Old 05-23-2011, 03:00 PM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Glad you've got it working. If you consider your problem/question solved then please mark this thread as such. Have fun with Linux.

Kind regards,

Eric
 
  


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
How to run fsck during a shutdown sequence, or how to run one-time init scripts? bgoodr Debian 5 11-28-2010 03:08 PM
server Restarting eldhochacko Linux - Server 5 09-25-2009 08:32 AM
is there way to run php scripts without having any server os...... kratosal Linux - Newbie 5 04-06-2008 02:30 PM
restarting x server igracgq Red Hat 4 12-14-2004 09:44 PM
restarting x server? pyschomike15 Linux - General 4 11-02-2003 07:13 AM

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

All times are GMT -5. The time now is 01:39 PM.

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