Fix race condition in dnsmasq config dir handling
This commit is contained in:
parent
6d5e47eeec
commit
bb4a9fd5af
8
package/gluon-core/files/etc/init.d/gluon-core
Executable file
8
package/gluon-core/files/etc/init.d/gluon-core
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=11
|
||||||
|
|
||||||
|
|
||||||
|
start() {
|
||||||
|
mkdir -p /var/gluon/dnsmasq.d
|
||||||
|
}
|
@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo 'conf-dir=/lib/gluon/dnsmasq.d' > /etc/dnsmasq.conf
|
echo -e 'conf-dir=/lib/gluon/dnsmasq.d\nconf-dir=/var/gluon/dnsmasq.d' > /etc/dnsmasq.conf
|
||||||
|
@ -1 +0,0 @@
|
|||||||
/var/gluon/mesh-batman-adv/dnsmasq.conf
|
|
@ -10,12 +10,12 @@ for ns in $RDNSS $RA_DNS; do
|
|||||||
done
|
done
|
||||||
done > /var/gluon/mesh-batman-adv/dnsmasq.conf.$$
|
done > /var/gluon/mesh-batman-adv/dnsmasq.conf.$$
|
||||||
|
|
||||||
if cmp -s /var/gluon/mesh-batman-adv/dnsmasq.conf.$$ /var/gluon/mesh-batman-adv/dnsmasq.conf; then
|
if cmp -s /var/gluon/mesh-batman-adv/dnsmasq.conf.$$ /var/gluon/dnsmasq.d/mesh-batman-adv.conf; then
|
||||||
rm /var/gluon/mesh-batman-adv/dnsmasq.conf.$$
|
rm /var/gluon/mesh-batman-adv/dnsmasq.conf.$$
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lock /var/gluon/mesh-batman-adv/dnsmasq.conf.lock
|
lock /var/gluon/mesh-batman-adv/dnsmasq.conf.lock
|
||||||
mv -f /var/gluon/mesh-batman-adv/dnsmasq.conf.$$ /var/gluon/mesh-batman-adv/dnsmasq.conf
|
mv -f /var/gluon/mesh-batman-adv/dnsmasq.conf.$$ /var/gluon/dnsmasq.d/mesh-batman-adv.conf
|
||||||
/etc/init.d/dnsmasq restart
|
/etc/init.d/dnsmasq restart
|
||||||
lock -u /var/gluon/mesh-batman-adv/dnsmasq.conf.lock
|
lock -u /var/gluon/mesh-batman-adv/dnsmasq.conf.lock
|
||||||
|
Loading…
Reference in New Issue
Block a user