"herd restart term-tty2" caused *all* processes to be killed

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Mark H Weaver
Owner
unassigned
Submitted by
Mark H Weaver
Severity
normal
M
M
Mark H Weaver wrote on 3 Dec 2018 02:16
(address . bug-guix@gnu.org)
87tvjvmmt3.fsf@netris.org
After killing a Wayland 'gnome-session' that I had launched from the
command-line on tty2, the login prompt did not return as it normally
does.

I decided to try "herd restart term-tty2" to see if that would help.
That turned out to be a serious mistake. It caused TERM to be sent to
all processes, most filesystems to be unmounted, and many (all?) core
services to be stopped. This left my system in a unusuable state,
besides being able to switch between otherwise unresponsive text virtual
terminals and issue SysRq commands.

I took a picture of the display before resetting the machine.
Fortunately I always use text virtual terminals for my root shells.
Here's a hand-typed approximation of what shepherd printed to the
console:

Toggle snippet (36 lines)
root@jojen ~# herd restart term-tty2
[200060.46xxxx] shepherd[1]: Service term-tty4 has been stopped.
[200060.46xxxx] shepherd[1]: Service nscd has been stopped.
[200060.47xxxx] shepherd[1]: Service guix-daemon has been stopped.
[200060.47xxxx] shepherd[1]: Service term-tty2 has been stopped.
[200060.47xxxx] shepherd[1]: Service console-font-tty1 has been stopped.
[200060.48xxxx] shepherd[1]: Service term-tty1 has been stopped.
[200060.48xxxx] shepherd[1]: Service console-font-tty5 has been stopped.
[200060.48xxxx] shepherd[1]: Service term-tty5 has been stopped.
[200060.49xxxx] shepherd[1]: sending all processes the TERM signal
[200064.81xxxx] shepherd[1]: all processes have been terminated
[200064.81xxxx] shepherd[1]: Service user-processes has been stopped.
[200064.82xxxx] shepherd[1]: Service urandom-seed has been stopped.
[200064.82xxxx] shepherd[1]: Service file-systems has been stopped.
[200064.83xxxx] shepherd[1]: Service file-system-/dev/pts has been stopped.
[200064.84xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/blkio has been stopped.
[200064.86xxxx] shepherd[1]: Service file-system-/gnu/store has been stopped.
[200064.88xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/freezer has been stopped.
[200064.90xxxx] shepherd[1]: Service file-system-/run/systemd has been stopped.
[200064.91xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/cpuset has been stopped.
[200064.93xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/cpuacct has been stopped.
[200064.95xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/devices has been stopped.
[200064.96xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/perf_event has been stopped.
[200064.98xxxx] shepherd[1]: Service file-system-/run/user has been stopped.
[200065.00xxxx] shepherd[1]: Service file-system-/dev/shm has been stopped.
[200065.01xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/memory has been stopped.
[200065.03xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/elogind has been stopped.
[200065.05xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup/cpu has been stopped.
[200065.06xxxx] shepherd[1]: Service file-system-/sys/fs/cgroup has been stopped.
[200065.06xxxx] shepherd[1]: system-error("kill" "~A" ("No such process") (3))
[200065.06xxxx] shepherd[1]: Service udev has been stopped.
[200065.06xxxx] shepherd[1]: Service virtual-terminal has been stopped.
[200065.19xxxx] shepherd[1]: closing log
[200065.23xxxx] BTRFS info (device dm-0): disk space caching is enabled

The 'xxxx' are of course more digits that I was too lazy to type.

I would not have expected 'term-tty2' to have many dependents, except
possibly for 'console-font-tty2'. It was a great surprise that
restarting it caused so many other core services to be stopped.

Any idea what went wrong here?

Mark
L
L
Ludovic Courtès wrote on 3 Dec 2018 09:44
(name . Mark H Weaver)(address . mhw@netris.org)(address . 33592@debbugs.gnu.org)
87k1kratk0.fsf@gnu.org
Hello,

Mark H Weaver <mhw@netris.org> skribis:

Toggle quote (11 lines)
> After killing a Wayland 'gnome-session' that I had launched from the
> command-line on tty2, the login prompt did not return as it normally
> does.
>
> I decided to try "herd restart term-tty2" to see if that would help.
> That turned out to be a serious mistake. It caused TERM to be sent to
> all processes, most filesystems to be unmounted, and many (all?) core
> services to be stopped. This left my system in a unusuable state,
> besides being able to switch between otherwise unresponsive text virtual
> terminals and issue SysRq commands.

Per ‘guix system shepherd-graph desktop.tmpl’, the only dependent of
‘term-tty2’ is ‘console-font-tty2’.

I just tried in a desktop.tmpl VM and only ‘console-font-tty2’ is
restarted (screenshot attached.) Same on my laptop, which uses Xorg but
not GNOME.

Could it be something with the Wayland-related services? Could you
check ‘guix system shepherd-graph’ on your config?

Thanks,
Ludo’.
Attachment: t.png
M
M
Mark H Weaver wrote on 4 Dec 2018 03:10
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 33592@debbugs.gnu.org)
87k1kq2g8o.fsf@netris.org
Hi,

ludo@gnu.org (Ludovic Courtès) writes:

Toggle quote (23 lines)
> Mark H Weaver <mhw@netris.org> skribis:
>
>> After killing a Wayland 'gnome-session' that I had launched from the
>> command-line on tty2, the login prompt did not return as it normally
>> does.
>>
>> I decided to try "herd restart term-tty2" to see if that would help.
>> That turned out to be a serious mistake. It caused TERM to be sent to
>> all processes, most filesystems to be unmounted, and many (all?) core
>> services to be stopped. This left my system in a unusuable state,
>> besides being able to switch between otherwise unresponsive text virtual
>> terminals and issue SysRq commands.
>
> Per ‘guix system shepherd-graph desktop.tmpl’, the only dependent of
> ‘term-tty2’ is ‘console-font-tty2’.
>
> I just tried in a desktop.tmpl VM and only ‘console-font-tty2’ is
> restarted (screenshot attached.) Same on my laptop, which uses Xorg but
> not GNOME.
>
> Could it be something with the Wayland-related services? Could you
> check ‘guix system shepherd-graph’ on your config?

I did so, and it shows that the only dependent of 'term-tty2' is
'console-font-tty2', as expected.

I've attached my OS config, in case it contains any clues.

Thanks,
Mark
Attachment: config.scm
?