From patchwork Tue Feb 4 01:09:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 3573591 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1C70C02DC for ; Tue, 4 Feb 2014 01:10:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 419AA20179 for ; Tue, 4 Feb 2014 01:10:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A27120170 for ; Tue, 4 Feb 2014 01:10:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbaBDBKJ (ORCPT ); Mon, 3 Feb 2014 20:10:09 -0500 Received: from cantor2.suse.de ([195.135.220.15]:42181 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752388AbaBDBKI (ORCPT ); Mon, 3 Feb 2014 20:10:08 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D1B31AC7B; Tue, 4 Feb 2014 01:10:06 +0000 (UTC) Date: Tue, 4 Feb 2014 12:09:57 +1100 From: NeilBrown To: Steve Dickson , linux-nfs@vger.kernel.org Subject: [PATCH nfs-utils] systemd units: merge nfs-server.service and nfs-server.target Message-ID: <20140204120957.7bb0375a@notabene.brown> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) 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=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable 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 With systemd, a 'service' should run a single server while a 'target' can be used to group services. As nfs service is really a group of services a 'target' makes more sense. However that means that we need commands like systemctl start nfs-server.target rather than the more simple systemctl start nfs-server As the target/service separate doesn't bring any gain except a minor aesthetic, and does bring a practical inconvenience, this patch merges nfs-server.target into nfs-server.service. Reported-by: Steve Dickson Signed-off-by: NeilBrown diff --git a/systemd/README b/systemd/README index f0fb68825499..00d3e415092e 100644 --- a/systemd/README +++ b/systemd/README @@ -10,9 +10,13 @@ rpc.rquotad (in the 'quota' package) or rpcbind. There are 4 units that can be 'enabled' or 'disabled' by systemctl, or by a suitable 'preset' setting: - nfs-server.target + nfs-server.service If enabled, nfs service is started together with dependencies such as mountd, statd, rpc.idmapd + This is a "service" file rather than a "target" (which is the + normal grouping construct) so that + systemctl start nfs-server + can work (if no type is given, ".service" is assumed). nfs-client.target If enabled, daemons needs for an nfs client are enabled. diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service index 9812866c66aa..6ba2fc0f346e 100644 --- a/systemd/nfs-server.service +++ b/systemd/nfs-server.service @@ -1,8 +1,10 @@ [Unit] -Description=NFS server +Description=NFS server and services DefaultDependencies=no Requires= network.target proc-fs-nfsd.mount rpcbind.target -PartOf=nfs-server.target +Requires= nfs-mountd.service +Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service +Wants=rpc-statd-notify.service After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service After= nfs-idmapd.service rpc-statd.service @@ -22,3 +24,6 @@ ExecStopPost=/usr/sbin/exportfs -au ExecStopPost=/usr/sbin/exportfs -f ExecReload=/usr/sbin/exportfs -r + +[Install] +WantedBy=multi-user.target diff --git a/systemd/nfs-server.target b/systemd/nfs-server.target deleted file mode 100644 index a3e629f022a9..000000000000 --- a/systemd/nfs-server.target +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=NFS server services -Requires=nfs-server.service nfs-mountd.service -Wants=rpc-statd.service nfs-idmapd.service rpc-gssd.service rpc-svcgssd.service -Wants=rpc-statd-notify.service - -[Install] -WantedBy=multi-user.target