aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/run_onchange_after_deploy-etc.sh.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'run_onchange_after_deploy-etc.sh.tmpl')
-rwxr-xr-xrun_onchange_after_deploy-etc.sh.tmpl12
1 files changed, 12 insertions, 0 deletions
diff --git a/run_onchange_after_deploy-etc.sh.tmpl b/run_onchange_after_deploy-etc.sh.tmpl
index 743675a..a60d833 100755
--- a/run_onchange_after_deploy-etc.sh.tmpl
+++ b/run_onchange_after_deploy-etc.sh.tmpl
@@ -30,6 +30,18 @@ done
# sudo-rs: /etc/pam.d/sudo-i is a symlink to /etc/pam.d/sudo
sudo ln -sfT sudo /etc/pam.d/sudo-i
+# Mask sleep/suspend/hibernate at the unit level. See
+# etc/systemd/logind.conf.d/20-no-suspend.conf for context. This blocks
+# `systemctl suspend` from any source (manual, scripts, GUI menus) in
+# addition to the logind key/lid handler overrides. To re-enable:
+# remove these symlinks (and revert the logind drop-in) then
+# `sudo systemctl daemon-reload`.
+for target in sleep.target suspend.target hibernate.target \
+ hybrid-sleep.target suspend-then-hibernate.target; do
+ sudo ln -sfT /dev/null "/etc/systemd/system/$target"
+done
+sudo systemctl daemon-reload
+
# Reload systemd-logind so changes under /etc/systemd/logind.conf.d/
# (e.g. HandlePowerKey overrides) take effect without dropping sessions.
sudo systemctl kill -s HUP systemd-logind