From patchwork Sat Jan 18 16:51:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 3508651 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 1B2A9C02DC for ; Sat, 18 Jan 2014 16:49:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34F7B20123 for ; Sat, 18 Jan 2014 16:49:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4219320131 for ; Sat, 18 Jan 2014 16:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751047AbaARQtZ (ORCPT ); Sat, 18 Jan 2014 11:49:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36175 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbaARQtZ (ORCPT ); Sat, 18 Jan 2014 11:49:25 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0IGnO9R004042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 18 Jan 2014 11:49:24 -0500 Received: from smallhat.boston.devel.redhat.com (vpn-60-134.rdu2.redhat.com [10.10.60.134]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0IGnORY019253 for ; Sat, 18 Jan 2014 11:49:24 -0500 From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH] rpc.statd: Allow usage messages to be displayed when statd is running. Date: Sat, 18 Jan 2014 11:51:15 -0500 Message-Id: <1390063875-11456-1-git-send-email-steved@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Signed-off-by: Steve Dickson --- utils/statd/statd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/statd/statd.c b/utils/statd/statd.c index 8c51bcc..8f31111 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -238,12 +238,6 @@ int main (int argc, char **argv) /* Set hostname */ MY_NAME = NULL; - /* Refuse to start if another statd is running */ - if (nfs_probe_statd()) { - fprintf(stderr, "Statd service already running!\n"); - exit(1); - } - /* Process command line switches */ while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:L", longopts, NULL)) != EOF) { switch (arg) { @@ -306,6 +300,12 @@ int main (int argc, char **argv) } } + /* Refuse to start if another statd is running */ + if (nfs_probe_statd()) { + fprintf(stderr, "Statd service already running!\n"); + exit(1); + } + if (port == out_port && port != 0) { fprintf(stderr, "Listening and outgoing ports cannot be the same!\n"); exit(-1);