summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/xinetd/files/xinetd-run-2.3.0')
-rwxr-xr-xsys-apps/xinetd/files/xinetd-run-2.3.028
1 files changed, 28 insertions, 0 deletions
diff --git a/sys-apps/xinetd/files/xinetd-run-2.3.0 b/sys-apps/xinetd/files/xinetd-run-2.3.0
new file mode 100755
index 000000000000..26fcefcbf0f1
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd-run-2.3.0
@@ -0,0 +1,28 @@
+#!/bin/sh
+#remove stale pid files
+if [ -e /var/run/xinetd.pid ]
+then
+ mypids="`cat /var/run/xinetd.pid`"
+ myrun=`/sbin/pidof xinetd`
+ ok=0
+ for x in $mypids
+ do
+ if [ "$myrun" = "$x" ]
+ then
+ #this is a running xinetd process, pidfile ok
+ ok=1
+ fi
+ done
+ if [ "$ok" = "0" ]
+ then
+ #bogus pidfile, remove
+ rm /var/run/xinetd.pid
+ fi
+fi
+if [ ! -e /var/run/xinetd.pid ]
+then
+ /usr/sbin/xinetd -pidfile /var/run/xinetd.pid
+ /usr/bin/sleep 1
+fi
+exec /usr/bin/watchpid `cat /var/run/xinetd.pid`
+