GNU bug report logs - #27580
Elogin doesn't start properly

Previous Next

Package: guix;

Reported by: William <w <at> vieta.uk>

Date: Wed, 5 Jul 2017 00:23:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27580 in the body.
You can then email your comments to 27580 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#27580; Package guix. (Wed, 05 Jul 2017 00:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to William <w <at> vieta.uk>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 05 Jul 2017 00:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: William <w <at> vieta.uk>
To: bug-guix <at> gnu.org
Subject: Elogin doesn't start properly
Date: Wed, 5 Jul 2017 00:39:05 +0100
On my GuixSD VM (Guix release 0.13) elogind doesn't start at startup,
despite (elogind-service) being used in config.scm. I am not using
Xorg or a desktop manager like Slim.

Elogind only starts when loginctl is executed as loginctl activates
elogind via DBus, meaning that it doesn't record any logins before
loginctl is run. I don't believe that this is intended; my Arch Linux
install doesn't miss any logins.

My config.scm:

--8<---------------cut here---------------start------------->8---
(services (cons* ;; Networking
                   (service wpa-supplicant-service-type)
                   (service connman-service-type (connman-configuration))
                   (service tlp-service-type)
                   (service thermald-service-type)
                   (udisks-service)
                   (polkit-service)
                   (elogind-service)
                   (dbus-service)

                   %base-services))
--8<---------------cut here---------------end--------------->8---

Output (just started up vm):


--8<---------------cut here---------------start------------->8---
gollum login: cavej
Password:
This is the GNU operating system, welcome!

gollum% loginctl
dbus[392]: [system] activating service name='org.freedesktop.login1'
(using servicehelper)
[/gnu/store/ninbsrgj12ik3zjwk0vbcbmhwfkfhj7h-logind.conf:5] Unknown
lvalue 'InhibitDelayMaxSecs' in section 'Login'
[/gnu/store/ninbsrgj12ik3zjwk0vbcbmhwfkfhj7h-logind.conf:15] Unknown
lvalue 'HolfoffTimeoutSecs' in section 'Login'
[/gnu/store/ninbsrgj12ik3zjwk0vbcbmhwfkfhj7h-logind.conf:17] Unknown
lvalue 'IdleActionSeconds' in section 'Login'
[/gnu/store/ninbsrgj12ik3zjwk0vbcbmhwfkfhj7h-logind.conf:19] Unknown
lvalue 'RemoveIpc' in section 'Login'
dbus[392]: [system] Successfully activated service 'org.freedesktop.login1'
New seat seat0.
Watching system buttons on /dev/input/event0 (Power Button)
   SESSION      UID USER            SEAT

0 sessions listed.
gollum% exit
Respawning term-tty1
Service term-tty1 has been restarted.


This is the GNU system. Welcome.
gollum login: cavej
Password:
New session c1 of user cavej.
This is the GNU operating system, welcome!

gollum% loginctl
   SESSION       UID  USER                    SEAT
         c1    30011  cavej                   seat0

1 sessions listed.
--8<---------------cut here---------------end--------------->8---




Information forwarded to bug-guix <at> gnu.org:
bug#27580; Package guix. (Mon, 10 Jul 2017 22:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 27580 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: William <w <at> vieta.uk>
Cc: 27580 <at> debbugs.gnu.org
Subject: Re: bug#27580: Elogin doesn't start properly
Date: Tue, 11 Jul 2017 00:21:37 +0200
Hello,

William <w <at> vieta.uk> skribis:

> Elogind only starts when loginctl is executed as loginctl activates
> elogind via DBus, meaning that it doesn't record any logins before
> loginctl is run. I don't believe that this is intended; my Arch Linux
> install doesn't miss any logins.

I thought pam_elogind would trigger bus-activation but it does not,
because of this:

        /* Make this a NOP on non-logind systems */
        if (!logind_running())
                return PAM_SUCCESS;

where:

  static inline bool logind_running(void) {
          return access("/run/systemd/seats/", F_OK) >= 0;
  }

When the system is started, /run/systemd is empty, so pam_elogind
directly returns success.

I’m looking for a way to work around this; to be continued…

