Skip to content

Commit

Permalink
Merge pull request #1 from mrazzoli-elemento/patch-1
Browse files Browse the repository at this point in the history
workaround for usermod's unreliable behaviour in container
  • Loading branch information
fvalle1 authored Dec 17, 2024
2 parents 6561340 + 4e98517 commit 6f9128f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions util/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e


# Support docker run --init parameter which obsoletes the use of dumb-init,
# but support dumb-init for those that still use it without --init
if [ $$ -eq 1 ]; then
Expand Down Expand Up @@ -52,8 +51,8 @@ if [ -n "$IFACE" ]; then
uid=$(stat -c%u "$data_dir")
gid=$(stat -c%g "$data_dir")
groupmod -og $gid dhcpd
usermod -ou $uid dhcpd

usermod -ou $uid dhcpd || usermod -ou $uid dhcpd # first attempt could fail, see https://github.com/cytopia/devilbox/issues/703#issuecomment-727190879
[ -e "$data_dir/dhcpd.leases" ] || touch "$data_dir/dhcpd.leases"
chown dhcpd:dhcpd "$data_dir/dhcpd.leases"
if [ -e "$data_dir/dhcpd.leases~" ]; then
Expand Down

0 comments on commit 6f9128f

Please sign in to comment.