in reply to Re^18: show a message only during the sleep time
in thread show a message only during the sleep time

I change the code to:
................................................................... my $process = "ntop"; my $return = 'ps -eaf |grep $process |grep -v grep'; my $stop = '/usr/local/bin/sudo sh /usr/local/www/cgi-bin/ntop/ntop.sh + stop &'; if ($return ne "" ) { system ($stop) and die "..."; } sleep(8); my $start = system('/usr/local/bin/sudo /usr/local/www/cgi-bin/ntop/nt +op.sh start') and die "..."; ...................................................................

Replies are listed 'Best First'.
Re^20: show a message only during the sleep time
by cc (Beadle) on Jul 27, 2005 at 21:17 UTC
    you mean to avoid zombie processes executed via perl using:
    opens, system and backticks.

    some perl functions collect their child processes
    automatically and they must wait to be push manually
    or to push other processes.

    I've corrected the code

    greetings
    cc