All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Pitt <martin.pitt@ubuntu.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] systemd: Relax dependencies of services
Date: Tue, 3 Mar 2015 16:50:10 +0100	[thread overview]
Message-ID: <20150303155010.GC3219@piware.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 427 bytes --]

Hello all,

I would like to make NFS start earlier in the boot (i. e. before
basic.target), so that you can do things like put /var/ on NFS, and
rcS SysV init scripts which depend on $remote_fs work.

I tested this on both a server and a client.

Thanks for considering!

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

[-- Attachment #1.2: 0001-systemd-Relax-dependencies-of-services.patch --]
[-- Type: text/x-diff, Size: 4114 bytes --]

From e4eba8124c4efbfa172e5bc0aac632452b97e016 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 3 Mar 2015 16:42:28 +0100
Subject: [PATCH] systemd: Relax dependencies of services

Stop depending on basic.target in the daemons which still do; i. e. add
DefaultDependencies=no. This makes it possible to run NFS during early boot,
and helps if you e. g. have /var on NFS. We don't require much else than
local-fs.
---
 systemd/auth-rpcgss-module.service | 1 +
 systemd/nfs-config.service         | 2 ++
 systemd/nfs-idmapd.service         | 3 ++-
 systemd/nfs-mountd.service         | 3 ++-
 systemd/nfs-server.service         | 2 ++
 systemd/rpc-statd-notify.service   | 3 ++-
 systemd/rpc-svcgssd.service        | 3 ++-
 7 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/systemd/auth-rpcgss-module.service b/systemd/auth-rpcgss-module.service
index 0355e13..5241f7b 100644
--- a/systemd/auth-rpcgss-module.service
+++ b/systemd/auth-rpcgss-module.service
@@ -6,6 +6,7 @@
 # unit will fail.  But that's OK.)
 [Unit]
 Description=Kernel Module supporting RPCSEC_GSS
+DefaultDependencies=no
 Before=gssproxy.service rpc-svcgssd.service rpc-gssd.service
 Wants=gssproxy.service rpc-svcgssd.service rpc-gssd.service
 ConditionPathExists=/etc/krb5.keytab
diff --git a/systemd/nfs-config.service b/systemd/nfs-config.service
index 64010e6..7f65305 100644
--- a/systemd/nfs-config.service
+++ b/systemd/nfs-config.service
@@ -1,5 +1,7 @@
 [Unit]
 Description=Preprocess NFS configuration
+After=local-fs.target
+DefaultDependencies=no
 
 [Service]
 Type=oneshot
diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service
index e84f8c8..df3dd9d 100644
--- a/systemd/nfs-idmapd.service
+++ b/systemd/nfs-idmapd.service
@@ -1,7 +1,8 @@
 [Unit]
 Description=NFSv4 ID-name mapping service
+DefaultDependencies=no
 Requires=var-lib-nfs-rpc_pipefs.mount
-After=var-lib-nfs-rpc_pipefs.mount
+After=var-lib-nfs-rpc_pipefs.mount local-fs.target
 
 BindsTo=nfs-server.service
 
diff --git a/systemd/nfs-mountd.service b/systemd/nfs-mountd.service
index d908afe..8a39f3e 100644
--- a/systemd/nfs-mountd.service
+++ b/systemd/nfs-mountd.service
@@ -1,8 +1,9 @@
 [Unit]
 Description=NFS Mount Daemon
+DefaultDependencies=no
 Requires=proc-fs-nfsd.mount
 After=proc-fs-nfsd.mount
-After=network.target
+After=network.target local-fs.target
 BindsTo=nfs-server.service
 
 Wants=nfs-config.service
diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index b35e193..db801cb 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -1,10 +1,12 @@
 [Unit]
 Description=NFS server and services
+DefaultDependencies=no
 Requires= network.target proc-fs-nfsd.mount rpcbind.target
 Requires= nfs-mountd.service
 Wants=rpc-statd.service nfs-idmapd.service
 Wants=rpc-statd-notify.service
 
+After= local-fs.target
 After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service
 After= nfs-idmapd.service rpc-statd.service
 Before= rpc-statd-notify.service
diff --git a/systemd/rpc-statd-notify.service b/systemd/rpc-statd-notify.service
index a655445..a7e2f8e 100644
--- a/systemd/rpc-statd-notify.service
+++ b/systemd/rpc-statd-notify.service
@@ -1,7 +1,8 @@
 [Unit]
 Description=Notify NFS peers of a restart
+DefaultDependencies=no
 Requires=network-online.target
-After=network.target nss-lookup.target
+After=local-fs.target network.target nss-lookup.target
 
 # if we run an nfs server, it needs to be running before we
 # tell clients that it has restarted.
diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service
index f7424b0..41177b6 100644
--- a/systemd/rpc-svcgssd.service
+++ b/systemd/rpc-svcgssd.service
@@ -1,7 +1,8 @@
 [Unit]
 Description=RPC security service for NFS server
+DefaultDependencies=no
 Requires=var-lib-nfs-rpc_pipefs.mount
-After=var-lib-nfs-rpc_pipefs.mount
+After=var-lib-nfs-rpc_pipefs.mount local-fs.target
 PartOf=nfs-server.service
 PartOf=nfs-utils.service
 
-- 
2.1.4


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

             reply	other threads:[~2015-03-03 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 15:50 Martin Pitt [this message]
2015-03-03 17:10 ` [PATCH] systemd: Relax dependencies of services Steve Dickson
2015-03-03 17:29   ` Martin Pitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150303155010.GC3219@piware.de \
    --to=martin.pitt@ubuntu.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.