LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Scripts needs to run after restarting the server also (https://www.linuxquestions.org/questions/linux-newbie-8/scripts-needs-to-run-after-restarting-the-server-also-878752/)

emcykm 05-04-2011 06:13 AM

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.

EricTRA 05-04-2011 06:15 AM

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

emcykm 05-05-2011 01:27 AM

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.

EricTRA 05-05-2011 01:48 AM

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

emcykm 05-23-2011 02:58 PM

Thnks alot
 
Thnks alot, its working properly

EricTRA 05-23-2011 03:00 PM

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


All times are GMT -5. The time now is 12:11 AM.