After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682467 - With automatic login, logging out logs me in again immediately
With automatic login, logging out logs me in again immediately
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-22 13:24 UTC by Cosimo Cecchi
Modified: 2012-11-06 21:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
video (383.88 KB, video/webm)
2012-08-22 13:25 UTC, Cosimo Cecchi
  Details
syslog with gdm debugging (117.35 KB, application/x-gzip)
2012-09-30 23:21 UTC, darkxst
  Details
slave: only set up autologin conversations (1.76 KB, patch)
2012-10-04 22:21 UTC, Ray Strode [halfline]
committed Details | Review
daemon: user marker file for tracking autologin instead of static variable. (16.85 KB, patch)
2012-10-04 22:21 UTC, Ray Strode [halfline]
committed Details | Review

Description Cosimo Cecchi 2012-08-22 13:24:44 UTC
Reproducible with GDM 3.5.90

- Enable automatic login, and boot your system
- Click Log out from the shell menu

Expected:
- The login screen is displayed

Actual:
- I'm logged in automatically again

See attached video. Note that at this point, if I log out again from the user menu, I hit bug 682465
Comment 1 Cosimo Cecchi 2012-08-22 13:25:14 UTC
Created attachment 222146 [details]
video
Comment 2 darkxst 2012-09-30 23:20:30 UTC
We are having this same issue while trying to get auto-login setup for the Ubuntu GNOME live CD. we want the live CD to auto-login on boot, but users need to be able to logout if they want to try the fallback session.

Mostly clicking 'log out' in the usermenu results in and autologin again, however occasionally it does work and go to the login screen. Even more occasionally it just crashes.
Comment 3 darkxst 2012-09-30 23:21:55 UTC
Created attachment 225449 [details]
syslog with gdm debugging
Comment 4 darkxst 2012-10-03 03:53:46 UTC
Strangely, log out seems to work if I set both the system username and hostname to the same value.
Comment 5 Ray Strode [halfline] 2012-10-03 22:17:47 UTC
hmm

Sep 30 21:49:14 ubuntu gdm[7073]: DEBUG(+): GdmSignalHandler: handling signal 15
Sep 30 21:49:14 ubuntu gdm[7073]: DEBUG(+): GdmSignalHandler: Found 1 callbacks
Sep 30 21:49:14 ubuntu gdm[7073]: DEBUG(+): GdmSignalHandler: running 15 handler: 0x409240
Sep 30 21:49:14 ubuntu gdm[7073]: DEBUG(+): Got callback for signal 15
Sep 30 21:49:14 ubuntu gdm[7073]: DEBUG(+): Caught signal 15, shutting down normally.
Sep 30 21:49:14 ubuntu gdm[7073]: DEBUG(+): GdmSignalHandler: Caught termination signal - calling fatal func
Sep 30 21:49:14 ubuntu gdm[7073]: DEBUG(+): GDM finished, cleaning up...

so the main gdm process is getting killed.  We currently store whether or not it's the first login in the main gdm process.

I guess we need to find out why it's getting killed and fix that, and potentially also record to /var/run/gdm instead of using a static variable.

actually one "quick fix" might be something like

+++ b/data/pam-redhat/gdm-autologin.pam
@@ -1,5 +1,6 @@
  #%PAM-1.0
 auth       required    pam_env.so
+auth       required    pam_tally2.so file=/var/run/gdm/autologin-counter deny=2
 auth       required    pam_permit.so
 auth       include     postlogin
 account    required    pam_nologin.so

but i don't really like that.
Comment 6 Ray Strode [halfline] 2012-10-04 22:21:19 UTC
Created attachment 225852 [details] [review]
slave: only set up autologin conversations

Right now any time any session conversation is started,
we run its setup call if autologin is enabled. We should only do this
for autologin sessions, otherwise, we may repeat work done by
the greeter.
Comment 7 Ray Strode [halfline] 2012-10-04 22:21:23 UTC
Created attachment 225853 [details] [review]
daemon: user marker file for tracking autologin instead of static variable.

We currently decide whether or not to skip autologin by a first_login
state variable in the static display object.

These days we can have multiple static display objects, so storing the
state variable doesn't make much sense.  We could make the variable
static, but instead this commit switches to using a marker file in
/var/run/gdm.
Comment 8 Ray Strode [halfline] 2012-10-04 22:22:12 UTC
Tim do you mind giving these a go?
Comment 9 darkxst 2012-10-04 23:53:45 UTC
ok, I have tested the patches, and can now logout when autologin is enabled.

However X is still respawning on a new display each time (i.e :2, :3 etc.). This only happens with autologin enabled and only for the autologin user.
Comment 10 Matthias Clasen 2012-10-05 09:50:05 UTC
Review of attachment 225853 [details] [review]:

::: configure.ac
@@ +1349,3 @@
+AC_SUBST(GDM_RAN_ONCE_MARKER_FILE)
+AC_DEFINE_UNQUOTED(GDM_RAN_ONCE_MARKER_FILE, "$GDM_RAN_ONCE_MARKER_FILE", [ran once marker file])
+

Is there any reason to make this configurable ?
How does that make the world a better place ?
Comment 11 Ray Strode [halfline] 2012-10-05 13:39:27 UTC
(In reply to comment #10)
> Review of attachment 225853 [details] [review]:
> 
> ::: configure.ac
> @@ +1349,3 @@
> +AC_SUBST(GDM_RAN_ONCE_MARKER_FILE)
> +AC_DEFINE_UNQUOTED(GDM_RAN_ONCE_MARKER_FILE, "$GDM_RAN_ONCE_MARKER_FILE", [ran
> once marker file])
> +
> 
> Is there any reason to make this configurable ?
> How does that make the world a better place ?
No reason, other than there is already a bunch of things that shouldn't be configurable in configure.ac, I wanted to be consistent in my handling of the ways the variable gets defined.

I could do a preliminary patch to drop the other bits and then hard code this one as well.
Comment 12 darkxst 2012-10-14 22:23:07 UTC
Ray are you planning to include these patches in 3.6.1?
Comment 13 Ray Strode [halfline] 2012-10-15 19:04:19 UTC
yea
Comment 14 Ray Strode [halfline] 2012-10-15 19:05:37 UTC
Leaving open for now given comment 9

Attachment 225852 [details] pushed as 47c7302 - slave: only set up autologin conversations
Attachment 225853 [details] pushed as 11d4b97 - daemon: user marker file for tracking autologin instead of static variable.
Comment 15 Ray Strode [halfline] 2012-10-16 00:10:29 UTC
I think comment 9 might be because of bug 686186

Tim do you mind checking? If so I'll close this report out.
Comment 16 darkxst 2012-10-16 01:09:28 UTC
Just tested the patch from bug 686186 and it does not seem to fix the issue from comment 9.
Comment 17 Ray Strode [halfline] 2012-10-16 15:44:33 UTC
bummer
Comment 18 Cosimo Cecchi 2012-11-02 21:09:15 UTC
I still seem to reproduce this bug with GDM 3.6.1, bumping version.
Comment 19 Ray Strode [halfline] 2012-11-06 21:07:32 UTC
oh we fixed this with commit 11d4b97bfda92a254d2ef55b4795456367a3cfbb