Restarting syslogd automatically.

#!/bin/bash

PROC=`ps -ef|grep syslogd|grep -v grep|wc -l`

if [ $PROC -eq 1 ]; then
echo "syslogd is running on PID `pgrep syslogd` and it is now `date`!" >> /var/adm/messages
else
echo "syslogd is not running as expected...restarting it at `date`!" >> /var/adm/messages
/etc/rc2.d/S74syslog start 1>> /var/adm/messages
fi

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s