We no longer use /var/run/config.lock - catch up to other progress. Also, use lockf to test if the config is locked now, with a 30 second timeout.
This commit is contained in:
parent
311f93cd14
commit
7201ca277e
|
@ -491,7 +491,6 @@ pfSenseupgrade)
|
|||
if [ -f /tmp/no_upgrade_reboot_required ]; then
|
||||
rm /tmp/no_upgrade_reboot_required
|
||||
else
|
||||
rm -f /var/run/config.lock
|
||||
sh /etc/rc.reboot
|
||||
fi
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
# $Id$
|
||||
|
||||
if [ -f /var/run/config.lock ]; then
|
||||
echo "Cannot reboot at this moment, a config write operation is in progress."
|
||||
if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
|
||||
echo "Cannot halt at this moment, a config write operation is in progress and 30 seconds have passed."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
# $Id$
|
||||
|
||||
if [ -f /var/run/config.lock ]; then
|
||||
echo "Cannot reboot at this moment, a config write operation is in progress."
|
||||
exit -1
|
||||
if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
|
||||
echo "Cannot reboot at this moment, a config write operation is in progress, and 30 seconds have passed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -f /var/run/config.lock ]; then
|
||||
echo "Cannot reboot at this moment, a config write operation is in progress."
|
||||
if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
|
||||
echo "Cannot shutdown at this moment, a config write operation is in progress and 30 seconds have passed."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
touch /var/run/config.lock
|
||||
/etc/rc.conf_mount_rw
|
||||
|
||||
KERNELTYPE=`cat /boot/kernel/pfsense_kernel.txt`
|
||||
|
|
Reference in New Issue