Native upstart scripts

Jacek Konieczny jajcus at jajcus.net
Tue May 4 12:53:40 CEST 2010


On Tue, May 04, 2010 at 12:04:39PM +0200, Patryk Zawadzki wrote:
> > - scripts in /etc/rc.d/init.d would emit 'started' and 'stopped'
> >  events when necessary, so upstart services can rely on that
> 
> I'd opt for having 2 separate -init subpackages, one with the current
> rc.d contents and one with an upstart job description and a simple
> rc.d wrapper that runs "start $foo", "stop $foo" etc.

There is one more thing why I would prefer to keep both old-style init.d
script and the new upstart configuration together: we often have
something more than 'start' 'stop' and 'status' implemented in the init
scripts. Some of these actions would have to be copied to upstart
script somehow (initialization before first run), other probably cannot
be handled by upstart means.

sshd init script builds host keys the first time it is started. This
functionality is available also via '/etc/rc.d/init.d/sshd init' and
would have to be copied to the upstart configuration to and maintained
in the two places.

As starting and stopping of services is quite different in LSB init
scripts and upstart and reusing code does not make sens, in other cases,
like 'init' the code may be reused and upstart script could just call
'/etc/rc.d/init.d/sshd init'. 

Also, there are things like '/etc/rc.d/init.d/lighttpd configtest' which
are not part of normal job control and thus not applicable to upstart
config, but still useful.

Greets,
        Jacek


More information about the pld-devel-en mailing list