[GRLUG] weird initscript issue

megadave megadave at gmail.com
Sun Oct 6 14:35:33 EDT 2013


Ok, I have an initscript which is doing something very strange.

It has an "if, elif, else" clause, and for some reason, even though
the "elif" code is being run, it is ALSO running the "else" code.

This is on a Debian Squeeze system.

Anyone got any clue what is going on here?


(snip)

      if [ "$PROCLIST" ] && kill -0 $PROCLIST 2>/dev/null; then
        echo "*** already ***"
        echo -n "[Already running: $file] "
      elif $DAEMON $ARGS; then
        echo "*** started ***"
        echo $DAEMON : $ARGS
        echo -n "[* Started: $file] "
      else
        echo "*** failed ***"
        echo "[Failed: $file]"
        echo "You should check that you have specified the pid= in you
configuration file"
        exit 1
      fi

(snip)

And here is the output from running it:

*** started ***
/usr/bin/stunnel4 : /etc/stunnel/pop3.conf
[* Started: /etc/stunnel/pop3.conf] *** failed ***
[Failed: /etc/stunnel/pop3s.conf]
You should check that you have specified the pid= in you configuration file


More information about the grlug mailing list