Bug 381227

Summary: gdm user not created, even though gdm is installed
Product: [openSUSE] openSUSE 11.0 Reporter: Marcus Meissner <meissner>
Component: GNOMEAssignee: Lukas Ocilka <locilka>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Blocker    
Priority: P5 - None CC: captain.magnus, casualprogrammer, coolo, dsk, forgotten_nqeDWc8OMK, jmatejek, lslezak, maxmars, mmarek
Version: Beta 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: YaST logs
Several /etc/passwd from different phases of installation

Description Marcus Meissner 2008-04-18 09:30:20 UTC
installing GNOME results in a messagebox "gdm user not created".

but gdm is installed, and its postinstall has gdm user creation.


I suspect coolos new image magic.
Comment 1 Marcus Meissner 2008-04-18 09:33:20 UTC
reinstalling gdm makes ti work again
Comment 2 Stephan Kulow 2008-04-18 10:08:24 UTC
I just checked: gnome-i386.tar.lzma has this in etc/passwd:

root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/bash
daemon:x:2:2:Daemon:/sbin:/bin/bash
lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
mail:x:8:12:Mailer daemon:/var/spool/clientmqueue:/bin/false
news:x:9:13:News system:/etc/news:/bin/bash
uucp:x:10:14:Unix-to-Unix CoPy system:/etc/uucp:/bin/bash
games:x:12:100:Games account:/var/games:/bin/bash
man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash
wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
ftp:x:40:49:FTP account:/srv/ftp:/bin/bash
nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash
ntp:x:74:101:NTP daemon:/var/lib/ntp:/bin/false
messagebus:x:100:102:User for D-Bus:/var/run/dbus:/bin/false
festival:x:101:103:Festival daemon:/usr/share/festival/:/bin/false
uuidd:x:102:104:User for uuidd:/var/run/uuidd:/bin/false
postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false
avahi:x:103:105:User for Avahi:/var/run/avahi-daemon:/bin/false
polkituser:x:104:106:PolicyKit:/var/run/PolicyKit:/bin/false
haldaemon:x:105:107:User for haldaemon:/var/run/hal:/bin/false
pulse:x:106:108:PulseAudio daemon:/var/lib/pulseaudio:/sbin/nologin
beagleindex:x:107:111:User for Beagle indexing:/var/cache/beagle:/bin/bash
gdm:x:108:112:Gnome Display Manager daemon:/var/lib/gdm:/bin/false
sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false
suse-ncc:x:109:113:Novell Customer Center User:/var/lib/YaST2/suse-ncc-fakehome:/bin/bash


I think yast is doing something wrong in deploying.
Comment 3 Lukas Ocilka 2008-04-18 10:58:54 UTC
I'll check it ... but ...
Comment 4 Lukas Ocilka 2008-04-18 11:47:46 UTC
Created attachment 208938 [details]
YaST logs
Comment 5 Lukas Ocilka 2008-04-18 11:48:22 UTC
Created attachment 208940 [details]
Several /etc/passwd from different phases of installation
Comment 6 Lukas Ocilka 2008-04-18 11:51:30 UTC
passwd.old (some old one from the images)
passwd.after-image-deployment (images just deployed)
passwd.after-package-installation (all packages installed)
passwd (at the end of installation)

bonus:
passwd.imported-from-previous-installation (this file has been imported from the previous installation)

It seems that the passwd and passwd.imported-from-previous-installation are the same, something must have rewritten the correct passwd file with the one from the previous install.

I'll try to find who and how...
Comment 7 Lukas Ocilka 2008-04-18 12:29:16 UTC
SystemFilesCopy.ycp:138 Copying from '/dev/sda3' files ["/etc/group", "/etc/login.defs", "/etc/passwd", "/etc/shadow"] to '/tmp/tmp_dir_for_SystemFilesCopy_files/_inst_archive_2.tgz'. Files will appear in '/var/lib/YaST2/imported/userdata'

False-positive matches:

clients/inst_user_first.ycp
---------------------------
SystemFilesCopy.ycp:226 Extracted: $["exit":0, "stderr":"", "stdout":"etc/group\netc/login.defs\netc/passwd\netc/shadow\n"] into /tmp/YaST2-03739-eyTuBT/users/var/lib/YaST2/imported/userdata

- passwd extracted to /tmp/YaST2-03739-eyTuBT/...

