summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/mount/network.c14
-rw-r--r--utils/statd/start-statd2
2 files changed, 14 insertions, 2 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c
index 2db694d..806344c 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -36,6 +36,7 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/wait.h>
#include <netinet/in.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
@@ -705,7 +706,18 @@ int start_statd(void)
#ifdef START_STATD
if (stat(START_STATD, &stb) == 0) {
if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) {
- system(START_STATD);
+ pid_t pid = fork();
+ switch (pid) {
+ case 0: /* child */
+ execl(START_STATD, START_STATD, NULL);
+ exit(1);
+ case -1: /* error */
+ perror("Fork failed");
+ break;
+ default: /* parent */
+ waitpid(pid, NULL,0);
+ break;
+ }
if (probe_statd())
return 1;
}
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index 6e7ea04..c7805ee 100644
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -p
# nfsmount calls this script when mounting a filesystem with locking
# enabled, but when statd does not seem to be running (based on
# /var/run/rpc.statd.pid).