On Mon, 18.07.16 15:17, Clemens Gruber (clemens.gru...@pqgruber.com) wrote:
> Hi, > > On Mon, Jul 18, 2016 at 03:02:10PM +0200, Lennart Poettering wrote: > > Well, if they don't want to make SIGRTMIN+4 the default because they > > think sysvinit/Upstart is more relevant than systemd, then that's > > their right. But I think making the kill signal configurable per > > container would probably be a good idea. That's what we do in nspawn, > > where SIGRTMIN+3 is the default, but you can override it with > > --kill-signal= on the cmdline (or KillSignal= in .nspawn files), for > > compat with sysv. > > I am also sending SIGPWR from a power related kernel module to PID 1 and > I hooked a service which calls "systemctl poweroff -f" to > sigpwr.target. To me this really appears backwards... Having kernel code request some operation from userspace like this is the wrong way around. Instead, I figure there should be some userspace component that listens to events from the kernel and then acts on it, asking systemd to shut down... But anyway, precisely to cover for kernel code like this we stay out of SIGPWR handling really, and allow the user to turn this into anything he likes by passing this to a target that may be defined freely. If all you want to do on SIGPWR is shut down the system I think the easiest would be to just add a symlink /etc/systemd/system/sigpwr.target → /usr/lib/systemd/system/poweroff.target. > If I instead send SIGRTMIN+4, this would be equivalent to calling > systemctl poweroff which takes too long in my use case (power loss > imminent due to overcurrent or undervoltage situations in an embedded > system, triggered by an interrupt. In the interrupt handler, I send the > SIGPWR signal at the moment). > > Would sending SIGRTMIN+14 to PID 1 be identical to calling "systemctl > poweroff --force" ? Yes. Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel