summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNewEraCracker <neweracracker@gmail.com>2016-08-14 19:08:58 +0100
committerRenato Botelho <renato@netgate.com>2016-09-02 08:54:59 -0300
commit02809cc60285c3e6ff4f3c6e338be91981083310 (patch)
tree9780cf405c3ec81fbefbcfa4db320b91ee042526 /src
parent8402a8de579e3cd69761bcf7b900963b29f0c87e (diff)
downloadpfsense-02809cc60285c3e6ff4f3c6e338be91981083310.zip
pfsense-02809cc60285c3e6ff4f3c6e338be91981083310.tar.gz
Ensure only one instance of services_dhcpd_configure runs concurrently
This way kill and respawn will behave as they should for the dhcpd processes (cherry picked from commit c69ea0051c5549a9db0d092e85b92f78ffb4c978)
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/services.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index 308cecb..ab7a5b3 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -427,6 +427,8 @@ function services_radvd_configure($blacklist = array()) {
function services_dhcpd_configure($family = "all", $blacklist = array()) {
global $config, $g;
+ $dhcpdconfigurelck = lock("dhcpdconfigure", LOCK_EX);
+
/* configure DHCPD chroot once */
$fd = fopen("{$g['tmp_path']}/dhcpd.sh", "w");
fwrite($fd, "/bin/mkdir -p {$g['dhcpd_chroot_path']}\n");
@@ -457,6 +459,8 @@ function services_dhcpd_configure($family = "all", $blacklist = array()) {
services_dhcpdv6_configure($blacklist);
services_radvd_configure($blacklist);
}
+
+ unlock($dhcpdconfigurelck);
}
function services_dhcpdv4_configure() {
OpenPOWER on IntegriCloud