diff options
author | jim-p <jimp@pfsense.org> | 2011-01-12 14:23:39 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-01-12 14:26:35 -0500 |
commit | 7201ca277ed66540baea26ff26ea339ceb15ac9b (patch) | |
tree | a8f6f8bf2fb5be0e216fc9ccd5c624bd9fc619f2 | |
parent | 311f93cd141d69536eb4fafa4e0068f6343252e3 (diff) | |
download | pfsense-7201ca277ed66540baea26ff26ea339ceb15ac9b.zip pfsense-7201ca277ed66540baea26ff26ea339ceb15ac9b.tar.gz |
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.
-rwxr-xr-x | etc/rc.firmware | 1 | ||||
-rwxr-xr-x | etc/rc.halt | 4 | ||||
-rwxr-xr-x | etc/rc.reboot | 6 | ||||
-rwxr-xr-x | etc/rc.shutdown | 4 | ||||
-rwxr-xr-x | tmp/post_upgrade_command | 1 |
5 files changed, 7 insertions, 9 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index b10737e..063e9a3 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -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 diff --git a/etc/rc.halt b/etc/rc.halt index 4f3d1ef..fd6318b 100755 --- a/etc/rc.halt +++ b/etc/rc.halt @@ -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 diff --git a/etc/rc.reboot b/etc/rc.reboot index 851f1a8..4bb28a1 100755 --- a/etc/rc.reboot +++ b/etc/rc.reboot @@ -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 diff --git a/etc/rc.shutdown b/etc/rc.shutdown index 257a577..9d46ad2 100755 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -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 diff --git a/tmp/post_upgrade_command b/tmp/post_upgrade_command index a2fb94e..ed49d0a 100755 --- a/tmp/post_upgrade_command +++ b/tmp/post_upgrade_command @@ -1,6 +1,5 @@ #!/bin/sh -touch /var/run/config.lock /etc/rc.conf_mount_rw KERNELTYPE=`cat /boot/kernel/pfsense_kernel.txt` |