Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ctrlaltdel and 1 for stopit and reboot files #50

Merged
merged 3 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions 1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ msg "Welcome to Void!"
# Start core services: one-time system tasks.
detect_virt
for f in /etc/runit/core-services/*.sh; do
[ -r $f ] && . $f
[ -r $f ] && . $f
done

dmesg >/var/log/dmesg.log
Expand All @@ -22,7 +22,9 @@ else
chmod 0644 /var/log/dmesg.log
fi

# create files for controlling runit
mkdir -p /run/runit
install -m100 /dev/null /run/runit/stopit
install -m000 /dev/null /run/runit/stopit
install -m000 /dev/null /run/runit/reboot

msg "Initialization complete, running stage 2..."
4 changes: 0 additions & 4 deletions 3
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ PATH=/usr/bin:/usr/sbin
detect_virt
[ -r /etc/rc.conf ] && . /etc/rc.conf

if [ -e /run/runit/reboot ]; then
chmod 100 /run/runit/reboot
fi

echo
msg "Waiting for services to stop..."
sv force-stop /var/service/*
Expand Down
5 changes: 4 additions & 1 deletion ctrlaltdel
Original file line number Diff line number Diff line change
Expand Up @@ -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