After more precise testing of 'systemd' version 232-21ubuntu2 from Ubuntu 17.04 Zesty with 'IdleAction=suspend' and 'IdleActionSec=2min' :
'systemd' does NOT unduly suspend my computer when there is an opened user session (OK).
But 'systemd' does NOT systematically suspend my computer 2mn after the last opened user session has been closed.
As a workaround, I am using the attached 'login-screen-suspend.sh' script.
Since '/etc/rc.local' seems to be deprecated, I am starting my script as a 'systemd' service whose '/etc/systemd/system/login-screen-suspend.service' file has following content :
I apologize, but my comment #9 was wrong :
After more precise testing of 'systemd' version 232-21ubuntu2 from Ubuntu 17.04 Zesty with 'IdleAction= suspend' and 'IdleActionSec= 2min' :
'systemd' does NOT unduly suspend my computer when there is an opened user session (OK).
But 'systemd' does NOT systematically suspend my computer 2mn after the last opened user session has been closed.
As a workaround, I am using the attached 'login- screen- suspend. sh' script. system/ login-screen- suspend. service' file has following content :
Since '/etc/rc.local' seems to be deprecated, I am starting my script as a 'systemd' service whose '/etc/systemd/
[Unit] user-sessions. service
Description=login screen suspend daemon
After=systemd-
[Service] "LOGFILE= /var/log/ login-screen- suspend. log" sbin/login- screen- suspend. sh >> $LOGFILE 2>&1"
Environment=
ExecStart=/bin/sh -c "/usr/local/
[Install] multi-user. target
WantedBy=