Bug#837194: systemd --user: service action not triggered
Brainslug
brainslug at freakmail.de
Sat Sep 10 00:00:15 BST 2016
Package: systemd
Version: 231-4
Severity: normal
Dear Maintainer,
I have a business laptop for which I do not have root access. The system
is configured to suspend when I press the power key. Now I am trying to
configure systemd on a user level to lock my screen before the system
suspends.
I have a working service file in ~/.config/systemd/user/i3lock.service,
like so:
[Unit]
Description=i3lock
Before=sleep.target
[Service]
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -c 000000
[Install]
WantedBy=sleep.target
I can enable the service via the --user option:
brainslug at flexo:~$ systemctl --user enable i3lock
Created symlink
/home/brainslug/.config/systemd/user/sleep.target.wants/i3lock.service →
/home/brainslug/.config/systemd/user/i3lock.service.
I can start the service via
brainslug at flexo:~$ systemctl --user start i3lock
which immediately locks my screen, so I would think the service file
itself is correct and working.
However, when suspending the laptop this does not seem to trigger my
service file and my screen remains unlocked on resume.
When I check on the service status, this is what I get:
brainslug at flexo:~$ systemctl --user status i3lock
● i3lock.service - i3lock
Loaded: loaded (/home/brainslug/.config/systemd/user/i3lock.service;
enabled; vendor preset: enabled)
Active: inactive (dead)
FWIW, I am using lightdm and window maker.
Thanks!
-- Package-specific info:
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (800, 'testing'), (690, 'unstable'), (680, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 4.6.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages systemd depends on:
ii adduser 3.115
ii libacl1 2.2.52-3
ii libapparmor1 2.10.95-4
ii libaudit1 1:2.6.6-1
ii libblkid1 2.28.1-1
ii libc6 2.23-5
ii libcap2 1:2.25-1
ii libcap2-bin 1:2.25-1
ii libcryptsetup4 2:1.7.0-2
ii libgcrypt20 1.7.3-1
ii libgpg-error0 1.24-1
ii libidn11 1.33-1
ii libkmod2 22-1.1
ii liblzma5 5.1.1alpha+20120614-2.1
ii libmount1 2.28.1-1
ii libpam0g 1.1.8-3.3
ii libseccomp2 2.3.1-2
ii libselinux1 2.5-3
ii libsystemd0 231-4
ii mount 2.28.1-1
ii util-linux 2.28.1-1
Versions of packages systemd recommends:
ii dbus 1.10.10-1
ii libpam-systemd 231-4
Versions of packages systemd suggests:
ii policykit-1 0.105-16
pn systemd-container <none>
pn systemd-ui <none>
Versions of packages systemd is related to:
ii udev 231-4
-- Configuration Files:
/etc/systemd/logind.conf changed:
[Login]
HandlePowerKey=suspend
HandleSuspendKey=hibernate
HandleHibernateKey=hibernate
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
-- no debconf information
More information about the Pkg-systemd-maintainers
mailing list