You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Possibly related to the complaints at #15. I've submitted #33 with systemd instructions, but turns out my tries cause Python errors I have no clue how to solve.
To Reproduce
If I run the application manually, it works great. However, the following /etc/systemd/system/halinuxcompanion.service yields errors:
[Unit]Description=Home Assistant Linux Companion
Documentation=https://github.com/muniter/halinuxcompanion
After=networking.target
[Service]WorkingDirectory=/opt/halinuxcompanion
ExecStart=/opt/halinuxcompanion/.venv/bin/python -m halinuxcompanion -c config.json
Restart=always
RestartSec=30
# User=igor # I tried adding this, but doesn't help with the issue[Install]WantedBy=default.target
This yields the following errors:
Dec 24 14:43:54 mac-mint systemd[1]: Started halinuxcompanion.service - Home Assistant Linux Companion.
Dec 24 14:43:54 mac-mint python[99757]: INFO:halinuxcompanion:Reading configuration file config.json
Dec 24 14:43:54 mac-mint python[99757]: Traceback (most recent call last):
Dec 24 14:43:54 mac-mint python[99757]: File "<frozen runpy>", line 198, in _run_module_as_main
Dec 24 14:43:54 mac-mint python[99757]: File "<frozen runpy>", line 88, in _run_code
Dec 24 14:43:54 mac-mint python[99757]: File "/opt/halinuxcompanion/halinuxcompanion/__main__.py", line 104, in <module>
Dec 24 14:43:54 mac-mint python[99757]: loop.run_until_complete(main())
Dec 24 14:43:54 mac-mint python[99757]: File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
Dec 24 14:43:54 mac-mint python[99757]: return future.result()
Dec 24 14:43:54 mac-mint python[99757]: ^^^^^^^^^^^^^^^
Dec 24 14:43:54 mac-mint python[99757]: File "/opt/halinuxcompanion/halinuxcompanion/__main__.py", line 69, in main
Dec 24 14:43:54 mac-mint python[99757]: await bus.init()
Dec 24 14:43:54 mac-mint python[99757]: File "/opt/halinuxcompanion/halinuxcompanion/dbus.py", line 86, in init
Dec 24 14:43:54 mac-mint python[99757]: self.session = await MessageBus(bus_type=BusType.SESSION).connect()
Dec 24 14:43:54 mac-mint python[99757]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 24 14:43:54 mac-mint python[99757]: File "/opt/halinuxcompanion/.venv/lib/python3.12/site-packages/dbus_next/aio/message_bus.py", line 122, in __init__
Dec 24 14:43:54 mac-mint python[99757]: super().__init__(bus_address, bus_type, ProxyObject)
Dec 24 14:43:54 mac-mint python[99757]: File "/opt/halinuxcompanion/.venv/lib/python3.12/site-packages/dbus_next/message_bus.py", line 72, in __init__
Dec 24 14:43:54 mac-mint python[99757]: get_bus_address(bus_type))
Dec 24 14:43:54 mac-mint python[99757]: ^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 24 14:43:54 mac-mint python[99757]: File "/opt/halinuxcompanion/.venv/lib/python3.12/site-packages/dbus_next/_private/address.py", line 98, in get_bus_address
Trying with the same file but from userland, according to the suggestion at #15, yields this:
Dec 24 15:06:49 mac-mint systemd[1263]: Started halinuxcompanion.service - Home Assistant Linux Companion.
Dec 24 15:06:49 mac-mint (python)[126176]: halinuxcompanion.service: Failed to determine supplementary groups: Operation not permitted
Dec 24 15:06:49 mac-mint systemd[1263]: halinuxcompanion.service: Main process exited, code=exited, status=216/GROUP
Dec 24 15:06:49 mac-mint systemd[1263]: halinuxcompanion.service: Failed with result 'exit-code'.
Dec 24 15:07:19 mac-mint systemd[1263]: halinuxcompanion.service: Scheduled restart job, restart counter is at 4.
Finally, trying to add /opt/halinuxcompanion/.venv/bin/python -m halinuxcompanion -c config.json or python3 -m halinuxcompanion -c config.json to Mint's Startup Applications doesn't yield any error, nor updates HA. I ended up creating a bash script that runs cd /opt/halinuxcompanion/ && .venv/bin/python -m halinuxcompanion -c config.json and added that as a Startup Application, which is quite a workaround, but seems to work for now 👀
Thanks and merry Christmas 🎅
The text was updated successfully, but these errors were encountered:
I don't think it's possible to run halinuxcompanion as a system-wide systemd service (due to the DBUS usage I believe). So in that regard I'm not sure if the instructions added in #33 are accurate 🤔
How did you try to start halinuxcompanion using systemd as your own user? I found https://unix.stackexchange.com/a/479977/73666 that seems to describe a similar problem. Something like systemctl --user start halinuxcompanion.service without any user specified in the unit file should work.
Describe the bug
Possibly related to the complaints at #15. I've submitted #33 with systemd instructions, but turns out my tries cause Python errors I have no clue how to solve.
To Reproduce
If I run the application manually, it works great. However, the following
/etc/systemd/system/halinuxcompanion.service
yields errors:This yields the following errors:
Trying with the same file but from userland, according to the suggestion at #15, yields this:
Finally, trying to add
/opt/halinuxcompanion/.venv/bin/python -m halinuxcompanion -c config.json
orpython3 -m halinuxcompanion -c config.json
to Mint's Startup Applications doesn't yield any error, nor updates HA. I ended up creating a bash script that runscd /opt/halinuxcompanion/ && .venv/bin/python -m halinuxcompanion -c config.json
and added that as a Startup Application, which is quite a workaround, but seems to work for now 👀Thanks and merry Christmas 🎅
The text was updated successfully, but these errors were encountered: