FreeBSD Bugzilla – Attachment 37212 Details for
Bug 59339
[PATCH] net/balance: rc.subr(8) script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
balance.patch
balance.patch (text/plain), 3.16 KB, created by
Oliver Eikemeier
on 2003-11-16 16:00:38 UTC
(
hide
)
Description:
balance.patch
Filename:
MIME Type:
Creator:
Oliver Eikemeier
Created:
2003-11-16 16:00:38 UTC
Size:
3.16 KB
patch
obsolete
>Index: net/balance/Makefile >=================================================================== >RCS file: /home/ncvs/ports/net/balance/Makefile,v >retrieving revision 1.8 >diff -u -r1.8 Makefile >--- net/balance/Makefile 4 Nov 2003 20:11:47 -0000 1.8 >+++ net/balance/Makefile 7 Nov 2003 12:30:17 -0000 >@@ -17,14 +17,21 @@ > ALL_TARGET= balance > USE_REINPLACE= yes > >+USE_RC_SUBR= yes >+ > MAN1= balance.1 > > post-patch: > ${REINPLACE_CMD} -e 's|^CFLAGS|#CFLAGS|g ; \ > s|^CC|#CC|g' ${WRKSRC}/Makefile > >+post-build: >+ @${SED} -e 's,%%RC_SUBR%%,${RC_SUBR},g' -e 's,%%PREFIX%%,${PREFIX},g' \ >+ ${FILESDIR}/${PORTNAME}.sh >${WRKDIR}/${PORTNAME}.sh >+ > do-install: >- ${INSTALL_PROGRAM} ${WRKSRC}/balance ${PREFIX}/bin >- ${INSTALL_MAN} ${WRKSRC}/balance.1 ${PREFIX}/man/man1 >+ @${INSTALL_PROGRAM} ${WRKSRC}/balance ${PREFIX}/bin >+ @${INSTALL_MAN} ${WRKSRC}/balance.1 ${PREFIX}/man/man1 >+ @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${PREFIX}/etc/rc.d/${PORTNAME}.sh > > .include <bsd.port.mk> >Index: net/balance/pkg-plist >=================================================================== >RCS file: /home/ncvs/ports/net/balance/pkg-plist,v >retrieving revision 1.1 >diff -u -r1.1 pkg-plist >--- net/balance/pkg-plist 19 Dec 2000 12:17:21 -0000 1.1 >+++ net/balance/pkg-plist 4 Nov 2003 20:09:14 -0000 >@@ -1 +1,2 @@ > bin/balance >+etc/rc.d/balance.sh >Index: net/balance/files/balance.sh >=================================================================== >RCS file: net/balance/files/balance.sh >diff -N net/balance/files/balance.sh >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ net/balance/files/balance.sh 4 Nov 2003 20:10:21 -0000 >@@ -0,0 +1,79 @@ >+#!/bin/sh >+# >+# $FreeBSD$ >+# >+ >+# PROVIDE: balance >+# REQUIRE: LOGIN >+# KEYWORD: FreeBSD shutdown >+ >+# >+# Add the following lines to /etc/rc.conf to enable balance: >+# >+#balance_enable="YES" >+#balance_hosts="host1" >+#balance_host1_adress="host1.external.example" >+#balance_host1_ports="http 8180" >+#balance_host1_targets="host1.internal.example" >+# >+# See balance(8) for flags >+# >+ >+. %%RC_SUBR%% >+ >+name=balance >+rcvar=`set_rcvar` >+command=%%PREFIX%%/bin/balance >+ >+start_cmd=start_cmd >+stop_cmd=stop_cmd >+status_cmd=status_cmd >+ >+start_cmd() >+{ >+ if [ -x "${command}" ]; then >+ for host in ${balance_hosts}; do >+ eval ports=\"\${balance_${host}_ports}\" >+ eval adress=\"\${balance_${host}_adress}\" >+ eval targets=\"\${balance_${host}_targets}\" >+ for port in ${ports}; do >+ "${command}" -b ${adress} ${port} ${targets} >+ done >+ done >+ fi >+} >+ >+stop_cmd() >+{ >+ if [ -x "${command}" ]; then >+ for host in ${balance_hosts}; do >+ eval ports=\"\${balance_${host}_ports}\" >+ eval adress=\"\${balance_${host}_adress}\" >+ for port in ${ports}; do >+ echo "balance at ${adress}:${port}" >+ "${command}" -b ${adress} -c kill ${port} >+ done >+ done >+ fi >+} >+ >+status_cmd() >+{ >+ if [ -x "${command}" ]; then >+ for host in ${balance_hosts}; do >+ eval ports=\"\${balance_${host}_ports}\" >+ eval adress=\"\${balance_${host}_adress}\" >+ for port in ${ports}; do >+ echo "balance at ${adress}:${port}" >+ "${command}" -b ${adress} -c show ${port} >+ done >+ done >+ fi >+} >+ >+# set defaults >+ >+balance_enable=${balance_enable:-"NO"} >+ >+load_rc_config $name >+run_rc_command "$1"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 59339
: 37212