summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/dhcp
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2014-06-15 21:38:37 -0400
committerXin Ouyang <xin.ouyang@windriver.com>2014-06-23 11:49:21 +0800
commitf210f90cc84752c6066153f5a24f1cd6b2d45502 (patch)
tree729e1bd16fc3713c5ec8407c4d72559ffe960360 /recipes-connectivity/dhcp
parent073ce40add07c4a3ad4496c5253a37a162434d61 (diff)
downloadmeta-selinux-f210f90cc84752c6066153f5a24f1cd6b2d45502.tar.gz
dhcp: make a copy of init-server
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
Diffstat (limited to 'recipes-connectivity/dhcp')
-rw-r--r--recipes-connectivity/dhcp/dhcp_4.3.0.bbappend3
-rw-r--r--recipes-connectivity/dhcp/files/init-server44
2 files changed, 47 insertions, 0 deletions
diff --git a/recipes-connectivity/dhcp/dhcp_4.3.0.bbappend b/recipes-connectivity/dhcp/dhcp_4.3.0.bbappend
new file mode 100644
index 0000000..900c2aa
--- /dev/null
+++ b/recipes-connectivity/dhcp/dhcp_4.3.0.bbappend
@@ -0,0 +1,3 @@
1inherit with-selinux
2
3FILESEXTRAPATHS_prepend := "${@target_selinux(d, '${THISDIR}/files:')}"
diff --git a/recipes-connectivity/dhcp/files/init-server b/recipes-connectivity/dhcp/files/init-server
new file mode 100644
index 0000000..34c2085
--- /dev/null
+++ b/recipes-connectivity/dhcp/files/init-server
@@ -0,0 +1,44 @@
1#!/bin/sh
2#
3# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
4#
5
6test -f /usr/sbin/dhcpd || exit 0
7
8# It is not safe to start if we don't have a default configuration...
9if [ ! -f /etc/default/dhcp-server ]; then
10 echo "/etc/default/dhcp-server does not exist! - Aborting..."
11 exit 0
12fi
13
14# Read init script configuration (so far only interfaces the daemon
15# should listen on.)
16. /etc/default/dhcp-server
17
18case "$1" in
19 start)
20 echo -n "Starting DHCP server: "
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
23 start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES
24 echo "."
25 ;;
26 stop)
27 echo -n "Stopping DHCP server: dhcpd3"
28 start-stop-daemon -K -x /usr/sbin/dhcpd
29 echo "."
30 ;;
31 restart | force-reload)
32 $0 stop
33 sleep 2
34 $0 start
35 if [ "$?" != "0" ]; then
36 exit 1
37 fi
38 ;;
39 *)
40 echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
41 exit 1
42esac
43
44exit 0