5 Commits

Author SHA1 Message Date
Érico Rolim
c75de34303 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.

Patch created for Void, imported to Artix.
2020-08-03 23:01:04 +07:00
Érico Rolim
6453301c3b 3: remove /run/runit/reboot handling.
runit uses the permissions in the /etc/runit/reboot file to determine
whether it's going to perform a halt or reboot action. This conditional
in 3 meant that touching the reboot file, even with 000 perms, would
lead to a reboot, which goes agains what is expected according to the
runit documentation.

Patch made for Void, imported to Artix.
2020-08-03 23:00:29 +07:00
Érico Rolim
454078d6a0 1: only create /run/runit directory.
The 100 permission in /run/runit/stopit made it so that signaling runit
with SIGCONT would shut the system down. To achieve the correct
behavior, we should create the stopit and reboot files with 000 perms,
and allow their permissions to be set correctly by calls to `init 0` or
`init 6` or by /etc/runit/ctrlaltdel.

Patch created for Void, imported to Artix.
2020-08-03 22:59:27 +07:00
05801e2283 don't install rc.local -- let users create their own 2020-01-08 15:58:01 +07:00
f84f50c4e9 fix deprecation message 2020-01-01 09:49:40 +07:00
5 changed files with 7 additions and 8 deletions

View File

@@ -120,7 +120,6 @@ install-runit:
install -d $(DESTDIR)$(RCDIR)
install -m755 $(RCLOCAL) $(DESTDIR)$(RCDIR)
install -m755 $(RCLOCAL) $(DESTDIR)$(SYSCONFDIR)
install -d $(DESTDIR)$(BINDIR)
install -m755 $(BIN) $(DESTDIR)$(BINDIR)

View File

@@ -6,6 +6,7 @@ PATH=/usr/bin:/usr/sbin
run_sysinit
install -m100 /dev/null @RUNDIR@/stopit
install -m000 /dev/null @RUNDIR@/stopit
install -m000 /dev/null @RUNDIR@/reboot
status "Initialization complete"

View File

@@ -13,7 +13,7 @@ done
if [ -x @RCDIR@/rc.local ] && grep -qv '^#' @RCDIR@/rc.local; then
@RCDIR@/rc.local
echo "==> @RCDIR@/rc.local has been deprecated. Please move the contents"
echo " of the file to @SYSCONFDIR/rc.local, since the next version of"
echo " of the file to @SYSCONFDIR@/rc.local, since the next version of"
echo " runit-artix won't read @RCDIR@/rc.local anymore."
fi
[ -x @SYSCONFDIR@/rc.local ] && @SYSCONFDIR@/rc.local

View File

@@ -19,10 +19,6 @@ if [ -x @RCDIR@/rc.shutdown ] && grep -qv '^#' @RCDIR@/rc.shutdown; then
fi
[ -x @SYSCONFDIR@/rc.local ] && @SYSCONFDIR@/rc.local
if [ -e @RUNDIR@/reboot ]; then
chmod 100 @RUNDIR@/reboot
fi
run_shutdown
if [ -e @RUNDIR@/reboot ]; then

View File

@@ -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 @RUNDIR@/stopit
# We check for this file in stage3 to halt or reboot
touch @RUNDIR@/reboot
chmod 100 @RUNDIR@/reboot
# Proceed with shutdown process
echo "$MSG" | wall