Bug 714826

Summary: Systemd does not mount /home automatically
Product: [openSUSE] openSUSE 12.1 Reporter: Luca Beltrame <lbeltrame>
Component: BasesystemAssignee: Frederic Crozat <fcrozat>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: forgotten_6dIpwUAJQ7, waxborg
Version: Factory   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: System log from boot to login prompt
List of all unit files in the system when boot finishes
List of running unit files when boot finishes
systemd kernel log (dmesg | grep systemd)
Output of "systemd show home.mount" once bootup is complete
Output of "systemctl show nfs.service"
dmesg log with debug options
New dmesg log

Description Luca Beltrame 2011-08-29 21:07:24 UTC
User-Agent:       Mozilla/5.0 (X11; Linux) KHTML/4.7.1 (like Gecko) Konqueror/4.7

lb@leon:~$ rpm -qi systemd
Name        : systemd
Version     : 33
Release     : 16.1
Architecture: x86_64
Install Date: dom 28 ago 2011 18:53:01 CEST

Using this version of systemd, on a system with a separate /home partition,  home.mount is not executed (listed as inactive - dead), thus preventing a normal login for non root users, as the home directory is not found. This can be prevented by executing "systemctl start home.mount" manually.

Logs are attached to this bug report.

Reproducible: Always

Steps to Reproduce:
1. Pick systemd as init system on a system with separate /home
2. Boot
3. Log in as non-root user
Actual Results:  
An error about missing home directory is displayed, and login opens on /

Expected Results:  
User is logged in the corresponding home directory.

uname -a
Linux leon.lan 3.1.0-rc3-1-default #1 SMP Wed Aug 24 20:39:32 UTC 2011 (e975e4b) x86_64 x86_64 x86_64 GNU/Linux

Current Factory as of 29/08/2011.
Comment 1 Luca Beltrame 2011-08-29 21:08:10 UTC
Created attachment 448307 [details]
System log from boot to login prompt
Comment 2 Luca Beltrame 2011-08-29 21:10:47 UTC
Created attachment 448308 [details]
List of all unit files in the system when boot finishes
Comment 3 Luca Beltrame 2011-08-29 21:11:34 UTC
Created attachment 448309 [details]
List of running unit files when boot finishes
Comment 4 Luca Beltrame 2011-08-30 05:47:43 UTC
Created attachment 448344 [details]
systemd kernel log (dmesg | grep systemd)

It might be slightly off as I had to start home.mount in order to save the log to a location where I could use it.
Comment 5 Luca Beltrame 2011-08-30 05:49:34 UTC
Created attachment 448345 [details]
Output of "systemd show home.mount" once bootup is complete
Comment 6 Luca Beltrame 2011-08-30 20:16:28 UTC
I did more research and I think I found the cause.

In my fstab, I have something like this, to mount a NFS volume at boot:

seldon:/home/storage/music/Anime      /home/anime_mp3 nfs     hard,rw,intr 0 0

where "seldon" is my internal fileserver.

If I comment it out, everything works as expected. I'll test tomorrow if by setting it as a mountpoint outside /home I can prevent this issue.
Comment 7 Forgotten User 6dIpwUAJQ7 2011-09-06 14:30:33 UTC
I got the same situation with separate /boot partition. It happens because systemd have targets only for rootfs and remote fs. /lib/systemd/system/local-fs.target.wants contains requirements for rootfs, media.mount, /var/lock and /var/run, but nothing about any non-root local filesystems.
I see it is two ways to fix it:
1. YaST should add .mount target for every local fs during creation/system installation.
2. Should be added something like remote-fs.target for local filesystems, which mounts everything listed in fstab.
Comment 8 Forgotten User 6dIpwUAJQ7 2011-09-06 15:29:08 UTC
Manpage for systemd.special(7) describes local-fs.target:
systemd automatically adds dependencies of type After to all mount units that refer to local mount points for this target unit. In addition, systemd adds dependencies of type Wants to this target unit for those mounts listed in /etc/fstab that have the auto and comment=systemd.mount mount options set.

I have this options both set for /boot and /home, but mountpoints still empty on boot. When I manualy created and added home.mount and boot.mount units to the local-fs.target.wants it was no expected result.
Comment 9 Forgotten User 6dIpwUAJQ7 2011-09-07 15:29:44 UTC
Not reproduced on clean Factory installation.
Comment 10 Frederic Crozat 2011-09-08 12:28:00 UTC
Sergiy, please open a separate bug report.

Luca: I've reproduce similar issue : adding nfs mount point is causing a dependency loop (due to insserv.conf parsing), I'm working on it.
Comment 11 Frederic Crozat 2011-09-08 14:13:04 UTC
*** Bug 715965 has been marked as a duplicate of this bug. ***
Comment 12 Frederic Crozat 2011-09-09 12:05:29 UTC
I have a test package in home:fcrozat:systemd / systemd which is fixing the nfs cycle for me.

Please test.
Comment 13 Luca Beltrame 2011-09-09 12:08:32 UTC
Thanks Frederic. I'll give it a go this evening and follow up here.
Comment 14 Forgotten User 6dIpwUAJQ7 2011-09-09 12:32:55 UTC
I already tried it. Bug is not reproduced. All partitions and disk volumes mounted correctly.
Comment 15 Luca Beltrame 2011-09-09 13:07:07 UTC
Tested remotely. /home is now mounted correctly but the NFS mount point isn't:

nfs.service - LSB: NFS client services
          Loaded: loaded (/etc/init.d/nfs)
          Active: failed since Fri, 09 Sep 2011 14:14:06 +0200; 44min ago
         Process: 1058 ExecStart=/etc/init.d/nfs start (code=exited, status=1/FAILURE)
          CGroup: name=systemd:/system/nfs.service

"systemctl show nfs.service" is attached.

Relevant logs:

Sep  9 15:01:43 leon systemd[1]: Got SIGCHLD for process 1079 (nfs)
Sep  9 15:01:43 leon systemd[1]: Child 1079 died (code=exited, status=1/FAILURE)
Sep  9 15:01:43 leon systemd[1]: Child 1079 belongs to nfs.service
Sep  9 15:01:43 leon systemd[1]: nfs.service: control process exited, code=exited status=1
Sep  9 15:01:43 leon systemd[1]: nfs.service got final SIGCHLD for state start
Sep  9 15:01:43 leon systemd[1]: nfs.service changed start -> failed
Comment 16 Luca Beltrame 2011-09-09 13:08:05 UTC
Created attachment 450046 [details]
Output of "systemctl show nfs.service"
Comment 17 Frederic Crozat 2011-09-09 13:16:45 UTC
I would need dmesg output (with systemd.log_level=debug systemd.log_target=kmsg) to see what is going on.
Comment 18 Luca Beltrame 2011-09-09 13:24:03 UTC
Created attachment 450052 [details]
dmesg log with debug options

Here it is.
Comment 19 Luca Beltrame 2011-09-09 14:10:25 UTC
Created attachment 450065 [details]
New dmesg log
Comment 20 Frederic Crozat 2011-09-09 16:20:31 UTC
closing as fixed, some other fixes were needed in NetworkManager to enable NetworkManager-wait-online.service too (done in GNOME:Factory)