Mixing Upstart with SysV

Steve Langasek steve.langasek at ubuntu.com
Mon Nov 26 08:17:07 UTC 2012


Hi Daniel,

On Sun, Nov 25, 2012 at 10:52:23PM -0800, Daniel L. Miller wrote:
> Using Ubuntu Precise, I have server with a mix of upstart and init.d
> scripts.  I've manually migrated some legacy init.d scripts to
> Upstart - but some of them are overly complicated.  Some might say
> unnecessarily so - they go to great lengths to ensure the startup
> environment is valid - but there's an argument to be made for
> protecting against self-inflicted wounds.

> At any rate - I've got a simple Upstart script which has "start on
> runlevel [2345]".  This program has a dependency on ClamAV - which
> does not have an Upstart script and is started via SysV.  It appears
> on boot that my service starts before ClamAV - so is unable to
> connect properly.

> What is the least-intrusive way I can have my script wait until
> ClamAV is active before starting?  Add an "initctl emit" to the
> init.d script and change the "start on" section in Upstart?

The /least/ intrusive way is to make your upstart job be 'start on stopped
rc RUNLEVEL=[2345]'.  This will cause it to not start until all of
/etc/rc2.d is processed.

If you're happy editing the init script to emit an event, that would also
work, but it's not exactly unintrusive and won't play well on upgrades.

HTH,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20121126/f31f393e/attachment.pgp>


More information about the upstart-devel mailing list