in reply to How best to see if syslogd is running?

Why all the futzing around with external programs when you can do it with just Perl?

#! /usr/local/bin/perl -w use IO::Socket::INET; print "syslog is ", check_syslog( 'localhost' ) ? 'up' : 'down', "\n" +; sub check_syslog { my $s = IO::Socket::INET->new( PeerHost => $_[0], Timeout => 1, Proto => 'udp', PeerPort => 514, ); return 0 unless $s; close $s; return 1; }

In other words, just see whether you can connect to the socket that syslogd opens. Much easier than fiddling around with ps, grep, pidfiles and/or procfs.

- another intruder with the mooring of the heart of the Perl