pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/isc-dhcpd4 Add SMF support.
details: https://anonhg.NetBSD.org/pkgsrc/rev/13c9449dbf60
branches: trunk
changeset: 631705:13c9449dbf60
user: jperkin <jperkin%pkgsrc.org@localhost>
date: Wed Mar 12 14:29:31 2014 +0000
description:
Add SMF support.
diffstat:
net/isc-dhcpd4/Makefile | 8 ++++++--
net/isc-dhcpd4/files/smf/isc-dhcpd.sh | 28 ++++++++++++++++++++++++++++
net/isc-dhcpd4/files/smf/manifest.xml | 25 +++++++++++++++++++++++++
3 files changed, 59 insertions(+), 2 deletions(-)
diffs (84 lines):
diff -r afa57b8b6dfc -r 13c9449dbf60 net/isc-dhcpd4/Makefile
--- a/net/isc-dhcpd4/Makefile Wed Mar 12 14:21:25 2014 +0000
+++ b/net/isc-dhcpd4/Makefile Wed Mar 12 14:29:31 2014 +0000
@@ -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 @@
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 -r afa57b8b6dfc -r 13c9449dbf60 net/isc-dhcpd4/files/smf/isc-dhcpd.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/isc-dhcpd4/files/smf/isc-dhcpd.sh Wed Mar 12 14:29:31 2014 +0000
@@ -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 -r afa57b8b6dfc -r 13c9449dbf60 net/isc-dhcpd4/files/smf/manifest.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/isc-dhcpd4/files/smf/manifest.xml Wed Mar 12 14:29:31 2014 +0000
@@ -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>
Home |
Main Index |
Thread Index |
Old Index