aboutsummaryrefslogtreecommitdiff
path: root/sysutils/rsyslog
diff options
context:
space:
mode:
authorAndrew Pantyukhin <sat@FreeBSD.org>2007-08-08 23:03:37 +0000
committerAndrew Pantyukhin <sat@FreeBSD.org>2007-08-08 23:03:37 +0000
commitc9e513566535e12e7d7edf6b22aafe379ce16a26 (patch)
tree7120339bea8eff9b5409b513ec2c01050e927915 /sysutils/rsyslog
parent96d66dfd279bbd75ebb2f1516241daef742f4c76 (diff)
downloadports-c9e513566535e12e7d7edf6b22aafe379ce16a26.tar.gz
ports-c9e513566535e12e7d7edf6b22aafe379ce16a26.zip
Notes
Diffstat (limited to 'sysutils/rsyslog')
-rw-r--r--sysutils/rsyslog/Makefile7
-rw-r--r--sysutils/rsyslog/files/pkg-message.in16
-rw-r--r--sysutils/rsyslog/files/rsyslogd.in26
3 files changed, 45 insertions, 4 deletions
diff --git a/sysutils/rsyslog/Makefile b/sysutils/rsyslog/Makefile
index c545c66cb914..799da327c635 100644
--- a/sysutils/rsyslog/Makefile
+++ b/sysutils/rsyslog/Makefile
@@ -7,6 +7,7 @@
PORTNAME= rsyslog
PORTVERSION= 1.18.1
+PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://download.rsyslog.com/rsyslog/ CENKES
@@ -22,6 +23,7 @@ LDFLAGS= -L${LOCALBASE}/lib
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-mysql --disable-klogd
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
+SUB_FILES= pkg-message
MAN8= rfc3195d.8 rklogd.8 rsyslogd.8
MAN5= rsyslog.conf.5
@@ -32,9 +34,11 @@ post-patch:
@${REINPLACE_CMD} -e 's|<wait.h>|<sys/wait.h>|' ${WRKSRC}/srUtils.c
@${REINPLACE_CMD} -e '/^rfc3195d_LDADD =/s|$$| -llogging|' ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
- @${REINPLACE_CMD} -e 's|/etc/rsyslog.conf|${PREFIX}/etc/rsyslog.conf|' ${WRKSRC}/syslogd.c
+ @${GREP} -rl '/etc/rsyslog.conf' ${WRKSRC}|${XARGS} ${REINPLACE_CMD} -e\
+ 's|/etc/rsyslog.conf|${PREFIX}/etc/rsyslog.conf|'
@${ECHO_CMD} '#include <sys/socket.h>' >> ${WRKSRC}/net.h
@${ECHO_CMD} '#include <paths.h>' >> ${WRKSRC}/omusrmsg.h
+ @${FIND} ${WRKSRC} -name '*.bak' -delete
post-configure:
@${ECHO_CMD} '#define FEATURE_RFC3195 1' >> ${WRKSRC}/config.h
@@ -49,5 +53,6 @@ do-install:
@${INSTALL} -d ${DOCSDIR}/
@${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR}/
.endif
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/sysutils/rsyslog/files/pkg-message.in b/sysutils/rsyslog/files/pkg-message.in
new file mode 100644
index 000000000000..a6d483ef34f4
--- /dev/null
+++ b/sysutils/rsyslog/files/pkg-message.in
@@ -0,0 +1,16 @@
+===================================================================
+To start using rsyslogd(8), stop syslogd(8) if it's running and
+add the following lines to rc.conf(5):
+ syslogd_enable="NO"
+ rsyslogd_enable="YES"
+It's recommended to copy syslog.conf(5) to
+%%PREFIX%%/etc/rsyslog.conf and edit it there. Otherwise add
+this:
+ rsyslogd_config="/etc/syslog.conf"
+newsyslog(8) has the path of syslogd's pid file hardcoded. To
+make it work seamlessly with rsyslog, add this:
+ rsyslogd_pidfile="/var/run/syslog.pid"
+rsyslogd(8) does not support logging /dev/klog. To enable a
+simple logger(1)-based workaround, add this:
+ rsyslogd_klog_enable="YES"
+===================================================================
diff --git a/sysutils/rsyslog/files/rsyslogd.in b/sysutils/rsyslog/files/rsyslogd.in
index 13272c0acbe7..d33e18b281c4 100644
--- a/sysutils/rsyslog/files/rsyslogd.in
+++ b/sysutils/rsyslog/files/rsyslogd.in
@@ -11,18 +11,38 @@
name=rsyslogd
rcvar=`set_rcvar`
-pidfile="/var/run/rsyslogd.pid"
command="%%PREFIX%%/sbin/${name}"
-required_files="%%PREFIX%%/etc/rsyslog.conf"
+load_rc_config $name
+: ${rsyslogd_enable:="NO"}
+: ${rsyslogd_pidfile:="/var/run/rsyslogd.pid"}
+: ${rsyslogd_config:="%%PREFIX%%/etc/rsyslog.conf"}
+: ${rsyslogd_klog_enable:="NO"}
+: ${rsyslogd_klog_pidfile:="/var/run/rsyslog-klog.pid"}
+pidfile="${rsyslogd_pidfile}"
+command_args="-i ${pidfile} -f ${rsyslogd_config}"
+required_files="${rsyslogd_config}"
start_precmd="rsyslogd_precmd"
+stop_precmd="stop_precmd"
extra_commands="reload"
sockfile="/var/run/rsyslogd.sockets"
evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
altlog_proglist="named"
+stop_precmd()
+{
+ if [ -r ${rsyslogd_klog_pidfile} ]&&[ -s ${rsyslogd_klog_pidfile} ]; then
+ kill `cat ${rsyslogd_klog_pidfile}`
+ fi
+ rm -f ${rsyslogd_klog_pidfile}
+}
+
rsyslogd_precmd()
{
+ if checkyesno rsyslogd_klog_enable; then
+ daemon -cfp ${rsyslogd_klog_pidfile}\
+ logger -t kernel -p kern.notice -f /dev/klog
+ fi
local _l _ldir
# Transitional symlink for old binaries
@@ -68,5 +88,5 @@ set_socketlist()
done
echo $_socketargs
}
-load_rc_config $name
+
run_rc_command "$1"