diff options
author | Weston Andros Adamson <dros@netapp.com> | 2013-05-07 11:25:29 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2013-05-07 11:47:35 -0400 |
commit | 342446a4a624d4ee8254af859bb7f1de6d268679 (patch) | |
tree | 75b007d719971b7fb0d789df62e69862cbf4d390 /utils/statd/statd.c | |
parent | 8fc8022c75956efb14cd2b1fa93210d534310cf9 (diff) | |
download | nfs-utils-342446a4a624d4ee8254af859bb7f1de6d268679.tar.gz nfs-utils-342446a4a624d4ee8254af859bb7f1de6d268679.tar.xz nfs-utils-342446a4a624d4ee8254af859bb7f1de6d268679.zip |
statd: exit if a statd is already running
Moves nfs_probe_statd from mount to nfs support lib to share with statd.
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/statd/statd.c')
-rw-r--r-- | utils/statd/statd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/statd/statd.c b/utils/statd/statd.c index 652546c..8c51bcc 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -28,6 +28,7 @@ #include "statd.h" #include "nfslib.h" +#include "nfsrpc.h" #include "nsm.h" /* Socket operations */ @@ -237,6 +238,12 @@ 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) { |