Copy syslog-ng 3.4.3 to default port. 3.4.3 is production ready.

Submitted by:	Peter Czanik <czanik@balabit.hu> (syslog-ng upline)
This commit is contained in:
Cy Schubert 2013-08-14 15:37:28 +00:00
parent 4f89de58f2
commit 6c89eeceee
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=324734
7 changed files with 582 additions and 0 deletions

162
sysutils/syslog-ng/Makefile Normal file
View File

@ -0,0 +1,162 @@
# Created by: Ivan Lago <ivan.lago@ifom-ieo-campus.it>
# $FreeBSD$
PORTNAME= syslog-ng
PORTVERSION= 3.4.3
CATEGORIES= sysutils
PKGNAMESUFFIX= -devel
DISTVERSION= $(PORTVERSION:S/a/alpha/:S/b/beta/:S/r/rc/)
DISTFILES= syslog-ng_${DISTVERSION}.tar.gz
MASTER_SITES= http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/${DISTVERSION}/source/
MAINTAINER= cy@FreeBSD.org
COMMENT= A powerful syslogd replacement
CONFLICTS?= syslog-ng-[0-9]* syslog-ng[0-9]-[0-9]* \
syslog-ng[0-9][0-9]-[0-9]* \
syslog-ng-devel-[0-9]*
WRKSRC= $(WRKDIR)/$(PORTNAME)-$(DISTVERSION)
OPTIONS_RADIO= SSL
OPTIONS_RADIO_SSL= SYS_SSL PORTS_SSL
OPTIONS_DEFINE= TCP_WRAPPERS SQL SPOOF IPV6 PCRE SMTP JSON GEOIP DOCS
OPTIONS_DEFAULT= PORTS_SSL PCRE
SYS_SSL_DESC= Build with OpenSSL support (from system)
PORTS_SSL_DESC= Build with OpenSSL support (from ports)
TCP_WRAPPERS_DESC= Build with TCP Wrappers
SQL_DESC= Build with database (libdbi) support
SPOOF_DESC= Build with spoof source support
IPV6_DESC= Build with IPV6 support
PCRE_DESC= Build with PCRE support
SMTP_DESC= Build with SMTP support
JSON_DESC= Build with JSON-C support
GEOIP_DESC= Build with GeoIP support
.include <bsd.port.options.mk>
LIB_DEPENDS= evtlog.0:${PORTSDIR}/sysutils/eventlog
MAN1= loggen.1 pdbtool.1 syslog-ng-ctl.1
MAN5= syslog-ng.conf.5
MAN8= syslog-ng.8
USE_LDCONFIG= yes
USE_RC_SUBR= syslog-ng
GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_GNOME= glib20 gnomehack
SUB_FILES= pkg-message
CONFIGURE_ARGS= --sysconfdir=${LOCALBASE}/etc --localstatedir=/var/db \
--enable-dynamic-linking \
--enable-debug
.if ${PORT_OPTIONS:MSYS_SSL} || ${PORT_OPTIONS:MPORTS_SSL}
USE_OPENSSL= yes
CONFIGURE_ARGS+= --enable-ssl
CONFIGURE_ENV+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}" \
OPENSSL_LIBS="${OPENSSL_LDFLAGS} -lcrypto -lssl"
PLIST_FILES+= lib/syslog-ng/libafsocket-tls.la lib/syslog-ng/libafsocket-tls.so
.else
CONFIGURE_ARGS+= --disable-ssl
.endif
.if ${PORT_OPTIONS:MPORTS_SSL}
WITH_OPENSSL_PORT= yes
.endif
.include <bsd.port.pre.mk>
.if ${ARCH} == "sparc64"
BROKEN= Does not compile on sparc64: gcc core dump
.endif
.if ${PORT_OPTIONS:MTCP_WRAPPERS}
CONFIGURE_ARGS+= --enable-tcp-wrapper
.else
CONFIGURE_ARGS+= --disable-tcp-wrapper
.endif
.if ${PORT_OPTIONS:MSPOOF}
BUILD_DEPENDS= ${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
LIBNET_CONFIG?= ${LOCALBASE}/bin/libnet11-config
CONFIGURE_ARGS+= --enable-spoof-source --with-libnet=${LOCALBASE}/bin
CFLAGS+= `${LIBNET_CONFIG} --cflags` -I${LOCALBASE}/include
LDFLAGS+= `${LIBNET_CONFIG} --libs`
.else
CONFIGURE_ARGS+= --disable-spoof-source
.endif
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
.endif
.if ${PORT_OPTIONS:MPCRE}
CONFIGURE_ARGS+= --enable-pcre
LIB_DEPENDS+= pcre:${PORTSDIR}/devel/pcre
.else
CONFIGURE_ARGS+= --disable-pcre
.endif
.if ${PORT_OPTIONS:MGEOIP}
CONFIGURE_ARGS+= --enable-geoip
LIB_DEPENDS+= GeoIP.5:${PORTSDIR}/net/GeoIP
CONFIGURE_ENV+= GEOIP_LIBS="-lGeoIP"
PLIST_FILES+= lib/syslog-ng/libtfgeoip.la lib/syslog-ng/libtfgeoip.so
.else
CONFIGURE_ARGS+= --disable-geoip
.endif
.if ${PORT_OPTIONS:MSMTP}
CONFIGURE_ARGS+= --with-libesmtp=/usr/local/
LIB_DEPENDS+= esmtp.7:${PORTSDIR}/mail/libesmtp
PLIST_FILES+= lib/syslog-ng/libafsmtp.la lib/syslog-ng/libafsmtp.so
.else
CONFIGURE_ARGS+= --disable-smtp
.endif
.if ${PORT_OPTIONS:MSQL}
LIB_DEPENDS+= dbi.1:${PORTSDIR}/databases/libdbi
CONFIGURE_ENV+= LIBDBI_LIBS="-ldbi"
CONFIGURE_ARGS+= --enable-sql
PLIST_FILES+= lib/syslog-ng/libafsql.la lib/syslog-ng/libafsql.so
.else
CONFIGURE_ARGS+= --disable-sql
.endif
.if ${PORT_OPTIONS:MJSON}
LIB_DEPENDS+= json.0:${PORTSDIR}/devel/json-c
CONFIGURE_ARGS+= --enable-json
PLIST_FILES+= lib/syslog-ng/libjson-plugin.la lib/syslog-ng/libjson-plugin.so
.else
CONFIGURE_ARGS+= --disable-json
.endif
.if ${OSVERSION} >= 900034
CONFIGURE_ARGS+= --disable-linux-caps
.endif
post-patch:
@${REINPLACE_CMD} -e 's:libnet-config:libnet11-config:g' ${WRKSRC}/configure
@${LN} ${WRKSRC}/scl/syslog-ng.conf ${WRKSRC}/scl/syslog-ng.conf.dist
post-install:
.if ${PORT_OPTIONS:MDOCS}
${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} \
${PREFIX}/share/doc/syslog-ng \
${PREFIX}/share/doc/syslog-ng
${INSTALL_DATA} ${WRKSRC}/AUTHORS ${PREFIX}/share/doc/syslog-ng
${INSTALL_DATA} ${WRKSRC}/COPYING ${PREFIX}/share/doc/syslog-ng
${INSTALL_DATA} ${WRKSRC}/NEWS ${PREFIX}/share/doc/syslog-ng
.endif
@if [ ! -f ${PREFIX}/etc/syslog-ng.conf.sample ]; then \
${INSTALL_DATA} ${FILESDIR}/syslog-ng.conf.sample ${PREFIX}/etc; \
fi
@if [ ! -f ${PREFIX}/etc/syslog-ng.conf.dist ]; then \
${INSTALL_DATA} ${WRKSRC}/scl/syslog-ng.conf.dist ${PREFIX}/etc; \
fi
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

View File

@ -0,0 +1,2 @@
SHA256 (syslog-ng_3.4.3.tar.gz) = 8a00c342036109e6cc1d441aaed12438134bc884ca3492c36902ff9120a107ee
SIZE (syslog-ng_3.4.3.tar.gz) = 3074800

View File

@ -0,0 +1,29 @@
syslog-ng is now installed! To replace FreeBSD's standard syslogd
(/usr/sbin/syslogd), complete these steps:
1. Create a configuration file named %%PREFIX%%/etc/syslog-ng.conf
(a sample named syslog-ng.conf.sample has been included in
%%PREFIX%%/etc). Note that this is a change in 2.0.2
version, previous ones put the config file in
%%PREFIX%%/etc/syslog-ng/syslog-ng.conf, so if this is an update
move that file in the right place
2. Configure syslog-ng to start automatically by adding the following
to /etc/rc.conf:
syslog_ng_enable="YES"
3. Prevent the standard FreeBSD syslogd from starting automatically by
adding a line to the end of your /etc/rc.conf file that reads:
syslogd_enable="NO"
4. Shut down the standard FreeBSD syslogd:
kill `cat /var/run/syslog.pid`
5. Start syslog-ng:
%%PREFIX%%/etc/rc.d/syslog-ng start

View File

@ -0,0 +1,185 @@
@version:3.4
#
# This sample configuration file is essentially equilivent to the stock
# FreeBSD /etc/syslog.conf file.
#
# $FreeBSD$
#
#
# options
#
options { chain_hostnames(off); flush_lines(0); threaded(yes); };
#
# sources
#
source src { unix-dgram("/var/run/log");
unix-dgram("/var/run/logpriv" perm(0600));
udp(); internal(); file("/dev/klog"); };
#
# destinations
#
destination messages { file("/var/log/messages"); };
destination security { file("/var/log/security"); };
destination authlog { file("/var/log/auth.log"); };
destination maillog { file("/var/log/maillog"); };
destination lpd-errs { file("/var/log/lpd-errs"); };
destination xferlog { file("/var/log/xferlog"); };
destination cron { file("/var/log/cron"); };
destination debuglog { file("/var/log/debug.log"); };
destination consolelog { file("/var/log/console.log"); };
destination all { file("/var/log/all.log"); };
destination newscrit { file("/var/log/news/news.crit"); };
destination newserr { file("/var/log/news/news.err"); };
destination newsnotice { file("/var/log/news/news.notice"); };
destination slip { file("/var/log/slip.log"); };
destination ppp { file("/var/log/ppp.log"); };
destination console { file("/dev/console"); };
destination allusers { usertty("*"); };
#destination loghost { udp("loghost" port(514)); };
#
# log facility filters
#
filter f_auth { facility(auth); };
filter f_authpriv { facility(authpriv); };
filter f_not_authpriv { not facility(authpriv); };
#filter f_console { facility(console); };
filter f_cron { facility(cron); };
filter f_daemon { facility(daemon); };
filter f_ftp { facility(ftp); };
filter f_kern { facility(kern); };
filter f_lpr { facility(lpr); };
filter f_mail { facility(mail); };
filter f_news { facility(news); };
filter f_security { facility(security); };
filter f_user { facility(user); };
filter f_uucp { facility(uucp); };
filter f_local0 { facility(local0); };
filter f_local1 { facility(local1); };
filter f_local2 { facility(local2); };
filter f_local3 { facility(local3); };
filter f_local4 { facility(local4); };
filter f_local5 { facility(local5); };
filter f_local6 { facility(local6); };
filter f_local7 { facility(local7); };
#
# log level filters
#
filter f_emerg { level(emerg); };
filter f_alert { level(alert..emerg); };
filter f_crit { level(crit..emerg); };
filter f_err { level(err..emerg); };
filter f_warning { level(warning..emerg); };
filter f_notice { level(notice..emerg); };
filter f_info { level(info..emerg); };
filter f_debug { level(debug..emerg); };
filter f_is_debug { level(debug); };
#
# program filters
#
filter f_ppp { program("ppp"); };
filter f_slip { program("startslip"); };
#
# *.err;kern.warning;auth.notice;mail.crit /dev/console
#
log { source(src); filter(f_err); destination(console); };
log { source(src); filter(f_kern); filter(f_warning); destination(console); };
log { source(src); filter(f_auth); filter(f_notice); destination(console); };
log { source(src); filter(f_mail); filter(f_crit); destination(console); };
#
# *.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
#
log { source(src); filter(f_notice); filter(f_not_authpriv); destination(messages); };
log { source(src); filter(f_kern); filter(f_debug); destination(messages); };
log { source(src); filter(f_lpr); filter(f_info); destination(messages); };
log { source(src); filter(f_mail); filter(f_crit); destination(messages); };
log { source(src); filter(f_news); filter(f_err); destination(messages); };
#
# security.* /var/log/security
#
log { source(src); filter(f_security); destination(security); };
#
# auth.info;authpriv.info /var/log/auth.log
log { source(src); filter(f_auth); filter(f_info); destination(authlog); };
log { source(src); filter(f_authpriv); filter(f_info); destination(authlog); };
#
# mail.info /var/log/maillog
#
log { source(src); filter(f_mail); filter(f_info); destination(maillog); };
#
# lpr.info /var/log/lpd-errs
#
log { source(src); filter(f_lpr); filter(f_info); destination(lpd-errs); };
#
# ftp.info /var/log/xferlog
#
log { source(src); filter(f_ftp); filter(f_info); destination(xferlog); };
#
# cron.* /var/log/cron
#
log { source(src); filter(f_cron); destination(cron); };
#
# *.=debug /var/log/debug.log
#
log { source(src); filter(f_is_debug); destination(debuglog); };
#
# *.emerg *
#
log { source(src); filter(f_emerg); destination(allusers); };
#
# uncomment this to log all writes to /dev/console to /var/log/console.log
# console.info /var/log/console.log
#
#log { source(src); filter(f_console); filter(f_info); destination(consolelog); };
#
# uncomment this to enable logging of all log messages to /var/log/all.log
# touch /var/log/all.log and chmod it to mode 600 before it will work
# *.* /var/log/all.log
#
#log { source(src); destination(all); };
#
# uncomment this to enable logging to a remote loghost named loghost
# *.* @loghost
#
#log { source(src); destination(loghost); };
#
# uncomment these if you're running inn
# news.crit /var/log/news/news.crit
# news.err /var/log/news/news.err
# news.notice /var/log/news/news.notice
#
#log { source(src); filter(f_news); filter(f_crit); destination(newscrit); };
#log { source(src); filter(f_news); filter(f_err); destination(newserr); };
#log { source(src); filter(f_news); filter(f_notice); destination(newsnotice); };
#
# !startslip
# *.* /var/log/slip.log
#
log { source(src); filter(f_slip); destination(slip); };
#
# !ppp
# *.* /var/log/ppp.log
#
log { source(src); filter(f_ppp); destination(ppp); };

View File

@ -0,0 +1,46 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: syslogd
# REQUIRE: mountcritremote cleanvar ldconfig
# BEFORE: SERVERS
#
# Add the following line to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
#syslog_ng_enable="YES"
#syslog_ng_config="-u daemon"
#syslog_ng_pid="/var/run/syslog-ng.pid"
#
syslog_ng_purgeklog=${syslog_ng_purgeklog-"NO"}
. /etc/rc.subr
name=syslog_ng
rcvar=syslog_ng_enable
command=%%PREFIX%%/sbin/syslog-ng
required_files=%%PREFIX%%/etc/syslog-ng.conf
extra_commands=reload
if checkyesno syslog_ng_purgeklog; then
start_precmd="echo \"Purging klog(9)\" && sysctl -w kern.msgbuf_clear=1 $start_precmd";
fi
stop_postcmd=stop_postcmd
load_rc_config $name
: ${syslog_ng_enable:="NO"}
pidfile=${syslog_ng_pid:-"/var/run/syslog.pid"}
command_args="-p ${pidfile} ${syslog_ng_config}"
stop_postcmd() {
rm -f $pidfile
}
run_rc_command "$1"

View File

@ -0,0 +1,10 @@
syslog-ng3 (Syslog New Generation) is a powerful replacement for the standard
syslogd. Features include:
- ability to filter messages based on content using regular expressions
- forwarding logs on TCP
WWW: http://www.balabit.com/products/syslog_ng/
-Vince Valenti
vince@blue-box.net

View File

@ -0,0 +1,148 @@
@unexec %D/etc/rc.d/syslog-ng.sh stop > /dev/null 2>&1 || true
etc/scl.conf
@unexec if cmp -s %D/etc/syslog-ng.conf %D/etc/syslog-ng.conf.dist; then rm -f %D/etc/syslog-ng.conf; fi
etc/syslog-ng.conf.dist
@exec test -f %B/syslog-ng.conf || cp -p %B/%f %B/syslog-ng.conf
etc/syslog-ng.conf.sample
bin/loggen
bin/pdbtool
bin/update-patterndb
sbin/syslog-ng
sbin/syslog-ng-ctl
include/syslog-ng/afinter.h
include/syslog-ng/alarms.h
include/syslog-ng/apphook.h
include/syslog-ng/atomic.h
include/syslog-ng/block-ref-parser.h
include/syslog-ng/cfg-grammar.h
include/syslog-ng/cfg-lexer.h
include/syslog-ng/cfg-parser.h
include/syslog-ng/cfg.h
include/syslog-ng/children.h
include/syslog-ng/cfg-args.h
include/syslog-ng/cfg-lexer-subst.h
include/syslog-ng/compat.h
include/syslog-ng/control.h
include/syslog-ng/crypto.h
include/syslog-ng/dnscache.h
include/syslog-ng/driver.h
include/syslog-ng/filter-expr-parser.h
include/syslog-ng/filter.h
include/syslog-ng/gprocess.h
include/syslog-ng/gsockaddr.h
include/syslog-ng/gsocket.h
include/syslog-ng/logmatcher.h
include/syslog-ng/logmpx.h
include/syslog-ng/logmsg.h
include/syslog-ng/logparser.h
include/syslog-ng/logpipe.h
include/syslog-ng/logproto.h
include/syslog-ng/logproto-buffered-server.h
include/syslog-ng/logproto-builtins.h
include/syslog-ng/logproto-client.h
include/syslog-ng/logproto-dgram-server.h
include/syslog-ng/logproto-framed-client.h
include/syslog-ng/logproto-framed-server.h
include/syslog-ng/logproto-record-server.h
include/syslog-ng/logproto-server.h
include/syslog-ng/logproto-text-client.h
include/syslog-ng/logproto-text-server.h
include/syslog-ng/logqueue-fifo.h
include/syslog-ng/logqueue.h
include/syslog-ng/logreader.h
include/syslog-ng/logrewrite.h
include/syslog-ng/logsource.h
include/syslog-ng/logstamp.h
include/syslog-ng/logtransport.h
include/syslog-ng/logwriter.h
include/syslog-ng/mainloop.h
include/syslog-ng/memtrace.h
include/syslog-ng/messages.h
include/syslog-ng/misc.h
include/syslog-ng/ml-batched-timer.h
include/syslog-ng/msg-format.h
include/syslog-ng/nvtable.h
include/syslog-ng/parser-expr-parser.h
include/syslog-ng/persist-state.h
include/syslog-ng/plugin.h
include/syslog-ng/pragma-parser.h
include/syslog-ng/rewrite-expr-parser.h
include/syslog-ng/scratch-buffers.h
include/syslog-ng/serialize.h
include/syslog-ng/stats.h
include/syslog-ng/str-format.h
include/syslog-ng/syslog-names.h
include/syslog-ng/syslog-ng.h
include/syslog-ng/tags.h
include/syslog-ng/templates.h
include/syslog-ng/timeutils.h
include/syslog-ng/tls-support.h
include/syslog-ng/tlscontext.h
include/syslog-ng/tlstransport.h
include/syslog-ng/utils.h
include/syslog-ng/value-pairs.h
include/syslog-ng/versioning.h
include/syslog-ng/cfg-tree.h
include/syslog-ng/file-perms.h
include/syslog-ng/uuid.h
include/syslog-ng/vptransform.h
lib/libsyslog-ng.la
lib/libsyslog-ng.so
lib/libsyslog-ng-3.4.3.so
libdata/pkgconfig/syslog-ng.pc
lib/syslog-ng/libcryptofuncs.la
lib/syslog-ng/libcryptofuncs.so
lib/syslog-ng/libaffile.la
lib/syslog-ng/libaffile.so
lib/syslog-ng/libafmongodb.la
lib/syslog-ng/libafmongodb.so
lib/syslog-ng/libafamqp.la
lib/syslog-ng/libafamqp.so
lib/syslog-ng/libafprog.la
lib/syslog-ng/libafprog.so
lib/syslog-ng/libafsocket-notls.la
lib/syslog-ng/libafsocket-notls.so
lib/syslog-ng/libafsocket.so
lib/syslog-ng/libafuser.la
lib/syslog-ng/libafuser.so
lib/syslog-ng/libbasicfuncs.la
lib/syslog-ng/libbasicfuncs.so
lib/syslog-ng/libconfgen.la
lib/syslog-ng/libconfgen.so
lib/syslog-ng/libcsvparser.la
lib/syslog-ng/libcsvparser.so
lib/syslog-ng/libdbparser.la
lib/syslog-ng/libdbparser.so
lib/syslog-ng/libsyslog-ng-crypto.la
lib/syslog-ng/libsyslog-ng-crypto.so
lib/syslog-ng/libsyslogformat.la
lib/syslog-ng/libsyslogformat.so
lib/syslog-ng/libsystem-source.la
lib/syslog-ng/libsystem-source.so
share/include/scl/pacct/plugin.conf
share/include/scl/syslogconf/README
share/include/scl/syslogconf/convert-syslogconf.awk
share/include/scl/syslogconf/plugin.conf
share/include/scl/system/plugin.conf
share/tools/cfg-grammar.y
share/tools/lex-rules.am
share/tools/merge-grammar.pl
share/xsd/patterndb-1.xsd
share/xsd/patterndb-2.xsd
share/xsd/patterndb-3.xsd
share/xsd/patterndb-4.xsd
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%/COPYING
%%PORTDOCS%%%%DOCSDIR%%/NEWS
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm include/syslog-ng
@dirrm lib/syslog-ng
@dirrm share/include/scl/system
@dirrm share/include/scl/syslogconf
@dirrm share/include/scl/pacct
@dirrm share/include/scl
@dirrm share/include
@dirrmtry share/tools
@dirrm share/xsd
@exec mkdir %D/etc/patterndb.d
@dirrmtry etc/patterndb.d