Ludo’.

PS: The problem does not happen with X and SLiM because they somehow
    activate elogind before one has logged in.




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Tue, 11 Jul 2017 09:14:02 GMT) Full text and rfc822 format available.

Notification sent to William <w <at> vieta.uk>:
bug acknowledged by developer. (Tue, 11 Jul 2017 09:14:02 GMT) Full text and rfc822 format available.

Message #13 received at 27580-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: William <w <at> vieta.uk>
Cc: 27580-done <at> debbugs.gnu.org
Subject: Re: bug#27580: Elogin doesn't start properly
Date: Tue, 11 Jul 2017 11:13:07 +0200
[Message part 1 (text/plain, inline)]
Hi,

(Please keep 27580-done <at> debbugs.gnu.org Cc’d.)

William <w <at> vieta.uk> skribis:

> Shouldn't our shepherd service simply execute elogind-program-wrapper?
> This may also be right because elogind handles things like the laptop
> lid being closed, which should be handled even if no one has logged in
> yet.

Good point, we should probably just start it from the Shepherd.  Done:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=94a881178af9a9a918ce6de55641daa245c92e73

Let me know if there are still problems.

For the record, I tested with this config:

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl
index f7b8823d4..293182e53 100644
--- a/gnu/system/examples/bare-bones.tmpl
+++ b/gnu/system/examples/bare-bones.tmpl
@@ -2,7 +2,7 @@
 ;; for a "bare bones" setup, with no X11 display server.
 
 (use-modules (gnu))
-(use-service-modules networking ssh)
+(use-service-modules networking ssh desktop dbus)
 (use-package-modules admin)
 
 (operating-system
@@ -38,12 +38,12 @@
                %base-user-accounts))
 
   ;; Globally-installed packages.
-  (packages (cons tcpdump %base-packages))
 
   ;; Add services to the baseline: a DHCP client and
   ;; an SSH server.
   (services (cons* (dhcp-client-service)
-                   (service openssh-service-type
-                            (openssh-configuration
-                              (port-number 2222)))
+                   (elogind-service)
+                   (service polkit-service-type)
+                   (dbus-service)
+
                    %base-services)))
[Message part 3 (text/plain, inline)]
Thank you!

Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#27580; Package guix. (Tue, 11 Jul 2017 11:46:01 GMT) Full text and rfc822 format available.

Message #16 received at 27580 <at> debbugs.gnu.org (full text, mbox):

From: William <w <at> vieta.uk>
To: 27580 <at> debbugs.gnu.org
Subject: Fwd: bug#27580: Elogin doesn't start properly
Date: Tue, 11 Jul 2017 08:33:36 +0100
Thanks for looking at this Ludo.

In systemd the systemd-logind.service looks a little like this:
    [Service]
    ExecStart=/usr/lib/systemd/systemd-logind
    BusName=org.freedesktop.login1

It looks as though it simply executes the systemd-logind program.

Shouldn't our shepherd service simply execute elogind-program-wrapper?
This may also be right because elogind handles things like the laptop
lid being closed, which should be handled even if no one has logged in
yet.

Will

On 10 July 2017 at 23:21, Ludovic Courtès <ludo <at> gnu.org> wrote:
> Hello,
>
> William <w <at> vieta.uk> skribis:
>
>> Elogind only starts when loginctl is executed as loginctl activates
>> elogind via DBus, meaning that it doesn't record any logins before
>> loginctl is run. I don't believe that this is intended; my Arch Linux
>> install doesn't miss any logins.
>
> I thought pam_elogind would trigger bus-activation but it does not,
> because of this:
>
>         /* Make this a NOP on non-logind systems */
>         if (!logind_running())
>                 return PAM_SUCCESS;
>
> where:
>
>   static inline bool logind_running(void) {
>           return access("/run/systemd/seats/", F_OK) >= 0;
>   }
>
> When the system is started, /run/systemd is empty, so pam_elogind
> directly returns success.
>
> I’m looking for a way to work around this; to be continued…
>
> Ludo’.
>
> PS: The problem does not happen with X and SLiM because they somehow
>     activate elogind before one has logged in.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Aug 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.