Switch aolserver to start using rc.subr in startup script.

Auto-generate pkg-message to avoid hardcoding /usr/local.
This commit is contained in:
Alexander Kabaev 2005-03-01 22:15:34 +00:00
parent de8f2d810c
commit 84e12198e2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=130127
3 changed files with 35 additions and 17 deletions

View file

@ -20,6 +20,10 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
USE_GMAKE= yes USE_GMAKE= yes
USE_RC_SUBR= YES
PKGMESSAGE= ${WRKDIR}/pkg-message
SUB_FILES= pkg-message
INSTALL_TARGET= install INST=${PREFIX}/${PORTNAME} INSTALL_TARGET= install INST=${PREFIX}/${PORTNAME}
post-extract: post-extract:
@ -49,6 +53,6 @@ post-install:
>${PREFIX}/etc/rc.d/aolserver.sh ; \ >${PREFIX}/etc/rc.d/aolserver.sh ; \
${CHMOD} 755 ${PREFIX}/etc/rc.d/aolserver.sh; \ ${CHMOD} 755 ${PREFIX}/etc/rc.d/aolserver.sh; \
fi fi
@${CAT} ${PKGDIR}/pkg-message @${CAT} ${WRKDIR}/pkg-message
.include <bsd.port.mk> .include <bsd.port.mk>

View file

@ -1,21 +1,35 @@
#!/bin/sh #! /bin/sh
#
#
# PROVIDE: aolserver
# REQUIRE: DAEMON NETWORKING SERVERS
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable aolserver:
#
# aolserver_enable="YES"
#
# Tweakable parameters for users to override in rc.conf
PREFIX=%%PREFIX%%/aolserver aolserver_enable=NO
CONFIG=${PREFIX}/nsd.tcl aolserver_home=%%PREFIX%%/aolserver
aolserver_conf=${aolserver_home}/nsd.tcl
aolserver_flags="-t ${aolserver_conf} -u nobody -g nobody"
aolserver_prog=nsd8x
case "$1" in . /etc/rc.subr
start) name=aolserver
${PREFIX}/bin/nsd8x -t ${CONFIG} -u nobody -g nobody rcvar=$(set_rcvar)
;; required_files=${aolserver_conf}
command=${aolserver_home}/bin/${aolserver_prog}
procname=${aolserver_home}/bin/${aolserver_prog}
stop) stop_cmd="stop_cmd"
${PREFIX}/bin/nsd8x -t ${CONFIG} -u nobody -g nobody -K
;;
*) stop_cmd() {
echo "usage: $0 {start|stop}" 1>&2 ${command} ${aolserver_flags} -K
exit 64 }
;;
esac load_rc_config ${name}
run_rc_command "$1"

View file

@ -1,5 +1,5 @@
Assuming you have changed to /usr/local, please copy Assuming you have changed to %%PREFIX%%, please copy
aolserver/sample-config.tcl to aolserver/nsd.tcl and season to taste. aolserver/sample-config.tcl to aolserver/nsd.tcl and season to taste.
An example server is in at aolserver/servers/server1, and you should An example server is in at aolserver/servers/server1, and you should
similarly copy the contents of this directory to, e.g., similarly copy the contents of this directory to, e.g.,