Mixing Upstart with SysV

Clint Byrum clint at ubuntu.com
Tue Nov 27 12:05:50 UTC 2012


Excerpts from Daniel L. Miller's message of 2012-11-25 22:52:23 -0800:
> 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?

While Steve Langasek's approach is perfectly valid, I would like to offer
another option. Why not make your code just a little more resilient to
a missing ClamAV at startup?

ClamAV is a network service, and so it isn't necessarily always going
to run on the local machine. Whatever your code does to try and connect
to ClamAV, it should consider a connection refused as a temporary,
recoverable error, and keep trying, at least for a little while, before
giving up.



More information about the upstart-devel mailing list