Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow starting from the user systemd #145

Open
muff1nman opened this issue Aug 2, 2019 · 0 comments
Open

Allow starting from the user systemd #145

muff1nman opened this issue Aug 2, 2019 · 0 comments

Comments

@muff1nman
Copy link

Given light-locker is setup as a user-based systemd unit:

[Unit]
Description=Light Locker Daemon
PartOf=graphical-session.target

[Service]
ExecStart=/usr/bin/bash -c 'echo XDG_SESSION_PATH: $XDG_SESSION_PATH && /usr/bin/light-locker --debug --late-locking'
Restart=always

[Install]
WantedBy=xmonad.target

I'd like light locker to start correctly. However, the process dumps with:

bash[2573]:  PID 2573 does not belong to any known session
light-locker[2573]: session_id is not set, is /proc mounted with hidepid>0?

I think this is because a process started from the user systemd instance does not have a session id associated. This can be seen with another process (compton) that is correctly working from the user systemd instance:

  CGroup: /
           ├─user.slice
           │ └─user-1001.slice
           │   ├─session-2.scope
           │   │ ├─2221 gpg-agent --homedir /home/ademaria/.gnupg --use-standard-socket --daemon
           │   │ └─3122 scdaemon --multi-server
           │   ├─[email protected]
           │   │ ├─dbus\x2d:1.2\x2dca.desrt.dconf.slice
           │   │ │ └─dbus-:[email protected]
           │   │ │   └─1813 /usr/libexec/dconf-service
           │   │ ├─dbus-broker.service
           │   │ │ ├─1746 /usr/bin/dbus-broker-launch --scope user
           │   │ │ └─1749 dbus-broker --log 4 --controller 11 --machine-id 39accfde5dfd474a9933d254be437571 --max-bytes 100000000000000 --max-fds 250000000000>
           │   │ ├─dbus\x2d:1.11\x2dorg.a11y.atspi.Registry.slice
           │   │ │ └─dbus-:[email protected]
           │   │ │   └─5677 /usr/libexec/at-spi2-registryd --use-gnome-session
           │   │ ├─dbus\x2d:1.2\x2dorg.gnome.GConf.slice
           │   │ │ └─dbus-:[email protected]
           │   │ │   └─1803 /usr/libexec/gconfd-2
           │   │ ├─gvfs-daemon.service
           │   │ │ ├─2154 /usr/libexec/gvfsd
           │   │ │ └─2159 /usr/libexec/gvfsd-fuse /run/user/1001/gvfs -f -o big_writes
           │   │ ├─init.scope
           │   │ │ ├─1723 /usr/lib/systemd/systemd --user
           │   │ │ └─1725 (sd-pam)
           │   │ ├─at-spi-dbus-bus.service
           │   │ │ ├─1814 /usr/libexec/at-spi-bus-launcher
           │   │ │ ├─1821 /usr/bin/dbus-broker-launch --config-file=/usr/share/defaults/at-spi2/accessibility.conf --scope user
           │   │ │ └─1822 dbus-broker --log 4 --controller 9 --machine-id 39accfde5dfd474a9933d254be437571 --max-bytes 100000000000000 --max-fds 6400000 --max>
           │   │ └─compton.service
           │   │   └─8244 /usr/bin/compton --backend glx --vsync opengl-swc -C -f -D 5
           │   └─session-8.scope
           │     ├─ 5585 lightdm --session-child 14 22
           │     ├─ 5614 /usr/bin/gnome-keyring-daemon --daemonize --login
           │     ├─ 5617 /usr/bin/sh /usr/bin/xmonad-start
           │     ├─ 5635 /usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c "xmonad-start"
           │     ├─ 5669 /home/ademaria/.xmonad/xmonad-x86_64-linux
           │     ├─ 5705 mate-terminal

and with ps:

$ ps -eo pid,cmd,lsession  | grep compton
 8244 /usr/bin/compton --backend  -
$ ps -eo pid,cmd,lsession  | grep xmonad
 5617 /usr/bin/sh /usr/bin/xmonad 8
 5669 /home/ademaria/.xmonad/xmon 8

This all stems from the fact that my window manager, xmonad, doesn't really do anything with things in /etc/xdg/autostart. My hope was to use a systemd user instance instead for autostarting, and hence running into this issue.

RA-Kooi added a commit to RA-Kooi/light-locker that referenced this issue Oct 19, 2020
The previous developer left in a debug remnant breaking systemd support.
Fixes: the-cavalry#145, the-cavalry#141, possibly the-cavalry#151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant