From 05c6e86e085e0c0fdfc84a013477efd51e700845 Mon Sep 17 00:00:00 2001 From: Érico Rolim Date: Mon, 13 Jul 2020 17:10:09 -0300 Subject: ctrlaltdel: trigger a reboot properly. /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. --- ctrlaltdel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit 1.4.1