Results 1 to 2 of 2
Hi,
I am trying to create a process monitor in perl which checks for the processes that need to be on on startup automatically and restarts them if they are ...
- 04-08-2009 #1Just Joined!
- Join Date
- Apr 2009
- Posts
- 7
restart linux process list automatically
Hi,
I am trying to create a process monitor in perl which checks for the processes that need to be on on startup automatically and restarts them if they are not running.
I use 'chkconfig --list|grep on' to find the processes that need to run on startup. then i capture the process name in $process_name and do 'ps -ef|grep -v grep|grep $process_name|wc -l' and check the return value(>0 running) to find if the process is running.
But the process name obtains from chkconfig is not the same as the one used in ps command. For example I got process named ksghdctl from chkconfig and its name in ps command is kdgh.
Is there a mapping between these names or is there a better way to perform this function?. I want to do it with no external configuration in perl.
thanks in advance
- 04-12-2009 #2Just Joined!
- Join Date
- Apr 2009
- Posts
- 7
Some one need to help me here. I have tried different methods with out any success. I need to find the status of all the processes returned from 'chkconfig --list|grep on' and restart a process if any process is down in perl.


Reply With Quote