mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
dhcp: use a simple periodic update for now; closes #5876
Gets rid of package dependency which for dhcpleases6 simply listens on the DHCPD lease file and runs the prefix.php command unconditionally. For now emulate this by issuing the command every 60 seconds which can be adjusted later if someone complains, but seeing how many bugs this script has had vs. how many people noticed it (basically none) I doult this will have much impact overall.
This commit is contained in:
parent
5ce587cee8
commit
856574bbef
1
Makefile
1
Makefile
@ -136,7 +136,6 @@ CORE_DEPENDS?= ca_root_nss \
|
||||
choparp \
|
||||
cpustats \
|
||||
dhcp6c \
|
||||
dhcpleases \
|
||||
dnsmasq \
|
||||
dpinger \
|
||||
expiretable \
|
||||
|
||||
1
plist
1
plist
@ -741,6 +741,7 @@
|
||||
/usr/local/opnsense/scripts/dhcp/dnsmasq_watcher.py
|
||||
/usr/local/opnsense/scripts/dhcp/get_leases.py
|
||||
/usr/local/opnsense/scripts/dhcp/prefixes.php
|
||||
/usr/local/opnsense/scripts/dhcp/prefixes.sh
|
||||
/usr/local/opnsense/scripts/dhcp/unbound_watcher.py
|
||||
/usr/local/opnsense/scripts/dns/query_dns.py
|
||||
/usr/local/opnsense/scripts/filter/delete_table.py
|
||||
|
||||
@ -1597,10 +1597,7 @@ EOD;
|
||||
/* fire up dhcpd in a chroot */
|
||||
if (count($dhcpdv6ifs) > 0) {
|
||||
mwexec('/usr/local/sbin/dhcpd -6 -user dhcpd -group dhcpd -chroot /var/dhcpd -cf /etc/dhcpdv6.conf -pf /var/run/dhcpdv6.pid ' . join(' ', $dhcpdv6ifs));
|
||||
mwexecf('/usr/local/sbin/dhcpleases6 -c %s -l %s', array(
|
||||
'/usr/local/sbin/configctl dhcpd update prefixes',
|
||||
'/var/dhcpd/var/db/dhcpd6.leases',
|
||||
));
|
||||
mwexecf('/usr/sbin/daemon -f -p %s %s', ['/var/run/dhcpleases6.pid', '/usr/local/opnsense/scripts/dhcp/prefixes.sh']);
|
||||
}
|
||||
|
||||
if ($verbose) {
|
||||
|
||||
32
src/opnsense/scripts/dhcp/prefixes.sh
Executable file
32
src/opnsense/scripts/dhcp/prefixes.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2022 Franco Fichtner <franco@opnsense.org>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
INTERVAL=${1:-60}
|
||||
|
||||
while :; do
|
||||
sleep "${INTERVAL}"
|
||||
configctl dhcpd update prefixes
|
||||
done
|
||||
Loading…
x
Reference in New Issue
Block a user