how to find the pid of a perl script from shell script
Thanks in advance to the responder
I run a perl script that "tail -f /var/log/syslog" looking for iptables enteries and puts them into the snort mysql db.
I run it from /etc/init.d as follows:
#!/bin/sh
# Log Iptables Data to Snort Mysql Log For Acid Viewing
case "$1" in
'start')
echo "Starting Logsnorter"
logsnorter-0.2 -L 8 -T /var/log/syslog &
echo "Logsnorter Started"
;;
'stop')
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0
Everthing works fine until logrotate comes along and kills the script at about 6am
I need to know how to restart the perl script from cron - more specifically, how to find the pid of the script and kill it from inside a shell script. Anybody have an example shell script they could throuw up? Thanks
Brian Toovey
|