[systemd-devel] [PATCH] service: allow service to inhibit respawn with special return code

Lennart Poettering lennart at poettering.net
Tue Aug 14 05:45:42 PDT 2012


On Tue, 14.08.12 12:48, Lukáš Nykrýn (lnykryn at redhat.com) wrote:

Heya,

> > I think we should get rid of is_clean_exit_lsb() now probably, and for
> > sysv services just implicitly fill the exit code set with the valid LSB
> > exit codes. That way we can reduce the SysV specific service handling
> > code a bit more to service.c. (but don't bother with this now, this
> > should probably be fixed in a separate, other patch)
>
> I still don't like that we have hard-coded exit statuses which are
> considered as success for lsb (but I understand why it was done so). I
> am not sure if it is a good idea, but can't we pass this problem to a
> maintainer by adding possibility to set these in lsb header? (The same
> problem can be with hardcoded timeout for lsb).

These exit codes are part of the LSB specs, so whitelisting them here is
definitely safe I'd say. Note that we explicitly do not want to extend
standards we consider legacy. i.e. we support LSB init scripts to the
level that is documented in the specs and the level that is implemented
in the distros (with their extensions if necessary), but we do not want
to extend it in any way and add extensions of our own to the header that
are non-standard. Improvements and extensions should happen in the new
code, not in the compat code for old stuff. I hope that makes sense...

> > You can actually shorten this as set_get()/set_contains() should handle
> > a NULL set as the empty set.
>
> I am not quite sure what you meant here. If you were talking about
> 'successful_status &&' part, it musts stay, because
> successful_status->code would result to segfault. 

Oops, sorry, I was blind. You are right.

Patch looks good. Will commit. Thanks!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list