diff mbox

[1/2] systemd: Order NFS server before client

Message ID 1425403690-23847-2-git-send-email-martin.pitt@ubuntu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Pitt March 3, 2015, 5:28 p.m. UTC
This makes mounting NFS shares from localhost work reliably, as you need to
start the server before attempting (client) mounts, and conversely on shutdown
need to unmount all shares before stopping the server to avoid hangs.
---
 systemd/nfs-server.service | 3 +++
 1 file changed, 3 insertions(+)

Comments

Zbigniew Jędrzejewski-Szmek March 3, 2015, 5:58 p.m. UTC | #1
On Tue, Mar 03, 2015 at 06:28:09PM +0100, Martin Pitt wrote:
> This makes mounting NFS shares from localhost work reliably, as you need to
> start the server before attempting (client) mounts, and conversely on shutdown
> need to unmount all shares before stopping the server to avoid hangs.
> ---
>  systemd/nfs-server.service | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
> index 8010aad..b35e193 100644
> --- a/systemd/nfs-server.service
> +++ b/systemd/nfs-server.service
> @@ -13,6 +13,9 @@ Before= rpc-statd-notify.service
>  Wants=auth-rpcgss-module.service
>  After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
>  
> +# start/stop server before/after client
> +Before=remote-fs-pre.target
> +
>  Wants=nfs-config.service
>  After=nfs-config.service

Looks reasonable.

Zbyszek
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 8010aad..b35e193 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -13,6 +13,9 @@  Before= rpc-statd-notify.service
 Wants=auth-rpcgss-module.service
 After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
 
+# start/stop server before/after client
+Before=remote-fs-pre.target
+
 Wants=nfs-config.service
 After=nfs-config.service