daemon stop problem

Alex Turbov i.zaufi at gmail.com
Tue Nov 30 11:37:12 GMT 2010

Hi list!

I've got a problem when trying to write an upstart script for my
daemon application.
here is the script:

---[start of /etc/init/indexer.conf]---
description "Indexer Daemon"
version "0.1.0"

#start on runlevel [2345]
#stop on runlevel [!2345]

expect daemon

pre-start script
    # Make sure DB path exists...
    if [ -r /etc/opt/entell/indexer.conf ]; then
      db=`cat /etc/opt/entell/indexer.conf | grep xdb | sed
's,^\s*xdb\s*=\s*\(.*\)$,\1,' | head -n 1`
      mkdir -p `dirname $db`
end script

env LD_LIBRARY_PATH=/usr/lib/jvm/java-6-sun/jre/lib/amd64/server
exec /opt/entell/bin/indexer -d
---[end of /etc/init/indexer.conf]---

being running from command line w/ -d option it works fine and
shutdowns Ok after `kill`. but when I try to `stop indexer` it hangs
(according strace on poll() some descriptor).
note that indexer is a real daemon (i.e. it fork() twice as 'expect'
stanza supposed) but NO SIGTERM is delivered to it... :(
another one thing I've noticed: after `start` some PID is displayed,
but real PID, of cause, is greater... -- dunno is it important or

I can provide any aux info if required... I have no idea whats going
on :( -- as for me, it looks like upstart remember a wrong PID for my
daemon somehow...

//wbr, alex

More information about the upstart-devel mailing list