[dhcp] dhclient-script: fix checking for other running dhclient

Jiří Popelka jpopelka at fedoraproject.org
Fri Jan 7 12:21:39 UTC 2011


commit c8c18ca6c89a535dd41fb76067c04e66fcd104f2
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Fri Jan 7 13:19:41 2011 +0100

    dhclient-script: fix checking for other running dhclient

 dhclient-script |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/dhclient-script b/dhclient-script
index 29c8b72..04b9ff6 100644
--- a/dhclient-script
+++ b/dhclient-script
@@ -747,7 +747,9 @@ case "${reason}" in
     EXPIRE|FAIL|RELEASE|STOP)
         # only restore config files if there are no other dhclient processes
         # running (#306381)
-        any_other_clients="$(ps -eo pid,ppid,comm | grep dhclient | grep -v ${PPID})"
+        dhclient_script_PID="$$"
+        dhclient_PID="${PPID}"
+        any_other_clients=$(ps -eo pid,ppid,comm | grep dhclient | grep -v -E "${dhclient_script_PID}|${dhclient_PID}")
         if [ -n "${any_other_clients}" ]; then
             if [ -f ${SAVEDIR}/resolv.conf.predhclient.${interface} ]; then
                 change_resolv_conf ${SAVEDIR}/resolv.conf.predhclient.${interface}


More information about the scm-commits mailing list