Issue withsystemd and home on nfs

Hello,
I have a little problem with nfs and systemd on Opensuse 12.1
We mount our home directory via nfs and since we use fast Virtual Machines, the login screen is ready before home is mounted, so if a user wants to login he gets an error.

So it would be a good idea to create a dependency which only starts the login, when home is mounted (I don’t need the machine if I have no home, and for maintenance, I boot into runlevel 3)

I tried this with creating a file home.mount with the following content:


[Unit]
Description=home
Wants=network.target rpc-statd.service
After=network.target rpc-statd.service

[Mount]
What=nas03:/home
Where=home
Type=nfs
StandardOutput=syslog
StandardError=syslog

and tried this lines in systemd-logind.service

Wants=remote-fs.target
After=remote-fs.target
Requires=home.mount

but it does not help (as you see, I am a total newbee to systemd)

Any ideas how to solve this?

Maybe… but I’m using a brutal hack:

# cat /etc/init.d/after.local

# !/bin/sh

echo ""
echo -n "Running after.local "

# run a command after a given process  
function runafter {
proc=$1
shift
 -x $proc ] || return 1
while ( ! /sbin/checkproc $proc ) ; do
        sleep 1
done
$* >/dev/null
}

# mounting fileserver
runafter /sbin/rpcbind

# mount your home directory via nfs here 
 

Systemd purists won’t like it … so don’t tell them!
http://forums.opensuse.org/english/other-forums/development/programming-scripting/469832-running-commands-depend-process-being-started-after-local.html

Another option is to see if SysVinit shows the same problem. At boot, hit F5 en choose System V. If the problem is not there when booting with System V’s init, you can make this persistent by installing sysvinit-sysvinit

It won’t. (I mean, yes, it will work fine in sysVinit). It’s a typical systemd problem and doesn’t only affect openSUSE. The trick I use on Fedora is even ugglier. rpcbind is started too late, preventing nfs mount from working at system start. You have to insert a delay somewhere.

On 2012-03-07 22:06, please try again wrote:
>
> Knurpht;2446621 Wrote:
>> Another option is to see if SysVinit shows the same problem.
>
> It won’t. (I mean, yes, it will work fine in sysVinit). It’s a typical
> systemd problem and doesn’t only affect openSUSE. The trick I use on
> Fedora is even ugglier. rpcbind is started too late, preventing nfs
> mount from working at system start. You have to insert a delay
> somewhere.

There is a very much updated systemd on
http://download.opensuse.org/repositories/home:/fcrozat:/systemd/openSUSE_12.1/,
I know it solves many problems. I have it installed in my test system.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hi,
thank you for all the answers.
the script of please_try_again unfortunately does not help, neither does the new systemd version.

the only thing that helped is using systemV so this could be a workaround, but a bad one,. since it increases the whole boot time a lot.

So other ideas are welcome.

The script does work. I use it on half a dozen machines to mount our file server. But the script alone is not enough. You also have to re-enable after.local, so that this script gets executed. That’s why I started my thread with a link to a blog article by @jdmcdaniel3 explaining how to achieve that: systemd and using the after.local script in openSUSE 12.1 - Blogs - openSUSE Forums.

Hi,
sorry for my allegation that it does not work, I did not read properly
(and I totally blame the Friday for this :wink: )

When i activate it, it works great on my desktop nodes, so thanks a lot for that.

But for some reasons, it does not work on machines which only start in textmode.
There after sometime i get the message “Starting rpc.statd” after some time.

Any ideas what is different there?