From: Florian Fainelli Date: Sun, 18 Mar 2007 17:36:54 +0000 (+0000) Subject: Fix pid writing with olsrd (#1480) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=24257da8e7eb8323f052622f9a3572c4a350b55d;p=openwrt%2Fsvn-archive%2Fpackages.git Fix pid writing with olsrd (#1480) SVN-Revision: 6609 --- diff --git a/net/olsrd/files/olsrd.init b/net/olsrd/files/olsrd.init index 3cdd6ae15..572ea9e11 100644 --- a/net/olsrd/files/olsrd.init +++ b/net/olsrd/files/olsrd.init @@ -1,11 +1,21 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2006 OpenWrt.org +BIN=olsrd DEFAULT=/etc/default/olsrd +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid start() { [ -f $DEFAULT ] && . $DEFAULT - olsrd $OPTIONS + $BIN -nofork $OPTIONS & + + # write pid file (but strip out own pid ($$)) + mkdir -p $RUN_D + PID=`pidof $BIN` + echo ${PID%$$} > $PID_F + + } stop() {