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

Colin Guthrie gmane at colin.guthr.ie
Mon Jan 20 08:18:30 PST 2014


'Twas brillig, and Lennart Poettering at 20/01/14 12:45 did gyre and gimble:
> On Mon, 13.01.14 11:16, Colin Guthrie (gmane at colin.guthr.ie) wrote:
> 
>> 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.
> 
> For this issue I applied a different patch to git now. Can you check
> pls?
> 
> (The patch simply skips all of the native enabling if the list is empty,
> including the reload, under the assumption that chkconfig will care for
> that on its own...) 

Yeah that fix seems to be fine generally.

Technically, until I/we can get to the bottom of the underlying race
problem, this approach doesn't help all cases - e.g. if someone does a
"systemctl enable sysvinitservice nativeservice", then we will still get
two reloads in quick succession (or interleaved or whatever) and go
boom. So this is still a corner case just now, but it should be
considered separately to this fix so I'd give it my ACK on that principle.

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/


More information about the systemd-devel mailing list