about summary refs log tree commit diff
path: root/ctrlaltdel
diff options
context:
space:
mode:
authorÉrico Rolim <erico.erc@gmail.com>2020-07-13 17:10:09 -0300
committerAndrew J. Hesford <48421688+ahesford@users.noreply.github.com>2020-07-20 06:50:33 -0400
commit05c6e86e085e0c0fdfc84a013477efd51e700845 (patch)
tree764a8ba28a0ca39063aca546d5f952154d665f98 /ctrlaltdel
parent6cdcc01a9ef6a8f1a770ddedf1dd887ed66da269 (diff)
downloadrunit-void-05c6e86e085e0c0fdfc84a013477efd51e700845.tar.gz
runit-void-05c6e86e085e0c0fdfc84a013477efd51e700845.tar.xz
runit-void-05c6e86e085e0c0fdfc84a013477efd51e700845.zip
ctrlaltdel: trigger a reboot properly. 20200720
/run/runit/{stopit,reboot} should have their perms set to 100 by
ctrlaltdel, before runit signals itself with SIGCONT, in order to
trigger a reboot. This script can be changed by a user to perform
different actions. The comments in it explain what each file is for.
Diffstat (limited to 'ctrlaltdel')
-rwxr-xr-xctrlaltdel5
1 files changed, 4 insertions, 1 deletions
diff --git a/ctrlaltdel b/ctrlaltdel
index 7738067..866dcc8 100755
--- a/ctrlaltdel
+++ b/ctrlaltdel
@@ -3,8 +3,11 @@
 PATH=/usr/bin:/usr/sbin
 MSG="System is going down..."
 
+# We check for this file after receiving a SIGCONT to move to stage3
+chmod 100 /run/runit/stopit
+
 # We check for this file in stage3 to halt or reboot
-touch /run/runit/reboot
+chmod 100 /run/runit/reboot
 
 # Proceed with shutdown process
 echo "$MSG" | wall