From 691dfed92dd058d2d83cdfbed9a72ba09aae086a Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Tue, 6 Oct 2009 13:33:20 +0100
Subject: [PATCH] ethers hook: allow more than one daemon pidfile

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 doc/examples/hooks/ethers | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/examples/hooks/ethers b/doc/examples/hooks/ethers
index 387ed7e6f..75e7cc1e7 100755
--- a/doc/examples/hooks/ethers
+++ b/doc/examples/hooks/ethers
@@ -34,7 +34,7 @@
 # TARGET_BRIDGE: We'll only add the first nic which gets connected to this
 # bridge to /etc/ethers.
 TARGET_BRIDGE="br0"
-DAEMON_PID_FILE="/var/run/dnsmasq.pid"
+DAEMON_PID_FILES="/var/run/dnsmasq.pid /var/run/dnsmasq/dnsmasq.pid"
 
 # In order to handle concurrent execution of this lock, we use the $LOCKFILE.
 # LOCKFILE_CREATE and LOCKFILE_REMOVE are the path names for the lockfile-progs
@@ -57,7 +57,9 @@ acquire_lockfile() {
 update_ethers_from_new() {
   chmod 644 /etc/ethers.new
   mv /etc/ethers.new /etc/ethers
-  [ -f "$DAEMON_PID_FILE" ] && kill -HUP $(< $DAEMON_PID_FILE)
+  for file in $DAEMON_PID_FILES; do
+    [ -f "$file" ] && kill -HUP $(< $file)
+  done
 }
 
 if [ "$hooks_path" = "instance-add" -o \
-- 
GitLab