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 not starting on startup altough is enabled #202

Open
RusticCraftsman opened this issue Apr 25, 2023 · 5 comments
Open

systemd service not starting on startup altough is enabled #202

RusticCraftsman opened this issue Apr 25, 2023 · 5 comments
Assignees

Comments

@RusticCraftsman
Copy link

RusticCraftsman commented Apr 25, 2023

Version Information:

  • Distribution Information ( run uname -a )
    Linux arch 6.2.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 20 Apr 2023 16:11:55 +0000 x86_64 GNU/Linux
  • swhkd version ( swhkd -V )
    swhkd 1.3.0-dev

Describe the bug:
Swhkd service does not start correctly on startup altough i have the service enabled, so every time i log in i have to manually restart it

Expected behavior:
the service starting correctly on startup

Actual behavior:
the service not starting correctly on startup

To Reproduce:
install the git version via aur and follow the systemd guide in this repo but specifying some devices

Additional information:
Anything else you'd like us to know ?
yes, here is the output of systemctl --user status hotkeys.service or by using journalctl, is the same

Apr 25 11:03:32 arch systemd[994]: Started swhkd hotkey daemon.
Apr 25 11:03:32 arch pkexec[1017]: arcus: Error executing command as another user: Not authorized [USER=root] [TTY=unknown] [CWD=/home/arcus] [COMMAND=/usr/bin/swhkd --device Video Bus --device AT Translated Set 2 keyboard]
Apr 25 11:03:32 arch hotkeys.sh[1017]: Error executing command as another user: Not authorized
Apr 25 11:03:32 arch hotkeys.sh[1017]: This incident has been reported.
@RusticCraftsman
Copy link
Author

this is the output after running systemctl --user restart hotkeys.service

Apr 25 11:26:05 arch systemd[994]: Started swhkd hotkey daemon.
Apr 25 11:26:05 arch hotkeys.sh[14097]: swhks: no process found
Apr 25 11:26:05 arch pkexec[14099]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)

I will upgrade to last version and write if it fixed itself or if something is different in the latest git version

@RusticCraftsman
Copy link
Author

Ok, no changes after upgrade, i also see what happened if i restarted 2 times in a row without intevention, but same error as first message, if you guys need more info about the service, here is the service itself located at /etc/systemd/user/hotkeys.service

[Unit]
Description=swhkd hotkey daemon
BindsTo=default.target

[Service]
Type=simple
ExecStart=/home/arcus/scripts/system/hotkeys.sh

[Install]
WantedBy=default.target

And here is the script itself

#!/usr/bin/env bash

killall swhks

swhks & pkexec swhkd --device 'Video Bus' --device 'AT Translated Set 2 keyboard'

@RusticCraftsman
Copy link
Author

i realized im also not being able to start the system again, here are the journalctl logs

Apr 25 13:45:22 arch pkexec[16177]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Main process exited, code=exited, status=1/FAILURE
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Failed to kill control group /user.slice/user-1000.slice/[email protected]/app.slice/hotkeys.service, ignoring: Operation not permitted
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Killing process 15134 (swhkd) with signal SIGKILL.
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Failed to kill control group /user.slice/user-1000.slice/[email protected]/app.slice/hotkeys.service, ignoring: Operation not permitted
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Failed to kill control group /user.slice/user-1000.slice/[email protected]/app.slice/hotkeys.service, ignoring: Operation not permitted
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Killing process 15134 (swhkd) with signal SIGKILL.
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Failed to kill control group /user.slice/user-1000.slice/[email protected]/app.slice/hotkeys.service, ignoring: Operation not permitted
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Failed with result 'exit-code'.
Apr 25 13:45:22 arch systemd[985]: hotkeys.service: Unit process 15134 (swhkd) remains running after unit stopped.

so i tried killing swhkd with sudo and also killed swhks and restart the service again, got a different behaviour
It does start, but for some reason it does not work, it does not take my shortcuts and execute the commands

Apr 25 13:52:29 arch systemd[985]: Started swhkd hotkey daemon.
Apr 25 13:52:29 arch hotkeys.sh[19425]: swhks: no process found
Apr 25 13:52:29 arch pkexec[19427]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)

@RusticCraftsman
Copy link
Author

so i tried killing swhkd with sudo and also killed swhks and restart the service again, got a different behaviour It does start, but for some reason it does not work, it does not take my shortcuts and execute the commands

Apr 25 13:52:29 arch systemd[985]: Started swhkd hotkey daemon.
Apr 25 13:52:29 arch hotkeys.sh[19425]: swhks: no process found
Apr 25 13:52:29 arch pkexec[19427]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)

I realized why, idk what happened but my swhkd config file /etc/swhkd/swhkdrc was erased from existence, putting it back seems to make it work, i now shall see if with some tweaking i can make it work properly on startup

@RusticCraftsman
Copy link
Author

i havent seem to find a way to make it work on startup, i dont even know what could work tbh

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

4 participants