Hi,

we're currently experimenting with Guix System, including guix home. We are 
testing it, managed via the operating-system definition.

As instructed by the manual, I therefore add elogind via `elogind-service-type` 
to our operating system definition. After doing that, `guix deploy` fails with:

    guix deploy: error: failed to deploy host: remote command 
'/run/setuid-programs/sudo -n -- 
/gnu/store/65c3bwbhv8qq747h0bpx8mlmy8rjn660-guile-3.0.9/bin/guile 
--no-auto-compile -L /gnu/store/gai5i4ba2xf084big8h56q6pc0vwx2sj-module-import 
-C /gnu/store/gai5i4ba2xf084big8h56q6pc0vwx2sj-module-import -c (begin 
(use-modules (guix repl)) (send-repl-response (quote (let ((output 
(open-output-string))) (set-port-encoding! output "UTF-8") 
(set-port-conversion-strategy! output (quote substitute)) (let ((result 
(with-error-to-port output (lambda () (with-output-to-port output (lambda () 
(primitive-load 
"/gnu/store/507cjwqmjwq5gvr036a3q5q5hsfscyvj-remote-exp.scm"))))))) (values 
result (get-output-string output))))) (current-output-port)) (force-output))' 
failed with status 1

I cannot find logs of this command (outside of the sudo audit log). The last 
log before that is "Sending 0 store items".

When I try to read the logs after the error via anything that requires `sudo`, 
I get:

    sudo: pam_open_session: Error in service module
    sudo: policy plugin failed session initialization

... so I access the server console, which after trying to log in with `root` 
also briefly reports "Error in service module" before clearing the screen.

A reboot yields me the generation before the deploy - really cool! And there is 
no elogind in `/etc/pam.d`. So I tried again, with a root shell already open, 
and `/var/log/secure` reveals:

    2026-03-31 21:05:02 localhost sudo:       jc : TTY=pts/0 ; PWD=/home/jc ; 
USER=root ; 
COMMAND=/gnu/store/vhkg4avy9zf0kj70dcsmfpymnllkjq1y-bash-5.2.37/bin/bash
    2026-03-31 21:05:02 localhost sudo: pam_elogind(sudo:session): Failed to 
connect to system bus: No such file or directory
    2026-03-31 21:05:02 localhost sudo: pam_unix(sudo:session): session opened 
for user root(uid=0) by jc(uid=1001)
    2026-03-31 21:05:02 localhost sudo:       jc : pam_open_session: Error in 
service module ; TTY=pts/0 ; PWD=/home/jc ; USER=root ; 
COMMAND=/gnu/store/vhkg4avy9zf0kj70dcsmfpymnllkjq1y-bash-5.2.37/bin/bash

... so I add `dbus-system-service-type` first, run deploy. Then re-add elogind, 
redeploy. It passes. sudo works, but su throws me out. And relogin fails.

After a reboot, it all seems to work. And my $XDG_RUNTIME_DIR is there :-)

Now this got me thinking: When I test deploying our system as a container 
without `--network`, I get:

    guix system: error: service 'unattended-upgrade' requires 'networking', 
which is not provided by any service

Should Guix perhaps do something similar for elogind, e.g. depend on a 
hypothetical `dbus-system` which would be provided by 
`dbus-system-service-type`?

FWIW, I've also tried greetd, but that service did not seem to do anything. So 
I also tried `pam-mount`, but that seems unsuccessful, as it does not modify 
the `sshd` config for PAM, and the `sshd` config does not include anything else.


Thank you
Johannes

Reply via email to