Comment 106 for bug 1951491

Revision history for this message
Gerrit Venema (gmoniker) wrote (last edit ):

Encountered this problem while attempting to run a confined snap from a cronjob.

All that is wrong actually is that the systemd user session has not been properly setup.

I had to install dbus-user-session and then make sure the /run/user/../bus was initialized by for example runuser -u user /bin/true.
And make sure that it remains by loginctl enable-linger user

Cron by itself won't load pam_systemd in the session because it uses common-session-noninteractive in pam which doesn't load pam_systemd.