Bruce Marshall wrote:
On Thursday 17 November 2005 08:33 pm, Anders Johansson wrote:
Bruce Marshall wrote:
if ! ps -aux | grep $daemon | grep -iv grep
1. why -i? grep is grep, not GrEp 2. you can do daemon=f[e]tchmail instead to avoid irrelevant hits on the grep process 3. Use checkproc for the testing instead of any of the above
How does one get checkproc to work?
(my attempt) ======================================================= srv1:/var/mail/backup # ps aux | grep fetch | grep -v grep root 8104 0.0 0.2 5808 1832 ? Ss Nov13 0:10 fetchmail -f /etc/fetchmailrc
srv1:/var/mail/backup # checkproc fetchmail
srv1:/var/mail/backup # checkproc /usr/bin/fetchmail
Try checkproc /usr/bin/fetchmail && echo "it's running" checkproc simply returns a value, which you can then test for, for example using if, as in your previous script