+static void start_statd()
+{
+ /* If /var/run/rpc.statd.pid exists and is non-empty,
+ * assume statd already running.
+ * If START_STATD not defined, or defined to a non-existent file,
+ * don't bother,
+ * else run that file (typically a shell script)
+ */
+ struct stat stb;
+ if (stat("/var/run/rpc.statd.pid", &stb) == 0 &&
+ stb.st_size > 0)
+ return;
+#ifdef START_STATD
+ if (stat(START_STATD, &stb) ==0 &&
+ S_ISREG(stb.st_mode) &&
+ (stb.st_mode & S_IXUSR))
+ system(START_STATD);
+#endif
+}
+