[arch-general] remote poweroff with systemd

Tom Gundersen teg at jklm.no
Wed Aug 7 10:34:41 EDT 2013


On Wed, Aug 7, 2013 at 2:17 PM, Fons Adriaensen <fons at linuxaudio.org> wrote:
> On Wed, Aug 07, 2013 at 01:15:28PM +0200, Tom Gundersen wrote:
>
>> It is correct that systemtl poweroff is synchronous, but using telinit
>> or --no-block will avoid that.
>
> Are you sure about telinit ? It was the first thing I tried, assuming
> it would asynchronous. But the man page says nothing about it using
> --no-block.

If you use /bin/init (which is a symlink to systemctl) it is
synchronous, but if you change runlevel via the compatibility
/dev/initctl it is asynchronous. I couldn't find that we ship the
telinit binary in Arch, so don't know exactly what you were using, but
I assume it was the legacy one using /dev/initctl, so it should have
been async (I guess the man page should specify this).

>> The reason for the problem you are seeing here is that the network is
>> torn down before ssh is shutdown. This isn't actually a big problem,
>> as the remote machine is shutting down just fine. The only problem is
>> that the ssh client ends up hanging, which is annoying, but not really
>> critical (kill it/ignore it/whatever).
>
> The shutdowns are called from a script which is supposed to continue...

I'd make some hack like forking it off. Or better yet, use systemctl
-H (which I hope works...).

-t


More information about the arch-general mailing list