in reply to Controlling number of processes Forked
Though I have not given the solution, I can tell you the problem causing part in your code.
The above line is the culprit there. because eventhough you controll the fork processes which are created by 'fork' you have uncontroll on 'ps'. Because that creates one more process in it. you should handle it.$num_processes = `ps -ef | grep $process_name | grep -v grep | wc -l +`;
my $STOP_FILE = 'stopfile';
my $STOP_FILE = '/home/user/stopfile'; OR Environment variable should be :- STOP_FILE_PATH='/home/user'; my $STOP_FILE = "$ENV{STOP_FILE_PATH}/stopfile";
|
|---|