Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Systemd Service failure #134

Open
alfadhela opened this issue Dec 8, 2023 · 2 comments
Open

Systemd Service failure #134

alfadhela opened this issue Dec 8, 2023 · 2 comments

Comments

@alfadhela
Copy link

Device: Ayaneo Air Plus
OS: Linux 6.6.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 04 Dec 2023 00:29:19 +0000 x86_64 GNU/Linux

Sometimes there are a failure in the service caused by missing input events:

Dec 08 12:47:18 ayaneo nice[574]:                   ^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/evdev/uinput.py", line 282, in _find_device
Dec 08 12:47:18 ayaneo nice[574]:     d = device.InputDevice(path)
Dec 08 12:47:18 ayaneo nice[574]:         ^^^^^^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/evdev/device.py", line 127, in __init__
Dec 08 12:47:18 ayaneo nice[574]:     fd = os.open(dev, os.O_RDONLY | os.O_NONBLOCK)
Dec 08 12:47:18 ayaneo nice[574]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]: FileNotFoundError: [Errno 2] No such file or directory: '/dev/input/event7'
Dec 08 12:47:18 ayaneo systemd[1]: handycon.service: Main process exited, code=exited, status=1/FAILURE
Dec 08 12:47:18 ayaneo systemd[1]: handycon.service: Failed with result 'exit-code'.

Simple fix is to override systemd unit file:

sudo systemctl edit handycon

and add

[Service]
Restart=on-failure
RestartSec=1s
@pastaq
Copy link
Contributor

pastaq commented Dec 11, 2023

Interesting. Is there another service that is interacting with evdev file descriptors on your system?

Edit:
Also, this seems like a truncated traceback, can you post the full log?

@alfadhela
Copy link
Author

Full service life cycle log:

Dec 08 12:47:13 ayaneo systemd[1]: Started Handheld Game Console Controller Service.
Dec 08 12:47:13 ayaneo nice[574]: [231208_12:47:13 | handycon.py:85:__init__] Starting Handhend Game Console Controller Service...
Dec 08 12:47:17 ayaneo nice[574]: [231208_12:47:17 | utilities.py:269:id_system] Identified host system as AIR Plus and configured defaults for AYA_GEN5.
Dec 08 12:47:17 ayaneo nice[574]: [231208_12:47:17 | utilities.py:287:get_config] Loading existing config: /etc/handygccs/handygccs.conf
Dec 08 12:47:18 ayaneo nice[574]: Traceback (most recent call last):
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/evdev/device.py", line 125, in __init__
Dec 08 12:47:18 ayaneo nice[574]:     fd = os.open(dev, os.O_RDWR | os.O_NONBLOCK)
Dec 08 12:47:18 ayaneo nice[574]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]: FileNotFoundError: [Errno 2] No such file or directory: '/dev/input/event7'
Dec 08 12:47:18 ayaneo nice[574]: During handling of the above exception, another exception occurred:
Dec 08 12:47:18 ayaneo nice[574]: Traceback (most recent call last):
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/bin/handycon", line 8, in <module>
Dec 08 12:47:18 ayaneo nice[574]:     sys.exit(main())
Dec 08 12:47:18 ayaneo nice[574]:              ^^^^^^
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/handycon/handycon.py", line 200, in main
Dec 08 12:47:18 ayaneo nice[574]:     handycon = HandheldController()
Dec 08 12:47:18 ayaneo nice[574]:                ^^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/handycon/handycon.py", line 95, in __init__
Dec 08 12:47:18 ayaneo nice[574]:     devices.make_controller()
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/handycon/devices.py", line 653, in make_controller
Dec 08 12:47:18 ayaneo nice[574]:     handycon.ui_device = UInput(
Dec 08 12:47:18 ayaneo nice[574]:                          ^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/evdev/uinput.py", line 155, in __init__
Dec 08 12:47:18 ayaneo nice[574]:     self.device = self._find_device()
Dec 08 12:47:18 ayaneo nice[574]:                   ^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/evdev/uinput.py", line 282, in _find_device
Dec 08 12:47:18 ayaneo nice[574]:     d = device.InputDevice(path)
Dec 08 12:47:18 ayaneo nice[574]:         ^^^^^^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]:   File "/usr/lib/python3.11/site-packages/evdev/device.py", line 127, in __init__
Dec 08 12:47:18 ayaneo nice[574]:     fd = os.open(dev, os.O_RDONLY | os.O_NONBLOCK)
Dec 08 12:47:18 ayaneo nice[574]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 08 12:47:18 ayaneo nice[574]: FileNotFoundError: [Errno 2] No such file or directory: '/dev/input/event7'
Dec 08 12:47:18 ayaneo systemd[1]: handycon.service: Main process exited, code=exited, status=1/FAILURE
Dec 08 12:47:18 ayaneo systemd[1]: handycon.service: Failed with result 'exit-code'.

I think it's late input initialize.

And I don't use any evdev service alongside handycon.

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

No branches or pull requests

2 participants