diff options
author | Alexandru Moise <alexandru.moise@windriver.com> | 2016-03-18 14:21:25 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-20 23:12:31 +0000 |
commit | 07515b0b697108c6c2d177497dd771ef458e13c0 (patch) | |
tree | 83caae5540d522c085bf8d5d06a3ae6544e04636 /meta/recipes-connectivity/dhcp/files/init-server | |
parent | b9ad80d95e1e3db827b47e9cec42c57fca8c23f1 (diff) | |
download | poky-07515b0b697108c6c2d177497dd771ef458e13c0.tar.gz |
dhcpd: create dhcpd user for dhcp dameon
This patch enables the functionality for dhcpd service to be started
with dhcp uid and gid.
Test steps:
Step 1: Assign ip to interface
ifconfig eth0 192.168.1.1
Step 2: Edit /etc/dhcp/dhcpd.conf:
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
subnet 192.168.1.0 netmask 255.255.255.0 {
option broadcast-address 192.168.1.255;
range 192.168.1.88 192.168.1.88;
option routers 192.168.1.0;
}
Step 3: Edit /etc/default/dhcp-server:
INTERFACES="eth0"
Step 4: Check uid and gid of running dhcpd process
$ ps -eo user:19,group:19,cmd | grep dhcpd
dhcp dhcp /usr/sbin/dhcpd eth0 -user dhcp -group dhcp
(From OE-Core rev: 36d59255131f6d3f289d4f5dfcb58a9890996ffe)
Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/dhcp/files/init-server')
-rw-r--r-- | meta/recipes-connectivity/dhcp/files/init-server | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/dhcp/files/init-server b/meta/recipes-connectivity/dhcp/files/init-server index 34c20852b9..5e693adf78 100644 --- a/meta/recipes-connectivity/dhcp/files/init-server +++ b/meta/recipes-connectivity/dhcp/files/init-server | |||
@@ -20,7 +20,7 @@ case "$1" in | |||
20 | echo -n "Starting DHCP server: " | 20 | echo -n "Starting DHCP server: " |
21 | test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/ | 21 | test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/ |
22 | test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases | 22 | test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases |
23 | start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES | 23 | start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES -user dhcp -group dhcp |
24 | echo "." | 24 | echo "." |
25 | ;; | 25 | ;; |
26 | stop) | 26 | stop) |