[systemd-devel] systemctl [en|dis]able weirdness + reload (writes /run/nologin)

Colin Guthrie gmane at colin.guthr.ie
Mon Jan 13 03:16:01 PST 2014


Hi,

I've just been debugging a weird problem in my 208 build (which is quite
similar to Fedora's - a lot of the same patches).

So far I've noticed two problems:


1. If I do "systemctl enable sysvinitscript" it will print me a warning
about how the units do not carry [Install] sections. This is
unsurprising as there are no units (the systemctl.c mangled_names - or
just names in git master) left after the enable_sysv_units() method is
called and the first item is a pointer to a null string. I suspect
various bus calls could just be harmlessly skipped if this is the case
(i.e. just don't do the various unit related method calls) as we know
they are handled locally.

I've attached two patches which should solve this (one for 208+patches
and one for git master aka 209) although I've not tested either
directly. Some other eyes on it as to whether it's the correct approach
or not would be appreciated. The only difference between the two
versions is a variable name change.



2. This is the much odder part of the problem I'm seeing. The call to
daemon_reload() at the end of the enable_unit() seems to trigger some
kind of broken daemon reload that puts things into a bad state,
including a stale /run/nologin file.

I'm not sure WHY this does this, but it's very reliably reproducible. I
have a native sysvinit script called numlock. All I need to do to
trigger the bad state is "systemctl disable numlock". After the call,
the systemd daemon is reloaded and it goes into this bad state
completely with /run/nologin file.

If I comment out call or use --no-reload, then all is well. If I call
"systemctl daemon-reload" on it's own, all seems well. It just seems to
be this reload call specifically at the end of enable_unit() that
triggers the bad state.



I'm going to try reverting some of the patches I have applied to see
where I get with things, as I see Zbigniew backed a few out of fedora
due to freeze rules, but I did also see some threads from Zbigniew about
the whole /run/nologin, so I suspect he may be interested in this.

Cheers


Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0209-systemctl-Do-not-attempt-native-calls-for-enable-dis.patch
Type: text/x-patch
Size: 2277 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140113/11d1fd91/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0208-systemctl-Do-not-attempt-native-calls-for-enable-dis.patch
Type: text/x-patch
Size: 2343 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140113/11d1fd91/attachment-0001.bin>


More information about the systemd-devel mailing list