clients/copy_systemfiles_finish.ycp
-----------------------------------
SystemFilesCopy.ycp:226 Extracted: $["exit":0, "stderr":"", "stdout":"etc/group\netc/login.defs\netc/passwd\netc/shadow\n"] into /mnt/var/lib/YaST2/imported/userdata

- passwd extracted to /mnt/var/lib/YaST2/...
Comment 8 Lukas Ocilka 2008-04-18 12:53:03 UTC
Found that...

inst_kickoff.ycp (yast2-packager)
---------------------------------
if (!Mode::update ()) {
  if (! Installation::dirinstall_installing_into_dir) {
    SCR::Execute(.target.bash, "/bin/cp /etc/passwd " +
      "'" + String::Quote (Installation::destdir) + "/etc" + "'");
    SCR::Execute(.target.bash, "/bin/cp /etc/group " +
      "'" + String::Quote (Installation::destdir) + "/etc" + "'");
  }
}

So, no wonder that the /etc/passwd file gets rewritten.
Comment 9 Lukas Ocilka 2008-04-18 13:37:24 UTC
- Do not overwrite passwd and shadow files if they already exist on
  a system (e.g., from images) (bnc #381227).
- yast2-packager-2.16.36
Comment 10 Lukas Ocilka 2008-04-18 13:38:04 UTC
(patch has been tested)
Comment 11 Michal Marek 2008-04-18 15:36:48 UTC
Am I correct in assuming that only packages installed via images are affected? I.e. packages that aren't in any images are fine?
Comment 12 Stephan Kulow 2008-04-18 15:56:25 UTC
This is the script from Henne, which should fix the issue:

for i in aaa_base avahi beagle cups dbus-1 festival fuse \
 gdm hal ntp openssh PolicyKit postfix pulseaudio pwdutils \
 samba scrollkeeper uuid-runtime; \
 do rpm -q $i && echo zypper in -f $i; done
Comment 13 Michal Marek 2008-04-18 16:34:00 UTC
I have yast2-registration in my list (creates user suse-ncc).
Comment 14 Michal Marek 2008-04-18 16:45:41 UTC
I grepped ARCHIVES.gz from the DVDs to check if there are packages that depend on the above packages for file ownership, but haven't found any. So it should be only these few packages.
Comment 15 Michal Marek 2008-04-18 16:52:16 UTC
calls zypper once:

#!/bin/bash

packs=(aaa_base avahi beagle cups dbus-1 festival fuse gdm hal ntp openssh PolicyKit postfix pulseaudio pwdutils samba scrollkeeper uuid-runtime yast2-registration)
installed=($(rpmqpack))
reinst=($(join <(printf '%s\n' "${packs[@]}" | sort -u) <(printf '%s\n' "${installed[@]}" | sort -u)))
set -x
zypper in -f "${reinst[@]}"
Comment 16 Magnus Boman 2008-04-19 01:53:17 UTC
Using only -f doesn't work here. I get "Nothing to do", adding a -n makes it work;

packs=(aaa_base avahi beagle cups dbus-1 festival fuse gdm hal ntp openssh
PolicyKit postfix pulseaudio pwdutils samba scrollkeeper uuid-runtime
yast2-registration)
installed=($(rpmqpack))
reinst=($(join <(printf '%s\n' "${packs[@]}" | sort -u) <(printf '%s\n'
"${installed[@]}" | sort -u)))
set -x
zypper in -f -n "${reinst[@]}"
Comment 17 Lukas Ocilka 2008-04-21 10:01:13 UTC
(In reply to comment #11 from Michal Marek)
> Am I correct in assuming that only packages installed via images are affected?
> I.e. packages that aren't in any images are fine?

Kind of. Installation takes the /etc/passwd from running inst-sys and copies it to the just installed system. It depends on the inst-sys what it contains.
Comment 18 JP Rosevear 2008-04-23 14:58:23 UTC
*** Bug 382797 has been marked as a duplicate of this bug. ***
Comment 19 Marcus Meissner 2008-04-23 15:36:33 UTC
*** Bug 382741 has been marked as a duplicate of this bug. ***
Comment 20 Magnus Boman 2008-04-27 08:13:44 UTC
*** Bug 384163 has been marked as a duplicate of this bug. ***
Comment 21 Magnus Boman 2008-04-28 12:33:39 UTC
*** Bug 384338 has been marked as a duplicate of this bug. ***
Comment 22 Stephan Kulow 2008-05-04 18:00:53 UTC
*** Bug 384094 has been marked as a duplicate of this bug. ***