[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#591791: [PATCH] Document generic and upstart-specific init-system requirements



On 16.03.2012 21:18, Steve Langasek wrote:
> On Fri, Mar 16, 2012 at 08:53:15PM +0100, Michael Biebl wrote:
> 
>> As I've already mentioned before, I don't like the approach, that any
>> init script should use something like:
> 
>>> if [ "$1" = start ] && which initctl && initctl version | grep -q upstart; then
>>> exit 1
>>> then
> 
>> It seems much more sensible to me, to move all this logic into a
>> separate shell library, and instead of hardcoding the above commands in
>> the sysv init script, policy should just mention that maintainers that
>> wish to provide both an upstart job and sysv init script would source
>> this library in the sysv init script.
> 
> This is an example implementation only.  A patch has already been submitted
> for lsb-base, but /lib/lsb/init-functions is not specified anywhere else in
> policy so I don't think it's appropriate to have policy now mandate its use
> in this specific case.
> 
>> Otherwise it will lead to copy&paste and maintenance nightmare
> 
>> Also, the proposal looks underspecified to me: What happens for other
>> actions, like stop/restart/reload/force-reload?
> 
> Well, it would be inappropriate to refuse to stop the service because
> upstart was running.  The more likely outcome is that the init script will
> not be able to find the running process, and will therefore exit 0 anyway as
> a no-op.  So I don't think there are any new requirements here (which is why
> I didn't spell it out).

If you kill the daemon from the sysv init script, upstart will just
respawn it (if respawn is set) or mark it as failed.

Personally, I would just prefer, if the shell library would forward the
action requests to the native init system.


Another problematic issue that comes to mind, is packages installing
dhcp and ifup.d hooks which call /etc/init.d/<service> <start>

From my recollection, there are at least a few that do this, the most
prominent one is nfs-common.

Michael



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: