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

Systemd service won't start #235

Open
jdnixx opened this issue Feb 3, 2024 · 2 comments
Open

Systemd service won't start #235

jdnixx opened this issue Feb 3, 2024 · 2 comments
Assignees

Comments

@jdnixx
Copy link

jdnixx commented Feb 3, 2024

Version Information:
Built from latest commit 30f25b5

  • Distribution Information ( run uname -a )
    Linux KUBUNTUWU 6.5.0-15-generic Update man pages #15-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 9 17:03:36 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • swhkd version ( swhkd -V )
    swhkd 1.3.0-dev

Describe the bug:
Systemd service won't start when following the instructions at https://github.com/waycrate/swhkd/blob/main/contrib/init/systemd/README.md

Expected behavior:
Expect systemd to start swhkd and swhks at system startup

Actual behavior:
journal shows:

Feb 03 11:37:16 KUBUNTUWU systemd[4361]: hotkeys.service: Failed with result 'exit-code'.
Feb 03 11:37:16 KUBUNTUWU systemd[4361]: hotkeys.service: Main process exited, code=exited, status=127/n/a

To Reproduce:
Compile swhkd according to build instructions, follow the systemd service instructions in the readme, and restart system

Additional information:
Here's specifically what i did to enable systemd service:

wget -O ~/.config/swhkd/hotkeys.sh https://raw.githubusercontent.com/waycrate/swhkd/main/contrib/init/systemd/hotkeys.sh
chmod +x ~/.config/swhkd/hotkeys.sh
wget -O ~/.config/systemd/user/hotkeys.service https://raw.githubusercontent.com/waycrate/swhkd/main/contrib/init/systemd/hotkeys.service
# now uncomment line 7 of hotkeys.service and change the path accordingly:
nano ~/.config/systemd/user/hotkeys.service
ExecStart=/home/congrav1ty/.config/swhkd/hotkeys.sh
# finally:
systemctl --user enable hotkeys.service

Then restarted the system and got the "actual behavior" above in the journal.

When trying systemctl --user restart hotkeys.service this is the result (journalctl -r):

Feb 03 11:40:55 KUBUNTUWU hotkeys.sh[16402]: [2024-02-03T16:40:55Z ERROR swhkd] Could not open evdev device at /dev/input/mouse4: Inappropriate ioctl for device (os error 25)
Feb 03 11:40:55 KUBUNTUWU systemd-logind[1474]: Watching system buttons on /dev/input/event18 (swhkd switches virtual output)
Feb 03 11:40:55 KUBUNTUWU kernel: rfkill: input handler enabled
Feb 03 11:40:55 KUBUNTUWU kernel: input: swhkd switches virtual output as /devices/virtual/input/input21
Feb 03 11:40:55 KUBUNTUWU kernel: rfkill: input handler disabled
Feb 03 11:40:55 KUBUNTUWU kernel: input: swhkd virtual output as /devices/virtual/input/input20
Feb 03 11:40:55 KUBUNTUWU hotkeys.sh[16402]: [2024-02-03T16:40:55Z ERROR swhkd] XDG_RUNTIME_DIR has not been set.
Feb 03 11:40:55 KUBUNTUWU hotkeys.sh[16402]: [2024-02-03T16:40:55Z ERROR swhkd] XDG_CONFIG_HOME has not been set.
Feb 03 11:40:55 KUBUNTUWU hotkeys.sh[16402]: [2024-02-03T16:40:55Z WARN  swhkd] Running swhkd as root!
Feb 03 11:40:55 KUBUNTUWU hotkeys.sh[16402]: [2024-02-03T16:40:55Z ERROR swhkd] XDG_RUNTIME_DIR has not been set.
Feb 03 11:40:55 KUBUNTUWU pkexec[16402]: congrav1ty: Executing command [USER=root] [TTY=unknown] [CWD=/home/congrav1ty] [COMMAND=/usr/bin/swhkd]
Feb 03 11:40:55 KUBUNTUWU pkexec[16402]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)
Feb 03 11:40:55 KUBUNTUWU hotkeys.sh[16398]: swhks: no process found
Feb 03 11:40:55 KUBUNTUWU systemd[4361]: Started hotkeys.service - swhkd hotkey daemon.

Also get a few of these but not sure if they're relevant.

Feb 03 11:40:51 KUBUNTUWU systemd[4361]: Configuration file /home/congrav1ty/.config/systemd/user/hotkeys.service is marked world-writable. Please remove world writability permission bits. Proceeding anyway.
Feb 03 11:40:51 KUBUNTUWU systemd[4361]: Configuration file /home/congrav1ty/.config/systemd/user/hotkeys.service is marked executable. Please remove executable permission bits. Proceeding anyway.
@mrdaybird
Copy link

mrdaybird commented Feb 24, 2024

Can you try putting your hotkeys.service in one of XDG_CONFIG_DIRS folders?(for me this is somewhere in /etc folder)
Also don't forget to remove the previous service.

@jdnixx
Copy link
Author

jdnixx commented Feb 28, 2024

Ok, XDG_CONFIG_DIRS gives /home/congrav1ty/.config/kdedefaults:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings so I stuck hotkeys.service in the kdedefaults directory and deleted the old service. Do I have to do something to get systemd to pick up the service in the new directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants