This is a possible bug report for the bootscripts 6.2:

What I was trying to do: Have two Instances of openvpn running at the
same time, beeing started and stopped separately by two scripts in
/etc/rc.d/init.d. I called them with:
loadproc -p /var/run/openvpn-1.pid openvpn --config someconfig1 and
loadproc -p /var/run/openvpn-2.pid openvpn --config someconfig2.

And tried to stop them with
killproc -p /var/run/openvpn-1.pid openvpn and
killproc -p /var/run/openvpn-2.pid openvpn respectively.

When both instances are up and I tried to stop one of both, the right
openvpn process gets killed and the pidfile removed but the script
reports a [failed] due to the fact that pidofproc one time gets called
without the -p option. I tried to correct it with the appended patch. I
also tried to correct a message generated by kill "no such process",
which should go to /dev/null I guess.

I hope this helps, regards thorsten
--- lfs-bootscripts-6.2/lfs/init.d/functions.orig       2006-03-22 
02:02:32.000000000 +0100
+++ lfs-bootscripts-6.2/lfs/init.d/functions    2006-10-31 14:58:51.000000000 
+0100
@@ -363,7 +363,7 @@
                for pid in ${lpids}
                do
                        if [ "${pid}" -ne "$$" -a "${pid}" -ne "${PPID}" ]; then
-                               kill -0 "${pid}" > /dev/null &&
+                               kill -0 "${pid}" > /dev/null 2>&1 &&
                                pidlist="${pidlist} ${pid}"
                        fi
                        
@@ -588,7 +588,11 @@
        done
 
        if [ -z "${killsig}" ]; then
-               pidofproc -s "${1}"
+               if [ -z "${pidfile}" ]; then
+                       pidofproc -s "${1}"
+               else
+                       pidofproc -s -p "${pidfile}" "${1}"
+               fi
 
                # Program was terminated
                if [ "$?" != "0" ]; then
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to