[systemd-devel] sigpwr.target - intended usage?

Michael Biebl mbiebl at gmail.com
Mon Jul 18 11:37:32 UTC 2016


Apparently SIGPWR is used by lxc-stop to shut down LXC containers.
What interface would you recommend instead?

https://lists.linuxcontainers.org/pipermail/lxc-users/2015-May/009279.html

2016-07-18 12:36 GMT+02:00 Lennart Poettering <lennart at poettering.net>:
> On Sat, 16.07.16 17:22, Christian Hofstaedtler (ch at zeha.at) wrote:
>
>> Hi,
>>
>> I'm trying to understand how sigpwr.target is intended to be used,
>> but couldn't find a good explanation. systemd.special says this
>> target is invoked in a power fail situation, but what should happen
>> then?
>>
>> Debian, Ubuntu and PLD install "sigpwr-container-shutdown.service",
>> which for ConditionVirtualization=container runs systemctl
>> --no-block poweroff, i.e. triggers a shutdown for containers. For
>> "normal" hardware, nothing appears to be triggered.
>>
>> I could not find any services installed by Fedora or openSuSE, but
>> maybe I was looking in the wrong places.
>>
>> I'm now somewhat assuming there should be a default "policy" service
>> that causes sigpwr.target to initiate a shutdown?
>>
>> Pointers/hints on what is expected behaviour from sigpwr.target
>> would be highly appreciated.
>
> My recommendatin: don't bother with SIGPWR. Traditionally on UNIX UPS
> software sends SIGPWR to PID 1 to initiate some special kind of
> shutdown operation. But it's very vaguely defined only, and one
> wonders why a normal shutdown isn't enough here, and why to bounce
> this off PID 1 with a special UNIX signal even...
>
> I am pretty sure that power management software that runs in userspace
> really shouldn't make use of this anymore. It should just request a
> normal shutdown. The only reason why one would want to bother with
> SIGPWR at all is that some really power-related old kernel drivers
> send SIGPWR to PID 1 too.
>
> From the systemd PoV: this stuff is ugly legacy crap that only exists
> for historic reasons and was never really well-defined in its
> behavour. It mostly appears to be a concept that exists only because
> Linux never had a useful IPC that was accessible from both kernelspace
> and userspace in a sane way... In systemd, we don't want anything to
> do with it, but some legacy folks really think it's superduper
> important. Hence we simply map it to a target unit, and enable users
> to map it to whatever they want to map it, but don't do anything smart
> about it at all on our own.
>
> I think it would be best of people would just forget about it...
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



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


More information about the systemd-devel mailing list