cleverca22 / not-os

An operating system generator, based on NixOS, that, given a config, outputs a small (47 MB), read-only squashfs for a runit-based operating system, with support for iPXE and signed boot.
MIT License
816 stars 39 forks source link

Configure shutdown instructions in runit stage 3 #32

Open fsagbuya opened 8 months ago

fsagbuya commented 8 months ago

Description

Proposal for additional instructions for clean shutdown during poweroff/reboot

As referred from void linux, another linux distro that uses runit as its init system.

Sample reboot log:

-bash-5.2# reboot
-bash-5.2# - runit: leave stage: /etc/runit/2
- runit: enter stage: /etc/runit/3
Waiting for services to stop...
ok: down: /etc/service/sshd: 0s, normally up, want up
ok: down: /etc/service/getty: 1s, normally up
ok: down: /etc/service/nix: 1s, normally up
Sending TERM signal to processes...
Sending KILL signal to processes...
Unmounting filesystems, disabling swap...
[   28.133778] EXT4-fs (mmcblk0p2): re-mounted. Quota mode: disabled.
Remounting rootfs read-only...
[   28.159920] EXT4-fs (mmcblk0p2): re-mounted. Quota mode: disabled.
and down we go
- runit: leave stage: /etc/runit/3
- runit: sending KILL signal to all processes...
- runit: system reboot.
[   28.208198] reboot: Restarting system
<<< NotOS Stage 1 >>>

'/bin/sh' -> '/nix/store/nynxwgjp72dl773qmgs6v7xvm79bvvbc-extra-utils-armv7l-unknown-linux-gnueabihf/bin/ash'
[    1.703390] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Quota mode: disabled.