From patchwork Wed Mar 16 01:34:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 8594171 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D9A79F54C for ; Wed, 16 Mar 2016 01:34:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAC68203AC for ; Wed, 16 Mar 2016 01:34:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36F3020253 for ; Wed, 16 Mar 2016 01:34:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbcCPBee (ORCPT ); Tue, 15 Mar 2016 21:34:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:53692 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933932AbcCPBec (ORCPT ); Tue, 15 Mar 2016 21:34:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "Cc" Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 47A87AB9D; Wed, 16 Mar 2016 01:34:30 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Wed, 16 Mar 2016 12:34:24 +1100 Cc: Benjamin Coddington Subject: [PATCH - nfs-utils] systemd: ensure nfs-config service is re-run as needed. User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-suse-linux-gnu) cc: Linux NFS mailing list Message-ID: <87fuvrfbof.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: NeilBrown --- 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