mirror of
https://git.freebsd.org/ports.git
synced 2025-06-05 12:56:28 -04:00
Switch aolserver to start using rc.subr in startup script.
Auto-generate pkg-message to avoid hardcoding /usr/local.
This commit is contained in:
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
|
@ -20,6 +20,10 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
|||
|
||||
USE_GMAKE= yes
|
||||
|
||||
USE_RC_SUBR= YES
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
INSTALL_TARGET= install INST=${PREFIX}/${PORTNAME}
|
||||
|
||||
post-extract:
|
||||
|
@ -49,6 +53,6 @@ post-install:
|
|||
>${PREFIX}/etc/rc.d/aolserver.sh ; \
|
||||
${CHMOD} 755 ${PREFIX}/etc/rc.d/aolserver.sh; \
|
||||
fi
|
||||
@${CAT} ${PKGDIR}/pkg-message
|
||||
@${CAT} ${WRKDIR}/pkg-message
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -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
|
||||
CONFIG=${PREFIX}/nsd.tcl
|
||||
aolserver_enable=NO
|
||||
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)
|
||||
${PREFIX}/bin/nsd8x -t ${CONFIG} -u nobody -g nobody
|
||||
;;
|
||||
name=aolserver
|
||||
rcvar=$(set_rcvar)
|
||||
required_files=${aolserver_conf}
|
||||
command=${aolserver_home}/bin/${aolserver_prog}
|
||||
procname=${aolserver_home}/bin/${aolserver_prog}
|
||||
|
||||
stop)
|
||||
${PREFIX}/bin/nsd8x -t ${CONFIG} -u nobody -g nobody -K
|
||||
;;
|
||||
stop_cmd="stop_cmd"
|
||||
|
||||
*)
|
||||
echo "usage: $0 {start|stop}" 1>&2
|
||||
exit 64
|
||||
;;
|
||||
stop_cmd() {
|
||||
${command} ${aolserver_flags} -K
|
||||
}
|
||||
|
||||
esac
|
||||
load_rc_config ${name}
|
||||
run_rc_command "$1"
|
||||
|
|
|
@ -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.
|
||||
An example server is in at aolserver/servers/server1, and you should
|
||||
similarly copy the contents of this directory to, e.g.,
|
Loading…
Add table
Reference in a new issue