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:
jim-p 2011-01-12 14:23:39 -05:00
parent 311f93cd14
commit 7201ca277e
5 changed files with 7 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,5 @@
#!/bin/sh
touch /var/run/config.lock
/etc/rc.conf_mount_rw
KERNELTYPE=`cat /boot/kernel/pfsense_kernel.txt`