Skip to content

Conversation

@jfhbrook
Copy link
Owner

@jfhbrook jfhbrook commented Feb 6, 2025

The systemd service is currently broken. This branch fixes the systemd unit, and makes progress towards full functionality.

The good news is that the service starts:

Feb 06 10:48:17 stardeck systemd[1]: Started plusdeck.service - Plus Deck 2C PC Cassette Deck...
░░ Subject: A start job for unit plusdeck.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit plusdeck.service has finished successfully.
░░ 
░░ The job identifier is 199774.
Feb 06 10:48:17 stardeck plusdeckd[1238864]: INFO:plusdeck.dbus.service:Listening on org.jfhbrook.plusdeck /

I can also manage the plusdeck with plusdeckctl using sudo.

However, unprivileged access is eluding me. The intent is that unprivileged users in the plusdeck group may have full access to the service. Currently what works is listening to signals (plusdeckctl subscribe), as well as property access (plusdeckctl config show). Unfortunately, method calling (plusdeckctl eject) is not working.

I believe the issue lies with systemd, either with some capacities I have to manually set, or with some settings I need in polkit. For more information, see these discussion threads:

My intent is to merge and release this as-is, and delegate fixing unprivileged access to a secondary ticket and PR.

async def load() -> None:
client = DbusClient()
ctx.obj = Obj(client=client, log_level=log_level, output=output)
bus: SdBus = sd_bus_open_user() if user else sd_bus_open_system()
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured out that the default bus is the system bus when started with a non-user systemd unit: https://www.freedesktop.org/software/systemd/man/latest/sd_bus_default.html based on me being able to get past a "where is the bus tho" error, I seem to understand this correctly.

@jfhbrook jfhbrook merged commit 92a6bb8 into main Feb 8, 2025
3 checks passed
@jfhbrook jfhbrook deleted the fix-systemd-service branch February 8, 2025 21:48
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

Successfully merging this pull request may close these issues.

2 participants