Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix dhcp-config.sh locking

* Use >> instead of < because the lock file might not exist.
* Add || exit $? after the subshell, otherwise any error will not be
  caught.
* Close the file descriptor before starting dhcpd, otherwise the
  daemon will keep the lock indefinitely.
  • Loading branch information...
commit 9f09c0d3b5fc4ffacbb8ede877be25d63ffd3f02 1 parent 4c70ae8
Pierre Riteau priteau authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 control/libexec/workspace-control/dhcp-config.sh
10 control/libexec/workspace-control/dhcp-config.sh
View
@@ -299,12 +299,16 @@ if [ "$ADDREM" = "add" ]; then
fi
echo "CMD: $DHCPD_START"
- $DHCPD_START || die_dhcpd_start
+ (
+ # Close the lock file descriptor now, otherwise it stays locked in the
+ # dhcpd process which is daemonized
+ exec 200>&-
+ $DHCPD_START || die_dhcpd_start
+ )
fi
-) 200<$FLOCKFILE
+) 200>>$FLOCKFILE || exit $?
if [ "$SUCCESS" = "n" ]; then
exit 1
fi
-
Please sign in to comment.
Something went wrong with that request. Please try again.