liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

rc.shutdown.final (790B)


      1 #!/bin/sh -e
      2 
      3 ##  s6-linux-init-shutdownd never tells s6-svscan to exit, so if
      4 ##  you're running s6-linux-init, it's normal that your
      5 ##  .s6-svscan/finish script is not executed.
      6 
      7 ##  The place where you want to hack things is /etc/rc.shutdown.final,
      8 ##  which is run by the stage 4 script right before the hard reboot.
      9 ##  So you can do dirty stuff [...] which should clean up the
     10 ##  s6-supervise and the foreground, and give control to
     11 ##  .s6-svscan/finish.
     12 
     13 ## -- Laurent Bercot on skaware mailing list,
     14 ##    https://skarnet.org/lists/skaware/1913.html
     15 
     16 exec >/dev/console 2>&1
     17 
     18 # down, exit supervisor, wait, stay down
     19 s6-svc -dxwD /run/service/s6-linux-init-shutdownd
     20 # HUP, exit supervisor, wait, down
     21 s6-svc -hxwd /run/service/s6-svscan-log
     22 s6-svscanctl -b /run/service # abort