in reply to Re: Test for daemon
in thread Test for daemon

Another quasi ugly system call could be something like
use strict; my($ps_cmd,$found); $ps_cmd = '/bin/ps -auwx'; open(IN,"$ps_cmd|") || die "Couldnt exec $ps_cmd\nReason: $!\n"; while ( <IN> ) { ($found++ && last) if ($_ =~ /inetd/); } print STDERR "Danger Will Robinson\n" if (!$found);
Also below there was a post about collecting the ps output into an array, and then grep()'ing inetd from the output, which works nicely too...
P.S. Code tested clean on FreeBSD