diff options
author | kan <kan@FreeBSD.org> | 2005-03-02 06:15:34 +0800 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2005-03-02 06:15:34 +0800 |
commit | e040ccffb9cf413a4016746d1954dc38ae6cd8d9 (patch) | |
tree | 8628e70c494874674c86b31b508b7b17c600d06a | |
parent | 388d8771ca13696daa3083beb5716aed91eac7a1 (diff) | |
download | freebsd-ports-graphics-e040ccffb9cf413a4016746d1954dc38ae6cd8d9.tar.gz freebsd-ports-graphics-e040ccffb9cf413a4016746d1954dc38ae6cd8d9.tar.zst freebsd-ports-graphics-e040ccffb9cf413a4016746d1954dc38ae6cd8d9.zip |
Switch aolserver to start using rc.subr in startup script.
Auto-generate pkg-message to avoid hardcoding /usr/local.
-rw-r--r-- | www/aolserver/Makefile | 6 | ||||
-rw-r--r-- | www/aolserver/files/aolserver.sh | 44 | ||||
-rw-r--r-- | www/aolserver/files/pkg-message.in (renamed from www/aolserver/pkg-message) | 2 |
3 files changed, 35 insertions, 17 deletions
diff --git a/www/aolserver/Makefile b/www/aolserver/Makefile index d359c612bac..b87ff4e0f33 100644 --- a/www/aolserver/Makefile +++ b/www/aolserver/Makefile @@ -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> diff --git a/www/aolserver/files/aolserver.sh b/www/aolserver/files/aolserver.sh index 2f9a840bb11..834d58fff00 100644 --- a/www/aolserver/files/aolserver.sh +++ b/www/aolserver/files/aolserver.sh @@ -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" diff --git a/www/aolserver/pkg-message b/www/aolserver/files/pkg-message.in index 5560d868c81..0343be321be 100644 --- a/www/aolserver/pkg-message +++ b/www/aolserver/files/pkg-message.in @@ -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., |