This repository was archived by the owner on Jan 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 55
66# Support docker run --init parameter which obsoletes the use of dumb-init,
77# but support dumb-init for those that still use it without --init
8- if [ -x " /dev/init" ]; then
9- run=" exec"
10- else
8+ if [ $$ -eq 1 ]; then
119 run=" exec /usr/bin/dumb-init --"
10+ else
11+ run=" exec"
1212fi
1313
1414# Single argument to command line is interface name
@@ -51,12 +51,8 @@ if [ -n "$IFACE" ]; then
5151
5252 uid=$( stat -c%u " $data_dir " )
5353 gid=$( stat -c%g " $data_dir " )
54- if [ $gid -ne 0 ]; then
55- groupmod -g $gid dhcpd
56- fi
57- if [ $uid -ne 0 ]; then
58- usermod -u $uid dhcpd
59- fi
54+ groupmod -og $gid dhcpd
55+ usermod -ou $uid dhcpd
6056
6157 [ -e " $data_dir /dhcpd.leases" ] || touch " $data_dir /dhcpd.leases"
6258 chown dhcpd:dhcpd " $data_dir /dhcpd.leases"
@@ -69,7 +65,7 @@ if [ -n "$IFACE" ]; then
6965 echo " You must add the 'docker run' option '--net=host' if you want to provide DHCP service to the host network."
7066 fi
7167
72- $run /usr/sbin/dhcpd -$DHCPD_PROTOCOL -f -d --no-pid -cf " $data_dir /dhcpd.conf" -lf " $data_dir /dhcpd.leases" $IFACE
68+ $run /usr/sbin/dhcpd -$DHCPD_PROTOCOL -f -d --no-pid -cf " $data_dir /dhcpd.conf" -lf " $data_dir /dhcpd.leases" -user dhcpd -group dhcpd $IFACE
7369else
7470 # Run another binary
7571 $run " $@ "
You can’t perform that action at this time.
0 commit comments