diff --git a/.bin/Scripts/wk-power-command b/.bin/Scripts/wk-power-command new file mode 100755 index 00000000..92af02fb --- /dev/null +++ b/.bin/Scripts/wk-power-command @@ -0,0 +1,21 @@ +#!/bin/bash +# +## Wizard Kit: Wrapper for logout, reboot, & poweroff + +# Unmount filesystems +find /media -maxdepth 1 -mindepth 1 -type d \ + -exec udevil umount "{}" \; + +# Flush write cache +sudo sync + +# Perform requested action +case "${1:-x}" in + poweroff) + sudo systemctl poweroff;; + reboot) + sudo systemctl reboot;; + *) + openbox --exit;; +esac +exit 0 diff --git a/.linux_items/include/airootfs/etc/oblogout.conf b/.linux_items/include/airootfs/etc/oblogout.conf index 4595c766..ea5606ef 100644 --- a/.linux_items/include/airootfs/etc/oblogout.conf +++ b/.linux_items/include/airootfs/etc/oblogout.conf @@ -15,6 +15,6 @@ restart = R logout = L [commands] -shutdown = systemctl poweroff -restart = systemctl reboot -logout = openbox --exit +shutdown = /usr/local/bin/wk-power-command poweroff +restart = /usr/local/bin/wk-power-command reboot +logout = /usr/local/bin/wk-power-command logout diff --git a/Build Linux b/Build Linux index 2973174c..94556c2a 100755 --- a/Build Linux +++ b/Build Linux @@ -219,6 +219,10 @@ function update_live_env() { # Services sed -i -r 's/^(.*pacman-init.*)$/#NOPE#\1/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" sed -i -r 's/^(.*choose-mirror.*)$/#NOPE#\1/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + + # Shutdown stall fix + echo "sed -i -r 's/^.*(DefaultTimeoutStartSec)=.*$/\1=15s/' /etc/systemd/system.conf" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + echo "sed -i -r 's/^.*(DefaultTimeoutStopSec)=.*$/\1=15s/' /etc/systemd/system.conf" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" # SSH mkdir -p "$SKEL_DIR/.ssh"