[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] reboot: recognize and ignore -f/--force

From: Sergey Bugaev
Subject: Re: [PATCH] reboot: recognize and ignore -f/--force
Date: Tue, 19 Oct 2021 15:12:27 +0300

On Tue, Oct 19, 2021 at 2:27 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> Reboot-hurd is already that actually. What -f ignores on Linux is the
> daemon shut down, which reboot-hurd ignores as well. People still expect
> Linux to properly flush page cache and buffers, i.e. safely shut down
> translators, which reboot-hurd does.

I'm not exactly an expert on this, but I believe on "traditional" GNU/Linux
systems, 'reboot' calls through to the init system, and 'reboot -f' just
calls reboot(2) itself, without killing any processes or unmounting anything.

Whereas on systemd (which I assume you're talking about), there are three
levels of rebooting:

* 'reboot' asks PID 1 to reboot orderly, with service shutdown, remounting
  filesystems, jumping back into initrd, etc. This is the moral equivalent
  of 'reboot-sysv' in Debian GNU/Hurd.

* 'reboot --force' asks PID 1 to reboot forcefully, killing all processes,
  but still unmounting filesystems cleanly. This is the moral equivalent of
  'reboot-hurd', aka sutils/reboot.c, which RPCs to /hurd/startup to notify
  system servers (read: translators) of reboot to shut them down cleanly.

* 'reboot --force --force' just does the Linux reboot() syscall directly,
  for the case PID 1 is broken. This would be the 'reboot-hurd --force'
  behavior I'm suggesting.

Note that 'reboot --force --force' still does a sync(); which we could try
to emulate as fsys_syncfs (rootfs, do_children = true).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]