You are not logged in.

#1 2012-05-19 10:45:00

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

systemd and nfs-common ?

My nfs-client setup takes 62s to mount a nfsv4 share. I've tried to solve this by creating an own systemd nfs-common.service but it fails. It doesn't see rpcbind as started, which it is. I've googled high and low for a systemd *.service that works but haven't any nfs-common.service file at all.

I have ExecStart=/etc/rc.d/nfs-common start in my .service file and it is enabled but status message is;

nfs-common.service - nfs-common
	  Loaded: loaded (/etc/systemd/system/nfs-common.service; enabled)
	  Active: failed (Result: exit-code) since Sat, 19 May 2012 12:25:43 +0200; 10min ago
	 Process: 1911 ExecStart=/etc/rc.d/nfs-common start (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/nfs-common.service

sudo /etc/rc.d/nfs-common start gives;

Start rpcbind first.                                                                                             [FAIL] 
Same as in journal systemd-journalctl | grep -i nfs; 
May 19 12:14:09 mediadatorn kernel: RPC: Registered tcp NFSv4.1 backchannel...e.
May 19 12:14:09 mediadatorn kernel: FS-Cache: Netfs 'nfs' registered for caching
May 19 12:14:10 mediadatorn[103]: Inserted module 'nfs'
May 19 12:14:11 mediadatorn nfs-common[227]: Start rpcbind first.   [FAIL]

All this came about since I started trying to optimize systemd. Before today, when I tried to disable all legacy arch units, I had the nfs client running ok. I did this after reading falconindys tip in the big systemd thread. By the way, that thread is so big it has become nearly useless.

Boot up times:

systemd-analyze
Startup finished in 13269ms (kernel) + 94810ms (userspace) = 108080ms
systemd-analyze blame 
 62034ms mnt-SERVER_NYTT.mount
  6764ms console-kit-daemon.service
  2787ms systemd-modules-load.service
  1838ms home.mount
   867ms syslog-ng.service
   552ms rpc-statd.service
...

Offline

#2 2012-05-19 11:58:47

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: systemd and nfs-common ?

I followed this

falconindy wrote:

    arch-daemons.target. Sadly, it's going to be a little longer than I wanted until that unit disappears. That said, the intended usage of that target was never meant to be more than:

    1) Install systemd, initscripts-systemd, systemd-arch-units (arch-daemons.target is enabled)
    2) reboot
    3) copy /run/systemd/generator/arch-daemons.target.wants/*.service to /etc/systemd/system for anything where a native unit file doesn't exist
    4) kill -1 1 (refreshes systemd's unit database)
    5) systemctl enable *.service (for the services you copied over in step 3)
    6) disable arch-daemons.target
    7) ????
    8) profit.

(finally found it)

Right now I'm trying to reverse it and start over.

Last edited by swanson (2012-05-19 11:59:11)

Offline

#3 2012-05-19 13:34:01

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: systemd and nfs-common ?

Back to normal again after reactivating arch-daemons.target. But it's not good yet ...

Offline

#4 2012-06-24 00:09:13

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Re: systemd and nfs-common ?

swanson wrote:

I followed this

falconindy wrote:

    arch-daemons.target. Sadly, it's going to be a little longer than I wanted until that unit disappears. That said, the intended usage of that target was never meant to be more than:

    1) Install systemd, initscripts-systemd, systemd-arch-units (arch-daemons.target is enabled)
    2) reboot
    3) copy /run/systemd/generator/arch-daemons.target.wants/*.service to /etc/systemd/system for anything where a native unit file doesn't exist
    4) kill -1 1 (refreshes systemd's unit database)
    5) systemctl enable *.service (for the services you copied over in step 3)
    6) disable arch-daemons.target
    7) ????
    8) profit.

(finally found it)

Right now I'm trying to reverse it and start over.

I tried this, and immediately didn't get it to mount.  I restarted rpcbind (supposedly already running) and nfs-common and I think it still stalled on mounting, but now I that I've been away from it, it finally did mount.

Last edited by nomorewindows (2012-06-24 00:09:47)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2012-06-24 00:21:03

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: systemd and nfs-common ?

systemctl enable rpcbind.service rpc-idmapd.service

Get rid of the legacy crap.

Offline

#6 2012-06-24 01:29:03

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Re: systemd and nfs-common ?

falconindy wrote:

systemctl enable rpcbind.service rpc-idmapd.service

Get rid of the legacy crap.

I did even try it with just rpcbind.service and I got:
Warning: unit files do not carry install information.  No operation executed.
I guess I don't have the rpc-idmapd.service file.

Do you mean remove all the stuff that was just put into /etc/systemd/system in the lines above?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#7 2012-06-24 05:55:17

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: systemd and nfs-common ?

Those instructions were intermediary and now the way is to go native. I've found that the best way to mount nfs shares on the client is to use fstab and something like;

192.168.1.250:/ /mnt/servershare nfs4 noauto,rw,hard,async,intr,_netdev,clientaddr=192.168.1.251,x-systemd.automount 0 0

The essential options here are noauto and x-systemd.automount. This will leave everything up to systemd and it will start whatever necessary.

Offline

#8 2012-06-24 11:38:40

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: systemd and nfs-common ?

swanson wrote:

The essential options here are noauto and x-systemd.automount. This will leave everything up to systemd and it will start whatever necessary.

Well, no... that's not true. Nothing in the nfs mounting path is socket activated. rpcbind eventually will be. For now, the only advantage of that setup is automount on first access via the autofs subsys in the kernel.

Offline

#9 2012-06-24 12:16:42

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: systemd and nfs-common ?

I see. But that set up works nicely and gives a quicker boot. Now I understand why.

Offline

Board footer

Powered by FluxBB