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 integration: Support system-wide units in addition to user unit #61

Closed
nathanielcwm opened this issue Dec 16, 2019 · 4 comments
Closed
Assignees

Comments

@nathanielcwm
Copy link

I enable syncthing using systemd like so: syncthing@nathanielcwm
However when I list that as the unit is syncthing@nathanielcwm it doesn't seem to work.

I believe it could be because it seems to be hardcoded to check for user units.

@Martchus
Copy link
Owner

It is not "hardcoded" to check for user units. The problem is that it only speaks to systemd using the session-wide D-Bus service (and not the system-wide D-Bus service). Via this service only user units are controlled.

I could add a checkbox to make it use the system-wide D-Bus service. However, I'm not sure whether starting and stopping would be possible. Likely this is not permitted by default - but if the status is sufficient for you or you somehow have the permission that could make sense.

@Martchus Martchus changed the title Unable to detect systemd unit. systemd integration: Support system-wide units in addition to user unit Dec 16, 2019
@nathanielcwm
Copy link
Author

sorry for being misinformed. i don't mind at all if it can't be started or stopped i'm mostly just interested in the status.

@Martchus
Copy link
Owner

I'll assign myself when I start to work on this. I actually have a setup like this as well and therefore the same use case. I've just haven't had the time time to implement it yet. If you want to try implementing it yourself let me know (shouldn't be difficult to implement).

@Martchus Martchus self-assigned this Dec 17, 2019
Martchus added a commit that referenced this issue Dec 17, 2019
* Lazy initialize systemd interface and don't initialize it
  at all if the unit name is empty
* Allow to supervise/control system-wide units in addition to
  user units (see #61)
* Avoid redundant code
@Martchus
Copy link
Owner

I implemented the feature. Even starting and stopping works if systemd can ask for authorization:

Screenshot_20191218_002559

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

No branches or pull requests

2 participants