5

I'm trying to setup a service account using systemd units to manage the actual service + supporting code. However, it looks like the systemd user daemon isn't working properly.

$ systemctl --user
Failed to get D-Bus connection: Permission denied

EDIT: I've made some progress by ensuring I have an interactive shell (using su - instead of su to switch to the service account). This has helped, but it looks like my D-Bus woes aren't over:

$ systemctl --user
Failed to get D-Bus connection: No such file or directory

I'm trying to suss out what I need to do to make sure this user does have dbus access. Adding them to the dbus group has had little benefit.

$ groups
printing lp rpc dbus users chrony ipausers

I'm running Fedora Core 23

  • Is pam_systemd PAM module called when you are login as your service user? What is the UID of that service user? – Bigon Dec 21 '16 at 22:35
  • It is, although a little research has determined that it behaves differently depending on how I login (su vs su - or direct ssh). Still doesn't work but I get a different error. – Adam Luchjenbroers Mar 19 '17 at 1:17
  • su is not a login mechanism. unix.stackexchange.com/a/423648/5132 – JdeBP Mar 18 '18 at 11:26
0

If I understand correctly, you are mixing up two different concepts:

  • The main systemd system instance is used to start system services under any system user;
  • The user specific systemd instances are there for interactive user that wish to run session services.

System services do not get a user instance as they are managed by the system instance. In your case, I think you should write your unit as system units and have them managed directly by systemd PID 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.