Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 519724 - net-fs/nfs-utils-1.3.0 - mounting NFS shares fails with: /usr/sbin/start-statd: line 8: systemctl: command not found
Summary: net-fs/nfs-utils-1.3.0 - mounting NFS shares fails with: /usr/sbin/start-stat...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Network Filesystems
URL:
Whiteboard:
Keywords:
: 530052 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-12 13:37 UTC by Juergen Rose
Modified: 2015-02-24 15:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2014-08-12 13:37:42 UTC
If i try to mount a nfs share it fails with:

root@caiman:/home/rose/Txt/Configurations(87)# mount wildcat:/home_wildcat /mnt/backup/
/usr/sbin/start-statd: line 8: systemctl: command not found
mount.nfs: Connection timed out


/usr/sbin/start-statd belongs to nfs-utils-1.3.0. It is a short bash script:

root@caiman:/home/rose/Txt/Configurations(92)# cat /usr/sbin/start-statd
#!/bin/bash -p
# nfsmount calls this script when mounting a filesystem with locking
# enabled, but when statd does not seem to be running (based on
# /var/run/rpc.statd.pid).
# It should run statd with whatever flags are apropriate for this
# site.
PATH=/sbin:/usr/sbin
if systemctl start statd.service
then :
else
    exec rpc.statd --no-notify
fi

I do not have any statd.service. What I have is a rpc-statd.service:

root@caiman:/home/rose/Txt/Configurations(93)# qlist -v nfs-utils | grep service
/usr/lib/systemd/system/rpc-gssd.service
/usr/lib/systemd/system/nfs-server.service
/usr/lib/systemd/system/nfs-idmapd.service
/usr/lib/systemd/system/rpc-statd-notify.service
/usr/lib/systemd/system/rpc-svcgssd.service
/usr/lib/systemd/system/nfs-mountd.service
/usr/lib/systemd/system/nfs-utils.service
/usr/lib/systemd/system/nfs-blkmap.service
/usr/lib/systemd/system/rpc-statd.service


I suppose, that statd.service in /usr/sbin/start-statd should be replaced by rpc-statd.service.
Comment 1 SpanKY gentoo-dev 2014-08-17 14:35:07 UTC
the warning you see is not the problem.  you are only seeing that because you are attempting a mount that requires the statd service be running, but you haven't started the statd service.  the systemctl warning is just that -- a warning.  if you aren't using systemd, then the output doesn't really matter.  it falls back to trying to launch rpc.statd automatically.

updating the name of the service has been done in upstream in 9a36e0227c4dd8c3ebd1fbb313737c9b95fbd7e1.

but even if all of that were fixed, you'd still run into the timed out error.  are you sure the settings/connection/server you've specified are valid and up and running ?
Comment 2 gentoo@danielquinn.org 2014-09-10 21:40:57 UTC
I noted that the PATH variable is set before the calling of systemctl, but systemctl doesn't live anywhere in that path, so it will always fail:

    PATH=/sbin:/usr/sbin
    if systemctl start statd.service

The binary lives in /usr/bin now, so maybe this script should be updated to include /usr/bin in the PATH?
Comment 3 Juergen Rose 2014-09-12 08:05:10 UTC
(In reply to SpanKY from comment #1)
> the warning you see is not the problem.  you are only seeing that because
> you are attempting a mount that requires the statd service be running, but
> you haven't started the statd service.  the systemctl warning is just that
> -- a warning.  if you aren't using systemd, then the output doesn't really
> matter.  it falls back to trying to launch rpc.statd automatically.
> 
> updating the name of the service has been done in upstream in
> 9a36e0227c4dd8c3ebd1fbb313737c9b95fbd7e1.
> 
> but even if all of that were fixed, you'd still run into the timed out
> error.  are you sure the settings/connection/server you've specified are
> valid and up and running ?

The reason for the timeout of the mount was, that the nfs-server on wildcat fails to start with:

root@wildcat:/root(10)# journalctl -xn
-- Logs begin at Fri 2014-02-14 13:59:03 CET, end at Fri 2014-09-12 08:36:53 CEST. --
Sep 12 08:36:53 wildcat rpc.mountd[15083]: Version 1.3.0 starting
Sep 12 08:36:53 wildcat systemd[1]: Started NFS Mount Daemon.
-- Subject: Unit nfs-mountd.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nfs-mountd.service has finished starting up.
-- 
-- The start-up result is done.
Sep 12 08:36:53 wildcat systemd[1]: Starting NFS server and services...
-- Subject: Unit nfs-server.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nfs-server.service has begun starting up.
Sep 12 08:36:53 wildcat rpc.nfsd[15087]: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
Sep 12 08:36:53 wildcat kernel: svc: failed to register nfsdv3 RPC service (errno 111).
Sep 12 08:36:53 wildcat kernel: svc: failed to register nfsdv3 RPC service (errno 97).
Sep 12 08:36:53 wildcat systemd[1]: nfs-server.service: main process exited, code=exited, status=1/FAILURE
Sep 12 08:36:53 wildcat systemd[1]: Failed to start NFS server and services.
-- Subject: Unit nfs-server.service has failed


The reason for the failing nfs-server seems to be that rpcbind fails to start before:

root@wildcat:/root(12)# rpcinfo 
rpcinfo: can't contact rpcbind: RPC: Remote system error - No such file or directory
root@wildcat:/root(13)# systemctl status rpcbind
● rpcbind.service - RPC Bind
   Loaded: loaded (/usr/lib64/systemd/system/rpcbind.service; enabled)
   Active: failed (Result: exit-code) since Fri 2014-09-12 00:06:43 CEST; 9h ago
 Main PID: 1891 (code=exited, status=2)

Sep 12 00:06:43 wildcat systemd[1]: Stopping RPC Bind...
Sep 12 00:06:43 wildcat systemd[1]: rpcbind.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 12 00:06:43 wildcat systemd[1]: Stopped RPC Bind.
Sep 12 00:06:43 wildcat systemd[1]: Unit rpcbind.service entered failed state.

I have rpcbind.service in /etc/systemd/system/multi-user.target.wants/ , but I assume it fails to start during booting , because the dhcp-server was not accessible during booting and therefore the network does not come up correctly.
Comment 4 SpanKY gentoo-dev 2014-09-18 21:00:50 UTC
(In reply to gentoo@danielquinn.org from comment #2)

latest upstream does:
PATH="/sbin:/usr/sbin:/bin:/usr/bin"

i don't think we need to do an explicit bump here to pull in the latest version as in a normal running system, statd should already be started.  if it isn't, then there's some other problem that should be fixed first.

(In reply to Juergen Rose from comment #3)

i don't really follow systemd, so it's not clear to me this is a bug in nfs-utils at all.
Comment 5 SpanKY gentoo-dev 2015-02-24 15:50:37 UTC
*** Bug 530052 has been marked as a duplicate of this bug. ***