Ubuntu

gdm upstart job checks /proc/cmdline for single user mode, won't start on post-boot runlevel change

Reported by Steve Langasek on 2009-09-25
106
This bug affects 17 people
Affects Status Importance Assigned to Milestone
gdm (Ubuntu)
Medium
James Hunt
Karmic
Medium
Unassigned
Lucid
Medium
Unassigned
Maverick
Medium
Unassigned
Natty
Medium
Unassigned
kdebase-workspace (Ubuntu)
Medium
Unassigned
Karmic
Medium
Unassigned
Lucid
Medium
Unassigned
Maverick
Medium
Unassigned
Natty
Medium
Unassigned

Bug Description

Binary package hint: gdm

gdm upstart job uses the following to prevent starting when in single user mode:

    # Check kernel command-line for inhibitors
    for ARG in $(cat /proc/cmdline)
    do
        case "${ARG}" in
            text|-s|s|S|single)
                exit 0
                ;;
        esac
    done

Unfortunately, this also means gdm won't start when the user boots into single user mode and subsequently switches runlevels, which is what we want to happen.

ProblemType: Bug
Architecture: amd64
Date: Fri Sep 25 15:48:30 2009
DistroRelease: Ubuntu 9.10
Package: gdm 2.28.0-0ubuntu4
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-10.35-generic
SourcePackage: gdm
Uname: Linux 2.6.31-10-generic x86_64

Steve Langasek (vorlon) wrote :
Changed in gdm (Ubuntu):
importance: Undecided → Medium
Changed in kdebase-workspace (Ubuntu):
status: New → Triaged
Changed in gdm (Ubuntu):
status: New → Triaged
Changed in kdebase-workspace (Ubuntu):
importance: Undecided → Medium
Steve Langasek (vorlon) wrote :

kdebase-workspace has copied the same logic into its upstart job, so suffers from the same bug.

Matt Zimmerman (mdz) wrote :

Note that this affects the "resume normal boot" menu item in friendly-recovery, as reported in bug 444347

tags: added: regression-potential ubuntu-boot
Gary Bilkus (ubuntu-gary) wrote :

Even in the case where you don't want gdm to run ( e.g. passing "text" in the kernel parameters ) the current logic is still inelegant as the respawn means that the 'exit 0' statement causes the script to run multiple times before being stopped as spawning too fast.
The end behaviour may be as intended, but.....

Gary Bilkus <email address hidden> writes:

> Even in the case where you don't want gdm to run ( e.g. passing "text"
> in the kernel parameters ) the current logic is still inelegant as the
> respawn means that the 'exit 0' statement causes the script to run
> multiple times before being stopped as spawning too fast. The end
> behaviour may be as intended, but.....

The kernel command line should only affect the behaviour on initial
startup. It should always be possible to manually start gdm later.

--
ilmari
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen

Timo Aaltonen (tjaalton) on 2009-10-27
Changed in gdm (Ubuntu Karmic):
milestone: none → karmic-updates
Changed in kdebase-workspace (Ubuntu Karmic):
milestone: none → karmic-updates
Steve Beattie (sbeattie) on 2009-11-30
tags: added: karmic regression-release
removed: regression-potential
summary: - gdm upstart job checks /proc/cmdline for single user mode, won't dtrt on
- post-boot runlevel change
+ gdm upstart job checks /proc/cmdline for single user mode, won't start
+ on post-boot runlevel change
Jonathan Reed (jdreed) wrote :

This bug is still present in Lucid.

It is exacerbated by the fact that recovery mode offers a "resume" option which is supposed to return the machine to its normal state. However, since recovery mode is single user mode, gdm never starts.

It would be great if this was finally fixed in Natty, especially since it's a one line fix.

Evan Broder (broder) wrote :

So based on some digging, I don't think the issue here is actually the one described, at least not immediately.

Booting with "single" in /proc/cmdline causes the system to emit the runlevel S event (read "switch to runlevel S" if you don't feel like thinking Upstart-y). When the user exits out of the recovery menu (i.e. chooses to "resume"), the rcS job (/etc/init/rcS.conf) emits a rc-sysinit FROM_SINGLE_USER_MODE=y event, which in turn triggers a runlevel 2 event (read "switch to runlevel 2").

That in turn will run all of the sysvinit-style init scripts in /etc/rc2.d, but the conditions that caused the gdm job to run (i.e. filesystem and started dbus and (drm-device-added ... or stopped udevtrigger)) have already passed, and those conditions aren't going to happen again.

It seems like handling the recovery mode purely in terms of runlevels is a bad idea, since runlevels are mostly an obsolete idiom in the Upstart world, but I'm not sure what a better idiom would be.

Evan Broder (broder) wrote :

Of course, once something does actually trigger the gdm job to run (with the exception of doing "start gdm" directly), that will still trigger command-line inhibition code originally described in this bug, so we would still need to do something about that.

Changed in gdm (Ubuntu Maverick):
status: New → Triaged
Changed in gdm (Ubuntu Lucid):
importance: Undecided → Medium
status: New → Triaged
Changed in kdebase-workspace (Ubuntu Lucid):
importance: Undecided → Medium
Changed in kdebase-workspace (Ubuntu Maverick):
importance: Undecided → Medium
Changed in kdebase-workspace (Ubuntu Lucid):
status: New → Triaged
Changed in gdm (Ubuntu Maverick):
importance: Undecided → Medium
Changed in kdebase-workspace (Ubuntu Maverick):
status: New → Triaged
Changed in gdm (Ubuntu Maverick):
assignee: nobody → James Page (james-page)
assignee: James Page (james-page) → nobody
Changed in gdm (Ubuntu Natty):
assignee: nobody → James Hunt (jamesodhunt)
milestone: karmic-updates → ubuntu-11.04-beta-1
James Hunt (jamesodhunt) wrote :

Fix tested on natty only at this stage.

Felix Geyer (debfx) on 2011-03-08
Changed in kdebase-workspace (Ubuntu Natty):
milestone: karmic-updates → ubuntu-11.04-beta-1
tags: added: kubuntu
Changed in gdm (Ubuntu Natty):
status: Triaged → In Progress
Changed in gdm (Ubuntu Maverick):
status: Triaged → Won't Fix
Changed in gdm (Ubuntu Karmic):
status: Triaged → Won't Fix
Robbie Williamson (robbiew) wrote :

We should also backport this fix to Lucid, if at all possible. Not worth the effort on Maverick and Karmic.

Sebastien Bacher (seb128) wrote :

thanks James, the patch is in trunk now

Changed in gdm (Ubuntu Natty):
status: In Progress → Fix Committed
James Hunt (jamesodhunt) wrote :

Fix now also tested on lucid.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm - 2.32.0-0ubuntu10

---------------
gdm (2.32.0-0ubuntu10) natty; urgency=low

  * debian/patches/01git_xdmcp_ipv6.patch:
    - git commit to fix xdmcp issue when ipv6 is used

  [ Martin Pitt ]
  * Add 00git_passwordless_login_crash.patch: Disable the login button in
    MODE_AUTHENTICATION if no query is pending. This avoids a crash when
    having passwordless logins. Original patch from Michael Braun, slightly
    changed for upstream git head, backported to 2.32. (LP: #724205)

  [ James Hunt ]
  * debian/gdm.upstart: gdm will now restart as expected if a user
    runs "telinit 2" from single-user mode (LP: #436936).
 -- Sebastien Bacher <email address hidden> Tue, 15 Mar 2011 18:45:45 +0100

Changed in gdm (Ubuntu Natty):
status: Fix Committed → Fix Released
Sebastien Bacher (seb128) wrote :

ok, that breaked system and needs to be debugged so the fix has been reverted for now, see bug #735805 for details

Changed in gdm (Ubuntu Natty):
status: Fix Released → Triaged
James Hunt (jamesodhunt) wrote :

Please could those who experienced the problems on bug 735805 provide feedback on using the attached gdm.conf. If possible, could you confirm that:

1) When you boot normally, gdm starts as expected.
2) When you boot to a recovery console that gdm does *NOT* start.
    (hold down SHIFT and select the "recovery" option in the grub menu).
3) That from a recovery shell if you subsequently run "telinit 2" that gdm starts.

Erick Brunzell (lbsolost) wrote :

OK I replaced /etc/init/gdm.conf and normal boot worked fine but booting in recovery mode stalled with the following lines at the bottom:

Begin: Running /scripts/local-bottom ... done.
[ 9.718090] fb: conflicting fb hw usage inteldrmfb vs VESA VGA - removing gen

I was not able to start a tty trying Ctrl>Alt>F3 so I rebooted and this time I replaced the boot parameter "single" with "text" thinking it may provide additional info but then it just booted to the desktop.

I imagine that's saying something about "framebuffer" and I do have Intel 82945G/GZ Integrated Graphics.

Erick Brunzell (lbsolost) wrote :

Just comparing diff and noticed this:

+start on ((filesystem
+ and (runlevel [!06]
+ and (started dbus
+ and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
+ or stopped udevtrigger)))) or runlevel PREVLEVEL=S)

-start on (filesystem
- and started dbus
- and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
- or stopped udevtrigger))
 stop on runlevel [016]

Since the error mentioned drm I wondered?

Jonathan Reed (jdreed) wrote :

I tested the new gdm.conf, and confirm that
a) GDM doesn't start in recovery mode
b) GDM does start if I "telinit 2" from a recovery mode shell

However, (b) is not particularly helpful, because it still doesn't work if I choose the "Resume" option from the Recovery Menu.

All the "Resume" option does is exit. From /usr/share/recovery-mode/recovery-menu:
  if [ "$choice" = "resume" ]; then
    exit
  fi

So it's possible that once this is fixed, a bug should be opened against "friendly-recovery" to have it run telinit 2 instead of just "exit"

Martin Pitt (pitti) wrote :

On my system gdm failed to start with version 2.32.0-0ubuntu10.

With the gdm.conf from comment 15 I confirm that 1), 2) and 3) work fine now. I rebooted four times, with gdm properly starting every time. Thanks James!

James Hunt (jamesodhunt) wrote :

@Jonathan - thanks for testing! Good news. Yes, I think you are right re friendly-recovery.

@Erick and others - I attach an updated gdm.conf which might help. Looking at the old gdm.conf, I think it was missing a condition which this new gdm.conf adds. Please let me know your findings. Thanks for your patience!

Erick Brunzell (lbsolost) wrote :

Works perfectly for me :^)

I repeated both normal boots and recovery boots twice. All three tests work as expected.

I do agree that "friendly-recovery" would be better but that's a different issue.

Benjamin Drung (bdrung) wrote :

That gdm.conf works like the current config file. Normal and recovery boot do what they should.

I found one bug: Do a recovery boot and select resume. tty1 will come up, but not GDM.

Erick Brunzell (lbsolost) wrote :

"Do a recovery boot and select resume. tty1 will come up, but not GDM."

Should one of us start a new bug report regarding "friendly-recovery"?

I think it's been that way for quite a while.

Erick Brunzell (lbsolost) wrote :

Regarding the friendly recovery I checked to be sure and that problem existed even in Maverick. I tried booting my stable Maverick recovery mode using both a Natty grub and it's own grub and got the tty rather than GDM.

Give me 24 to 48 hours so I can test Lucid with and w/o proposed updates, and likewise with Maverick. It's not hard for me because I have them all installed, I just have some unrelated issues that must be taken care of.

Erick Brunzell (lbsolost) wrote :

Ah, disregard that last comment. I ended up here due to James Hunt's request for testing at bug 735805 and I'd not taken time to read the history of this bug.

Regarding Natty only, using the 'gdm.conf' provided by James Hunt in post #20 "telinit 2" from a recovery shell does start gdm. Using the officially packaged gdm.conf (currently gdm (2.32.0-0ubuntu12) natty) "telinit 2" from a recovery shell does NOT start gdm.

Indeed selecting the Resume button does not work with either.

Sorry for my confusion.

Jonathan Riddell (jr) on 2011-03-31
Changed in kdebase-workspace (Ubuntu Natty):
milestone: ubuntu-11.04-beta-1 → ubuntu-11.04-beta-2
Changed in gdm (Ubuntu Natty):
milestone: ubuntu-11.04-beta-1 → ubuntu-11.04-beta-2
Jonathan Riddell (jr) on 2011-04-15
Changed in kdebase-workspace (Ubuntu Natty):
milestone: ubuntu-11.04-beta-2 → ubuntu-11.04
Changed in gdm (Ubuntu Natty):
milestone: ubuntu-11.04-beta-2 → ubuntu-11.04
James Hunt (jamesodhunt) wrote :

Fix has now had to change due to an update to gdm.conf for udev-fallback-graphics.

An updated gdm.conf is attached.

Stéphane Graber (stgraber) wrote :

Above fix would have to be tested on various hardware, including intel, nvidia and ati graphic cards to make sure we don't get any regular boot regression.

I'll do a quick test later today and prepare a similar .conf for kdebase-workspace.
Then the two can go to -proposed for more testing before being pushed to -updates, hopefully soon after Natty's release.

Changed in gdm (Ubuntu Natty):
milestone: ubuntu-11.04 → natty-updates
Changed in kdebase-workspace (Ubuntu Natty):
milestone: ubuntu-11.04 → natty-updates
Stéphane Graber (stgraber) wrote :

SRU testing should make sure that both of these start gdm as usual:
- Regular boot to gdm
- Boot in single user mode, then resuming boot

This should ideally be tested with most existing drivers, especially:
 - Intel (seems to be fine)
 - Nvidia (both with nouveau and with proprietary)
 - ATI (both with radeon and with fglrx)
 - Anything else we might have available for testing

Changed in kdebase-workspace (Ubuntu Karmic):
status: Triaged → Won't Fix
milestone: karmic-updates → none
Stéphane Graber (stgraber) wrote :

Attached is the debdiff for gdm.
I updated James' gdm.conf to keep the tab/spaces as they were in natty to limit the delta.

Stéphane Graber (stgraber) wrote :
Stéphane Graber (stgraber) wrote :

The kdebase-workspace change has been commited to lp:~kubuntu-packagers/kdebase-workspace/ubuntu/ and so will be part of the next Oneiric upload.

I'm currently trying to figure out if we want a gdm upload in Oneiric with just that change or should do the same as with kdebase-workspace.

I'd suggest we wait for both to be commited or uploaded in Oneiric before uploading the SRUs to natty-proposed.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm - 2.32.1-0ubuntu4

---------------
gdm (2.32.1-0ubuntu4) oneiric; urgency=low

  [ Martin Pitt ]
  * Add 44_xsession-errors_symlink.patch: Don't rename .xsession-errors to
    .xsession-errors.old if the file is a symlink. The later code will
    truncate the file to zero anyway, so even in that case the file won't grow
    indefinitely. (LP: #771661)

  [ James Hunt ]
  * Updated gdm.conf to fix gdm in single user mode (LP: #436936)
 -- Stephane Graber <email address hidden> Mon, 02 May 2011 14:41:57 -0400

Changed in gdm (Ubuntu):
status: Triaged → Fix Released
Stéphane Graber (stgraber) wrote :

The version number in the gdm debdiff is wrong, it's going to be ubuntu3.1 instead.

SRU for gdm in natty has been uploaded.
SRU for kdebase-workspace will have to wait until the kdebase-workspace currently in -proposed is moved to -updates.

Changed in kdebase-workspace (Ubuntu):
status: Triaged → Fix Committed

Accepted gdm into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in gdm (Ubuntu Natty):
status: Triaged → Fix Committed
tags: added: verification-needed
Martin Pitt (pitti) wrote :

The kdebase-workspace upload has a c&p problem in the changelog:

+kdebase-workspace (4:4.6.2a-0ubuntu5.2) natty-proposed; urgency=low
+
+ [ James Hunt ]
+ * Updated gdm.conf to fix gdm in single user mode (LP: #436936)
+
+ -- Stéphane Graber <email address hidden> Mon, 02 May 2011 14:00:03 -0400

This should probably say "kdm.upstart" and "kdm"? Do you want to reupload to reduce confusion, or want me to wave this through?

Martin Pitt (pitti) wrote :

Accepted kdebase-workspace into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in kdebase-workspace (Ubuntu Natty):
status: Triaged → Fix Committed
Felix Geyer (debfx) wrote :

kdm doesn't come up when selecting "resume normal boot" in the single user mode.
I've tested it on two machines.

I'll leave the verification-needed tag since I haven't tested gdm.

Launchpad Janitor (janitor) wrote :
Download full text (3.6 KiB)

This bug was fixed in the package kdebase-workspace - 4:4.6.3-1ubuntu1

---------------
kdebase-workspace (4:4.6.3-1ubuntu1) oneiric; urgency=low

  [ Jonathan Thomas ]
  * Merge with Debian Unstable, remaining changes:
    - Add kdebase-workspace-wallpapers.{links, install}
    - Add kdebase-workspace-data.links
    - kdebase-workspace-data.install: don't add wallpapers that are in
      kdebase-workspace-wallpapers.install
    - Add kdm.{links, upstart}
    - kdm.logrotate: rotate 2 -> rotate 7
    - Make kdm work with upstart in kdm.prerm, kdm.postrm, kdm.postinst
    - debian/control:
      - don't build against libggadget-1.0-dev, libggadget-qt-1.0-dev
        (they are in Universe)
      - Build against libbost1.46-dev instead of libboost-dev
      - Add libxml2-dev, libpolkit-qt-1-dev to build-deps
      - Add python-kde4, python-sip, python-qt4 to build-dependencies
      - Keep bumped our replaces/breaks
      - plasma-netbook replaces plasma-widgets-workspace (<= 4:4.5.2-1ubuntu1)
      - kdebase-workspace-bin suggests plasma-scriptengines instead of
        recommend
      - kdebase-workspace-data depends on oxygen-cursor-theme instead of oxygencursors
      - Keep kdebase-workspace-wallpapers
      - plasma-dataengines-workspace replaces plasma-widget-workspace (<= 4:4.5.2-1ubuntu1)
      - plasma-widgets-workspace depends on akonadi-server and kdepim-runtime
      - plasma-scriptengines not depends on plasma-scriptengine-googlegadgets
      - plasma-scriptengine-ruby depends on libkde4-ruby
      - Don't build plasma-scriptengine-googlegadgets
      - freespacenotifier replaces kdebase-workspace-data (<= 4:4.5.2-1ubuntu1)
        and kdebase-workspace-bin (<= 4:4.5.2-1ubuntu1)
      - kinfocenter replaces kdebase-workspace-bin and systemsettings
      - libplasmagenericshell4 replaces plasma-widgets-workspace (<= 4:4.5.2-1ubuntu1)
    - debian/patches:
      - Use 07_kdmrc_defaults_kubuntu.diff instead of 07_kdmrc_defaults.diff
      - Don't add be_better_at_honouring_user_kdm_theming
      - Don't add use_dejavu_as_default_font
      - Don't add fix_target_link_libraries
      - Keep our patches
  * Try a polkit-kde-1 | policykit-gnome-1 or-dependency again to see if policykit-1-gnome
    is a suitable policykit solution a year later.

  [ Tarun Kumar Mall ]
  * New uptream release
  * Bumped kde-sc-dev-latest version to 4.6.3
  * Removed patches kubuntu_120_ksysguard_sensors.diff and
    kubuntu_121_kdm_halt_cmd.diff, applied upstream
  * Refreshed kubuntu_122_akonadi_calendar_dataengine.diff

  [ Philip Muškovac ]
  * drop kubuntu_123_effectframe_glflush.diff, applied upstream
  * Refresh symbol files

  [ Stéphane Graber ]
  * Updated Vcs fields to point to kubuntu-uploaders instead of
    kubuntu-members

  [ James Hunt ]
  * Updated kdm.conf to fix kdm in single user mode (LP: #436936)

kdebase-workspace (4:4.6.3-1) unstable; urgency=low

  * New upstream release:
    - fixes shutdown with default kdm config (Closes: #627917);

  [ José Manuel Santamaría Lema ]
  * Bump kde-sc-dev-latest build dependency to 4:4.6.2.
  * Remove fix_temperature_sensors.diff, applied upstream.
  * Update symbols files.

  [ Modestas Vainius ]
...

Read more...

Changed in kdebase-workspace (Ubuntu):
status: Fix Committed → Fix Released
Jamie Strandboge (jdstrand) wrote :

gdm 2.32.1-0ubuntu3.1 has been superseded by the 2.32.1-0ubuntu3.2 security update in natty.

Steve Langasek (vorlon) wrote :

setting back to 'triaged' for gdm, since the SRU has been superseded as Jamie mentioned. James, can you merge the gdm security fix and prepare another SRU upload?

Changed in gdm (Ubuntu Natty):
status: Fix Committed → Triaged

I permission to fix released

Changed in gdm (Ubuntu Natty):
status: Triaged → Fix Released

I want to permission with natty to Robbie Williamson

Chris Halse Rogers (raof) wrote :

gdm is not fixed in Natty, setting the task back to Triaged.

Changed in gdm (Ubuntu Natty):
status: Fix Released → Triaged

I permission to you in package

Changed in gdm (Ubuntu Natty):
status: Triaged → Fix Released
Bryce Harrington (bryce) wrote :

Heru, don't randomly change states on bugs please.

Changed in gdm (Ubuntu Natty):
status: Fix Released → Triaged

I permission to you to use package in your team

Changed in gdm (Ubuntu Natty):
status: Triaged → Fix Released
Changed in gdm (Ubuntu Natty):
status: Fix Released → Triaged
tags: added: runlevel1
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kdebase-workspace - 4:4.6.5-0ubuntu1

---------------
kdebase-workspace (4:4.6.5-0ubuntu1) natty-proposed; urgency=low

  * Upload to natty-proposed for SRU testing (LP: #859562)
 -- Scott Kitterman <email address hidden> Mon, 26 Sep 2011 07:37:25 -0400

Changed in kdebase-workspace (Ubuntu Natty):
status: Fix Committed → Fix Released
Changed in gdm (Ubuntu Lucid):
status: Triaged → Won't Fix
Changed in gdm (Ubuntu Natty):
assignee: James Hunt (jamesodhunt) → nobody
milestone: natty-updates → none
status: Triaged → Won't Fix
Changed in kdebase-workspace (Ubuntu Lucid):
status: Triaged → Won't Fix
Changed in kdebase-workspace (Ubuntu Maverick):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers