Bug 882037

Summary: race between adding liveuser and gdm autologin
Product: [Fedora] Fedora Reporter: Mads Kiilerich <mads>
Component: spin-kickstartsAssignee: Jeroen van Meeuwen <vanmeeuwen+fedora>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: admiller, awilliam, bruno, johannbg, kevin, kparal, mads, rdieter, rhughes, rstrode, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-14 15:53:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 752665    
Attachments:
Description Flags
patch to fix things none

Description Mads Kiilerich 2012-11-30 00:43:31 UTC
liveuser is added by the SysV init script /etc/init.d/livesys . But at the same time gdm starts and try to login as liveuser. There is apparently no ordering, and sometimes (some hardware and some spins/remixes) gdm will try to login and fail before the user is added.

systemd should be told to ensure that livesys has to complete before starting gdm.

The best solution would be to convert livesys to a systemd service and use a Before. That is probably not feasible now.

According to systemd.special(7):
       display-manager.service
           The display manager service. Usually this should be aliased
           (symlinked) to gdm.service or a similar display manager service.

           systemd automatically adds dependencies of type After for this
           target unit to all SysV init script service units with a LSB header
           referring to the $x-display-manager facility, for compatibility
           with Debian.

something like this should work:

### BEGIN INIT INFO
# Provides: $x-display-manager
### END INIT INFO

- but it didn't work for me ...

fedora-kickstarts-0.18.2-1.fc18.noarch
gdm-3.6.2-1.fc18.x86_64 / gdm-3.6.2-1.fc18.usefamilywild.i686

Comment 1 Jóhann B. Guðmundsson 2012-11-30 11:38:39 UTC
seems like gdm.service ( and probably other dm service too ) are missing After=livesys.service or livesys or the livesys lsb header is missing X-Start-Before: gdm or gdm.service

Comment 2 Jóhann B. Guðmundsson 2012-11-30 11:45:42 UTC
This is the after order in F17 and probably should be the same in each *dm.service

After=livesys-late.service rc-local.service systemd-user-sessions.service

Comment 3 Mads Kiilerich 2012-11-30 12:39:51 UTC
Doing

 # chkconfig: 345 00 99
 # description: Init script for live image.
 
+### BEGIN INIT INFO
+#  X-Start-Before: gdm.service
+### END INIT INFO
+
 . /etc/init.d/functions
 
 if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then

and 

+sed -i 's,^After=,After=livesys.service livesys-late.service rc-local.service systemd-user-sessions.service ,g' /lib/systemd/system/gdm.service

worked for me.

A change like that should be nth for f18, but it should probably be figured out exactly what is needed.

A full conversion to systemd service would probably be too late for f18.

Comment 4 Ray Strode [halfline] 2012-11-30 16:44:52 UTC
probably better to use display-manager.service instead of gdm.service (which is an alias for gdm.service when appropriate and an alias for other display managers when appropriate)

Comment 5 Ray Strode [halfline] 2012-11-30 18:10:27 UTC
is the sed required?  The X-Start-Before should be enough right?

Comment 6 Ray Strode [halfline] 2013-02-13 16:41:11 UTC
*** Bug 854722 has been marked as a duplicate of this bug. ***

Comment 7 Ray Strode [halfline] 2013-02-13 17:02:00 UTC
Richard did some testing and discovered the sed isn't required, but the the .service suffix on the X-Start-Before line is wrong.

Comment 8 Richard Hughes 2013-02-13 17:38:24 UTC
Created attachment 696962 [details]
patch to fix things

This is what I pushed.

Comment 9 Adam Williamson 2013-03-18 22:29:34 UTC
confirmed fixed in f19, fwiw.