2023-04-19 22:41:05 +02:00
|
|
|
#!/bin/sh -e
|
2022-09-22 00:01:21 +02:00
|
|
|
|
2023-11-22 01:05:55 +01:00
|
|
|
## s6-linux-init-shutdownd never tells s6-svscan to exit, so if
|
|
|
|
## you're running s6-linux-init, it's normal that your
|
|
|
|
## .s6-svscan/finish script is not executed.
|
2022-09-22 00:01:21 +02:00
|
|
|
|
2023-11-22 01:05:55 +01:00
|
|
|
## The place where you want to hack things is /etc/rc.shutdown.final,
|
|
|
|
## which is run by the stage 4 script right before the hard reboot.
|
|
|
|
## So you can do dirty stuff [...] which should clean up the
|
|
|
|
## s6-supervise and the foreground, and give control to
|
|
|
|
## .s6-svscan/finish.
|
2022-09-22 00:01:21 +02:00
|
|
|
|
2023-11-22 01:05:55 +01:00
|
|
|
## -- Laurent Bercot on skaware mailing list,
|
|
|
|
## https://skarnet.org/lists/skaware/1913.html
|
2022-09-22 00:01:21 +02:00
|
|
|
|
2023-11-22 01:05:55 +01:00
|
|
|
exec >/dev/console 2>&1
|
|
|
|
|
|
|
|
# down, exit supervisor, wait, stay down
|
|
|
|
s6-svc -dxwD /run/service/s6-linux-init-shutdownd
|
|
|
|
# HUP, exit supervisor, wait, down
|
|
|
|
s6-svc -hxwd /run/service/s6-svscan-log
|
|
|
|
s6-svscanctl -b /run/service # abort
|