Address shutdown slowdowns
* Unmount filesystem(s) and flush write cache before poweroff/reboot * Also adjusted timouts to maybe fix issue #52
This commit is contained in:
parent
da92cee338
commit
1e21c04a3e
3 changed files with 28 additions and 3 deletions
21
.bin/Scripts/wk-power-command
Executable file
21
.bin/Scripts/wk-power-command
Executable file
|
|
@ -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
|
||||||
|
|
@ -15,6 +15,6 @@ restart = R
|
||||||
logout = L
|
logout = L
|
||||||
|
|
||||||
[commands]
|
[commands]
|
||||||
shutdown = systemctl poweroff
|
shutdown = /usr/local/bin/wk-power-command poweroff
|
||||||
restart = systemctl reboot
|
restart = /usr/local/bin/wk-power-command reboot
|
||||||
logout = openbox --exit
|
logout = /usr/local/bin/wk-power-command logout
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,10 @@ function update_live_env() {
|
||||||
# Services
|
# Services
|
||||||
sed -i -r 's/^(.*pacman-init.*)$/#NOPE#\1/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
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"
|
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
|
# SSH
|
||||||
mkdir -p "$SKEL_DIR/.ssh"
|
mkdir -p "$SKEL_DIR/.ssh"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue