Disconnected jobs

James Hunt james.hunt at ubuntu.com
Fri Aug 24 09:15:54 UTC 2012


On 23/08/12 23:52, Daniel L. Miller wrote:
> Is there a method to:
> 
> 1.  Tell Upstart that a given process is an instance and should be
> supervised?  Example:  I have a number of VirtualBox headless servers
> that I start using simple Upstart scripts.  I terminate the server
> process - and I've told Upstart not to restart it in the script using
> the normal exit clause.  Now, I manually start the server process using
> an external VirtualBox tool or webserver.  The process is now running -
> but Upstart doesn't know about it.
No, but if you're in full control of these manual operations, why don't
you start an instance of the job instead to achieve the same result?

See: http://upstart.ubuntu.com/cookbook/#instance

> 
> 2.  Trying to get supervision of a multiple forking daemon working can
> be...difficult.  In particular, I've been trying to get the current
> version of ASSP supervised in its daemonized mode.  It appears this perl
> script forks at LEAST twice when doing so - and gives Upstart fits.  It
> works fine as a foreground non-forking script - which is how I run it
> now.  In the meantime, until I reboot my server, I have a process named
> "assp" with a status of "stop/killed" - which I cannot release.
>
Since it sounds like ASSP is behaving unusually, maybe you could try one
of the following:

1) tweak the perl script to send itself a stop signal (raise(SIGSTOP))
and add 'expect stop' to your job configuration file.

 See http://upstart.ubuntu.com/cookbook/#expect-stop

2) Tell ASSP not to daemonize (there seems to be a config setting for
this) and remove the 'expect' stanza from your job configuration file.

We actually use this technique in Ubuntu for sshd. See /etc/init/ssh.conf.

Kind regards,

James.
--
James Hunt
____________________________________
http://upstart.ubuntu.com/cookbook
http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf



More information about the upstart-devel mailing list