diff mbox

[-,nfs-utils] systemd: ensure nfs-config service is re-run as needed.

Message ID 87fuvrfbof.fsf@notabene.neil.brown.name (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown March 16, 2016, 1:34 a.m. UTC
The nfs-config service translates distro-specific startup
configuration into "environment" variable read and used
by systemd unit files.

Currently it is only run once, so subsequent changes to the
distro-specific files do not take effect when an nfs service is
restarted.

If we change "RemainAfterExit=yes" to "RemainAfterExit=no" then the
service will be restarted before any dependant service is started, so
the environment file will always be up to date.

Reported-and-tested-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
---
 systemd/nfs-config.service | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Steve Dickson March 16, 2016, 6:23 p.m. UTC | #1
On 03/15/2016 09:34 PM, NeilBrown wrote:
> 
> The nfs-config service translates distro-specific startup
> configuration into "environment" variable read and used
> by systemd unit files.
> 
> Currently it is only run once, so subsequent changes to the
> distro-specific files do not take effect when an nfs service is
> restarted.
> 
> If we change "RemainAfterExit=yes" to "RemainAfterExit=no" then the
> service will be restarted before any dependant service is started, so
> the environment file will always be up to date.
> 
> Reported-and-tested-by: Benjamin Coddington <bcodding@redhat.com>
> Signed-off-by: NeilBrown <neilb@suse.com>
Committed... Nice Work!!! 

steved.
> ---
>  systemd/nfs-config.service | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/systemd/nfs-config.service b/systemd/nfs-config.service
> index 7f653058f424..e0a7f83314f5 100644
> --- a/systemd/nfs-config.service
> +++ b/systemd/nfs-config.service
> @@ -5,5 +5,9 @@ DefaultDependencies=no
>  
>  [Service]
>  Type=oneshot
> -RemainAfterExit=yes
> +# This service needs to run any time any nfs service
> +# is started, so changes to local config files get
> +# incorporated.  Having "RemainAfterExit=no" (the default)
> +# ensures this happens.
> +RemainAfterExit=no
>  ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh
> 
--
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-config.service b/systemd/nfs-config.service
index 7f653058f424..e0a7f83314f5 100644
--- a/systemd/nfs-config.service
+++ b/systemd/nfs-config.service
@@ -5,5 +5,9 @@  DefaultDependencies=no
 
 [Service]
 Type=oneshot
-RemainAfterExit=yes
+# This service needs to run any time any nfs service
+# is started, so changes to local config files get
+# incorporated.  Having "RemainAfterExit=no" (the default)
+# ensures this happens.
+RemainAfterExit=no
 ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh