summaryrefslogtreecommitdiffstats
path: root/etc/rc.newipsecdns
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-03-16 19:34:01 +0000
committerErmal <eri@pfsense.org>2011-03-16 19:34:01 +0000
commitaf4c040e43f2c2e7bd2701b106fa7bf6aac288cd (patch)
treee5b6d0d002295f5ab0cb78c946c6b0faf5233d82 /etc/rc.newipsecdns
parentab299d4c525bb44521deea91fee232ccc6bc68fd (diff)
downloadpfsense-af4c040e43f2c2e7bd2701b106fa7bf6aac288cd.zip
pfsense-af4c040e43f2c2e7bd2701b106fa7bf6aac288cd.tar.gz
Ticket #1356 use locking here rather than ps to serialize execution.
Diffstat (limited to 'etc/rc.newipsecdns')
-rwxr-xr-xetc/rc.newipsecdns7
1 files changed, 3 insertions, 4 deletions
diff --git a/etc/rc.newipsecdns b/etc/rc.newipsecdns
index 141f04a..2e53f99 100755
--- a/etc/rc.newipsecdns
+++ b/etc/rc.newipsecdns
@@ -43,10 +43,7 @@
while (file_exists("{$g['varrun_path']}/booting")) {
sleep(1);
}
- while(stristr(shell_exec("/bin/ps auxww"), "rc.newipsecdns")) {
- // log_error("There is an existing rc.newipsecdns running, sleeping 1 second");
- sleep(1);
- }
+ $ipseclck = lock('ipsecdns', LOCK_EX);
log_error("IPSEC: One or more IPsec tunnel endpoints has changed its IP. Refreshing.");
/* We will walk the list of hostnames found in the ipsec tunnel
@@ -59,4 +56,6 @@
vpn_ipsec_configure();
filter_configure();
+
+ unlock($ipseclck);
?>
OpenPOWER on IntegriCloud