need a wrapper to achieve this
tnldown \
tnlup
-#scriptsdir = @networkscriptsdir@
scriptsdir = @exec_prefix@/lib/$(PACKAGE)
scripts_SCRIPTS = \
ifup-ppp \
ifup-routes \
ifup-sl \
- ifup-vlan
+ ifup-vlan \
+ makepid \
scripts_DATA = \
functions \
--exec "$prog" \
-- "$@"
else
+ if [ "$makepid" ] && [ "$pidfile" ]; then
+ export PIDFILE="$pidfile"
+ set -- /lib/rc-scripts/makepid "$@"
+ fi
+
if [ "$fork" = "1" ]; then
set -- /usr/bin/setsid "$@"
fi
--- /dev/null
+#!/bin/sh
+test -n "$PIDFILE" || { echo >&2 'Missing $PIDFILE env'; exit 1; }
+
+# run the program, and capture pid
+prog="$1"; shift
+"$prog" "$@" &
+pid=$!
+rc=$?
+
+# write pid to file
+echo "$pid" > "$PIDFILE"
+exit $rc