diff options
author | jperkin <jperkin@pkgsrc.org> | 2014-03-12 14:29:31 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2014-03-12 14:29:31 +0000 |
commit | b8918a6fa965ac554a0fa67f04b7697f30f8cb29 (patch) | |
tree | 278033449ef6e336dd3b9dd910835adcad48cb02 /net | |
parent | 2207dfe107cee436015d4ec5b10d2ca7b35ab25c (diff) | |
download | pkgsrc-b8918a6fa965ac554a0fa67f04b7697f30f8cb29.tar.gz |
Add SMF support.
Diffstat (limited to 'net')
-rw-r--r-- | net/isc-dhcpd4/Makefile | 8 | ||||
-rwxr-xr-x | net/isc-dhcpd4/files/smf/isc-dhcpd.sh | 28 | ||||
-rw-r--r-- | net/isc-dhcpd4/files/smf/manifest.xml | 25 |
3 files changed, 59 insertions, 2 deletions
diff --git a/net/isc-dhcpd4/Makefile b/net/isc-dhcpd4/Makefile index 48ea6a6ff17..465e3b7fc48 100644 --- a/net/isc-dhcpd4/Makefile +++ b/net/isc-dhcpd4/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.11 2014/02/12 23:18:21 tron Exp $ +# $NetBSD: Makefile,v 1.12 2014/03/12 14:29:31 jperkin Exp $ PKGNAME= isc-dhcpd-${DHVER} PKGREVISION= 1 @@ -8,8 +8,12 @@ SUBDIR= omapip dhcpctl server CONF_FILES+= ${EGDIR}/dhcpd.conf ${PKG_SYSCONFDIR}/dhcpd.conf #CONF_FILES+= ${EGDIR}/dhcpd6.conf ${PKG_SYSCONFDIR}/dhcpd6.conf + RCD_SCRIPTS= isc_dhcpd isc_dhcpd6 -FILES_SUBST+= DHCP_HOME=${DHCP_HOME} +SMF_METHODS= isc-dhcpd + +FILES_SUBST+= DHCP_HOME=${DHCP_HOME:Q} +FILES_SUBST+= DHCP_PID=${DHCP_PID:Q} .include "${.CURDIR}/../isc-dhcp4/options.mk" diff --git a/net/isc-dhcpd4/files/smf/isc-dhcpd.sh b/net/isc-dhcpd4/files/smf/isc-dhcpd.sh new file mode 100755 index 00000000000..a17f62c370c --- /dev/null +++ b/net/isc-dhcpd4/files/smf/isc-dhcpd.sh @@ -0,0 +1,28 @@ +#!@SMF_METHOD_SHELL@ +# +# $NetBSD: isc-dhcpd.sh,v 1.1 2014/03/12 14:29:31 jperkin Exp $ +# +# Init script for isc-dhcpd. +# + +case "$1" in +start) + if [ ! -d @DHCP_HOME@ ]; then + mkdir -p @DHCP_HOME@ + touch @DHCP_HOME@/dhcpd.leases + chmod 0640 @DHCP_HOME@/dhcpd.leases + fi + mkdir -p @DHCP_PID@ + chmod 0770 @DHCP_PID@ + @PREFIX@/sbin/dhcpd + ;; +stop) + if [ -s @DHCP_PID@/isc-dhcpd.pid ]; then + kill `cat @DHCP_PID@/isc-dhcpd.pid` + fi + ;; +refresh) + $0 stop + $0 start + ;; +esac diff --git a/net/isc-dhcpd4/files/smf/manifest.xml b/net/isc-dhcpd4/files/smf/manifest.xml new file mode 100644 index 00000000000..0a6b609bae2 --- /dev/null +++ b/net/isc-dhcpd4/files/smf/manifest.xml @@ -0,0 +1,25 @@ +<?xml version='1.0'?> +<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> +<service_bundle type='manifest' name='@SMF_NAME@'> + <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'> + <create_default_instance enabled='false' /> + <single_instance /> + <dependency name='network' grouping='require_all' restart_on='error' type='service'> + <service_fmri value='svc:/milestone/network:default' /> + </dependency> + <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'> + <service_fmri value='svc:/system/filesystem/local:default' /> + </dependency> + <method_context> + <method_credential user='root' group='root' /> + </method_context> + <exec_method type='method' name='start' exec='@PREFIX@/@SMF_METHOD_FILE.isc-dhcpd@ start' timeout_seconds='30' /> + <exec_method type='method' name='stop' exec='@PREFIX@/@SMF_METHOD_FILE.isc-dhcpd@ stop' timeout_seconds='30' /> + <exec_method type='method' name='refresh' exec='@PREFIX@/@SMF_METHOD_FILE.isc-dhcpd@ refresh' timeout_seconds='30' /> + <template> + <common_name> + <loctext xml:lang='C'>ISC DHCP Server</loctext> + </common_name> + </template> + </service> +</service_bundle> |