diff options
author | jylefort <jylefort@FreeBSD.org> | 2005-05-14 19:12:15 +0800 |
---|---|---|
committer | jylefort <jylefort@FreeBSD.org> | 2005-05-14 19:12:15 +0800 |
commit | d3be373ab1d2fb3720e41ef9faf4fb85de7d90f0 (patch) | |
tree | 840febecbe209a2bdc4b1d7d00c63afa4518ebec | |
parent | d3acd9a55ec12c95811b9325dff0e097bff3864f (diff) | |
download | freebsd-ports-gnome-d3be373ab1d2fb3720e41ef9faf4fb85de7d90f0.tar.gz freebsd-ports-gnome-d3be373ab1d2fb3720e41ef9faf4fb85de7d90f0.tar.zst freebsd-ports-gnome-d3be373ab1d2fb3720e41ef9faf4fb85de7d90f0.zip |
Add spreadlogd.
If you kill -HUP or kill the spreadlogd process, it will not actually process
the signal until after it has received its next message from Spread. You can
move you log files to new names and then kill -HUP and it will reopen the log
files. This is useful for seamless log rotation without losing any messages.
Spread is really cool. It is a poweful group communication toolkit developed
at the Center for Networking and Distributed Systems at the Johns Hopkins
University (http://www.spread.org/ and http://www.cnds.jhu.edu/, respectively).
WWW: http://www.lethargy.org/mod_log_spread/
PR: ports/80877
Submitted by: Meno Abels <meno.abels@adviser.com>
-rw-r--r-- | www/Makefile | 1 | ||||
-rw-r--r-- | www/spreadlogd/Makefile | 43 | ||||
-rw-r--r-- | www/spreadlogd/distinfo | 2 | ||||
-rw-r--r-- | www/spreadlogd/files/patch-config.h | 14 | ||||
-rw-r--r-- | www/spreadlogd/files/patch-makefile | 36 | ||||
-rw-r--r-- | www/spreadlogd/files/patch-spreadlogd.c | 47 | ||||
-rw-r--r-- | www/spreadlogd/files/spreadlogd.sh.in | 33 | ||||
-rw-r--r-- | www/spreadlogd/pkg-descr | 10 |
8 files changed, 186 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index cd40d0326eab..e28019e7a42b 100644 --- a/www/Makefile +++ b/www/Makefile @@ -707,6 +707,7 @@ SUBDIR += smb_auth SUBDIR += snarf SUBDIR += snownews + SUBDIR += spreadlogd SUBDIR += squid SUBDIR += squidclients SUBDIR += squidguard diff --git a/www/spreadlogd/Makefile b/www/spreadlogd/Makefile new file mode 100644 index 000000000000..40a73f833e62 --- /dev/null +++ b/www/spreadlogd/Makefile @@ -0,0 +1,43 @@ +# New ports collection makefile for: spreadlogd +# Date created: 08 May 2005 +# Whom: Meno Abels <meno.abels@adviser.com> +# +# $FreeBSD$ +# + +PORTNAME= spreadlogd +PORTVERSION= 1.4.2 +CATEGORIES= www net +MASTER_SITES= http://www.lethargy.org/mod_log_spread/ + +MAINTAINER= meno.abels@adviser.com +COMMENT= The backend of mod_log_spread + +LIB_DEPENDS= spread.1:${PORTSDIR}/net/spread + +MAKEFILE= makefile +USE_REINPLACE= yes + +USE_RC_SUBR= spreadlogd.sh +SUB_FILES= spreadlogd.sh + +PLIST_FILES= sbin/spreadlogd etc/spreadlogd.conf.sample + +.if !defined(NOPORTDOCS) +PORTDOCS= README Artistic.txt +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|' ${WRKSRC}/spreadlogd.c + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/spreadlogd ${PREFIX}/sbin + ${INSTALL} ${WRKSRC}/spreadlogd.conf ${PREFIX}/etc/spreadlogd.conf.sample +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +.for f in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} +.endfor +.endif + +.include <bsd.port.mk> diff --git a/www/spreadlogd/distinfo b/www/spreadlogd/distinfo new file mode 100644 index 000000000000..8df0ef9539aa --- /dev/null +++ b/www/spreadlogd/distinfo @@ -0,0 +1,2 @@ +MD5 (spreadlogd-1.4.2.tar.gz) = 220651bcc124b1be2786401d0eab45ab +SIZE (spreadlogd-1.4.2.tar.gz) = 17072 diff --git a/www/spreadlogd/files/patch-config.h b/www/spreadlogd/files/patch-config.h new file mode 100644 index 000000000000..182e3a9e9cca --- /dev/null +++ b/www/spreadlogd/files/patch-config.h @@ -0,0 +1,14 @@ +--- config.h.orig Mon Jan 1 19:08:46 2001 ++++ config.h Sat May 14 13:00:50 2005 +@@ -11,9 +11,10 @@ + #ifndef _CONFIG_H_ + #define _CONFIG_H_ + ++#include <stdio.h> + #include <stdlib.h> + #include <sys/file.h> +-#include <regex.h> ++#include <gnuregex.h> + #include <sp.h> + + #include "hash.h" diff --git a/www/spreadlogd/files/patch-makefile b/www/spreadlogd/files/patch-makefile new file mode 100644 index 000000000000..b1f2cae47c07 --- /dev/null +++ b/www/spreadlogd/files/patch-makefile @@ -0,0 +1,36 @@ +--- makefile.orig Mon Nov 13 02:43:19 2000 ++++ makefile Sat May 14 12:50:07 2005 +@@ -1,11 +1,9 @@ +-CC=gcc +-CFLAGS=-g -D__USE_LARGEFILE64 -Wall +-INCLUDES=-I/usr/local/include ++INCLUDES=-I${LOCALBASE}/include + + #### BEGIN ARCH DEPENDANT SECTION #### +-# For Linux +-LDFLAGS=-L/usr/local/lib -L. +-LIBS=-lsp -lskiplist ++# For FreeBSD ++LDFLAGS=-L${LOCALBASE}/lib -L. ++LIBS=-lskiplist -lgnuregex -lspread + + # For Solaris + #LIBS=-lsp -lskiplist -lnsl -lsocket -lucb +@@ -13,7 +11,7 @@ + #BSDINCLUDES=-I/usr/ucbinclude + #### END ARCH DEPENDANT SECTION #### + +-YACC=bison -y ++YACC=yacc + LEX=flex + + OBJS=spreadlogd.o lex.yy.o y.tab.o config.o hash.o timefuncs.o +@@ -46,7 +44,7 @@ + $(AR) cq libskiplist.a $(LSLOBJS) + + spreadlogd: libskiplist.a $(OBJS) +- $(CC) -g -o $@ $(OBJS) $(LDFLAGS) $(LIBS) ++ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) + + clean: + rm -f *~ *.o spreadlogd libskiplist.a y.tab.h y.tab.c lex.yy.c diff --git a/www/spreadlogd/files/patch-spreadlogd.c b/www/spreadlogd/files/patch-spreadlogd.c new file mode 100644 index 000000000000..79bc81469d34 --- /dev/null +++ b/www/spreadlogd/files/patch-spreadlogd.c @@ -0,0 +1,47 @@ +--- spreadlogd.c.orig Tue Jul 3 22:09:48 2001 ++++ spreadlogd.c Sat May 14 12:47:05 2005 +@@ -114,9 +114,15 @@ + } + } + void daemonize(void) { ++ FILE *fd; ++ char buf[16]; + if(fork()!=0) exit(0); + setsid(); + if(fork()!=0) exit(0); ++ fd = fopen("/var/run/spreadlogd.pid", "w"); ++ sprintf(buf, "%d", getpid()); ++ fputs(buf, fd); ++ fclose(fd); + } + int getnropen(void) { + struct rlimit rlim; +@@ -127,9 +133,6 @@ + } + + int main(int argc, char **argv) { +-#ifdef SPREAD_VERSION +- int mver, miver, pver; +-#endif + char *configfile = default_configfile; + char *message; + int getoption, debug = 0; +@@ -137,7 +140,8 @@ + sigset_t ourmask; + nr_open = getnropen(); + +- fdsetsize = getdtablesize(); ++ fdsetsize = 512; /* getdtablesize(); ugly fix for freebsd but the select fdset ++ is not as big as dtablesize returns so we receive some cores MENO */ + fds = (SpreadConfiguration **)malloc(sizeof(SpreadConfiguration *)* + fdsetsize); + memset(fds, 0, sizeof(SpreadConfiguration *)*fdsetsize); +@@ -182,7 +186,7 @@ + buffsize); + } + +- if(!debug) daemonize(); ++ if(!debug) { daemonize(); } + + /* Set up HUP signal */ + signalaction.sa_handler = sig_handler; diff --git a/www/spreadlogd/files/spreadlogd.sh.in b/www/spreadlogd/files/spreadlogd.sh.in new file mode 100644 index 000000000000..5f00ca1a1539 --- /dev/null +++ b/www/spreadlogd/files/spreadlogd.sh.in @@ -0,0 +1,33 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: spreadlogd +# REQUIRE: spread +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable spread: +# +#spreadlogd_enable="YES" +# +# + +. %%RC_SUBR%% + +name=spreadlogd +rcvar=`set_rcvar` + +command="%%PREFIX%%/sbin/spreadlogd" +command_args="" +pidfile=/var/run/${name}.pid +required_files=%%PREFIX%%/etc/${name}.conf + +# set defaults + +spreadlogd_enable=${spreadlogd_enable:-"NO"} +spreadlogd_flags=${spreadlogd_flags:-""} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/www/spreadlogd/pkg-descr b/www/spreadlogd/pkg-descr new file mode 100644 index 000000000000..4949f01b6d23 --- /dev/null +++ b/www/spreadlogd/pkg-descr @@ -0,0 +1,10 @@ +If you kill -HUP or kill the spreadlogd process, it will not actually process +the signal until after it has received its next message from Spread. You can +move you log files to new names and then kill -HUP and it will reopen the log +files. This is useful for seamless log rotation without losing any messages. + +Spread is really cool. It is a poweful group communication toolkit developed +at the Center for Networking and Distributed Systems at the Johns Hopkins +University (http://www.spread.org/ and http://www.cnds.jhu.edu/, respectively). + +WWW: http://www.lethargy.org/mod_log_spread/ |