From 40df98e8f2d8eb7bef4d45d3a6b92011948d0cd5 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sat, 17 Jul 2021 20:13:42 +0200 Subject: [PATCH 1/2] [fix] Avoid to suspend server if we close lidswitch --- data/hooks/conf_regen/01-yunohost | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/hooks/conf_regen/01-yunohost b/data/hooks/conf_regen/01-yunohost index 3d65d34cd..29ce5db80 100755 --- a/data/hooks/conf_regen/01-yunohost +++ b/data/hooks/conf_regen/01-yunohost @@ -135,6 +135,16 @@ Conflicts=yunohost-firewall.service ConditionFileIsExecutable=!/etc/init.d/yunohost-firewall ConditionPathExists=!/etc/systemd/system/multi-user.target.wants/yunohost-firewall.service EOF + + # Don't suspend computer on LidSwitch + mkdir -p ${pending_dir}/etc/systemd/logind.conf.d/ + cat > ${pending_dir}/etc/systemd/logind.conf.d/yunohost.conf << EOF +[Login] +HandleLidSwitch=ignore +HandleLidSwitchDocked=ignore +HandleLidSwitchExternalPower=ignore +EOF + } do_post_regen() { From eb4bc97c5ac3e55c24a640e75359bdcfaa0c4474 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 8 Aug 2021 19:14:07 +0200 Subject: [PATCH 2/2] Update data/hooks/conf_regen/01-yunohost --- data/hooks/conf_regen/01-yunohost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/hooks/conf_regen/01-yunohost b/data/hooks/conf_regen/01-yunohost index 29ce5db80..8ef398f1d 100755 --- a/data/hooks/conf_regen/01-yunohost +++ b/data/hooks/conf_regen/01-yunohost @@ -138,7 +138,7 @@ EOF # Don't suspend computer on LidSwitch mkdir -p ${pending_dir}/etc/systemd/logind.conf.d/ - cat > ${pending_dir}/etc/systemd/logind.conf.d/yunohost.conf << EOF + cat > ${pending_dir}/etc/systemd/logind.conf.d/ynh-override.conf << EOF [Login] HandleLidSwitch=ignore HandleLidSwitchDocked=ignore