summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.firmware1
-rwxr-xr-xetc/rc.halt4
-rwxr-xr-xetc/rc.reboot6
-rwxr-xr-xetc/rc.shutdown4
4 files changed, 7 insertions, 8 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
OpenPOWER on IntegriCloud