dataflake.org

Home Documentation Software Old Stuff Bug Reporting

Test if daemon realy running (Resolved)

Request MaildropHost -- feature request -- by Johnny Souza
Posted on Oct 29, 2007 1:12 pm
Subscribe

Enter your email address to receive mail on every change to this issue.

Entries (Latest first)


  Resolve by Jens Vagelpohl on Nov 11, 2007 2:38 pm
  Thanks Johnny, I just checked the ptch in:

http://svn.dataflake.org/?view=rev&revision=1437

 

  Initial Request by Johnny Souza on Oct 29, 2007 1:12 pm
  On daemon start, send a signal 0 when the PID file exists to verify if the daemon is realy alred started.

Diff:
Index: maildropctl
===================================================================
--- maildropctl (revisao 1434)
+++ maildropctl (copia de trabalho)
@@ -89,8 +89,18 @@
start)
if [ -f $MAILDROP_PID_FILE ]
then
- echo "Error: maildrop daemon already started."
- ERROR=1
+ kill -0 `cat $MAILDROP_PID_FILE` 2> /dev/null
+ if [ "$?" == "0" ]
+ then
+ echo "Error: maildrop daemon already started."
+ ERROR=1
+ else
+ echo 'Warnning: maildrop daemon not found'
+ echo 'Removing PID file'
+ rm -f $MAILDROP_PID_FILE
+ start
+ ERROR=$?
+ fi
else
start
ERROR=$?