Upstart Loses Track of Services ("Unknown instance")

Richard Laager rlaager at wiktel.com
Tue Apr 3 16:32:19 UTC 2012


On Thu, 2012-03-29 at 08:49 +0100, James Hunt wrote:
> On 29/03/12 01:14, Richard Laager wrote:
> > I have this recurring problem where trying to stop services results in
> > "Unknown instance". It's as if upstart has lost track of the fact that a
> > service is running (and its PID); starting the service again will result
> > in two copies running (at least for some services that don't do their
> > own duplicate checking).
> > 
> > It has continued to happen across several releases of Ubuntu, with
> > multiple different services (e.g. SSH, upstart jobs for daemons I've
> > written myself). With SSH, it's virtually guaranteed to happen every
> > time I want to stop it (since I do so infrequently), but I can't
> > reproduce this on demand. In other words, I can
> > start...stop...start...stop services right in a row to my heart's
> > content and it's fine. I'm starting to wonder if the trigger isn't
> > something that happens nightly. Alternatively, it might be happening on
> > (certain) package upgrades.
> > 
> > What should I be doing to debug this?
> 
> With respect to ssh, I think you may be referring to this bug:
> 
>   https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/687535
> 
> The problem has now been fixed in versions of Ubuntu going back to lucid (10.04).

I'm running Precise, which was up-to-date as of the 29th when I sent the
email. (I'm also running older versions on some boxes, but let's ignore
them for the purposes of debugging.) So I should have that bug fix.

> You don't mention any other services by name so it is rather difficult to speculate.

I'm seeing this with smbd for sure. I believe I'm seeing it with cups,
but it was only once (on Precise) so far.

> However, if you
> are seeing strange behaviour for jobs you have written, I suspect you have mis-specified the
> 'expect' stanza in combination with specifying 'respawn' (doing so will give strange behaviour).

Here's my configuration file:

        # dms10-alarms - DMS10 Logging
        
        description "DMS10 alarm logging"
        
        start on runlevel [2345]
        stop on runlevel [06]
        
        respawn
        
        script
            exec tty-cronolog /etc/tty-cronolog/dms10-alarms
        end script

tty-cronolog is a fairly simple Perl script I wrote. It takes a path to
a configuration file as an argument. It reads that configuration file,
opens a serial port tty and a pipe to cronolog, and shovels data from
the tty to cronolog. It does not fork() itself (other than what Perl
does for the cronolog pipe) or do anything with stdin/stdout/stderr. It
just starts and runs until it receives a TERM signal.

-- 
Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20120403/1888dbab/attachment.pgp>


More information about the upstart-devel mailing list