aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/rsyslog3
diff options
context:
space:
mode:
authorsat <sat@FreeBSD.org>2007-08-09 07:03:37 +0800
committersat <sat@FreeBSD.org>2007-08-09 07:03:37 +0800
commit34ad1e3a26e039c51c66d7e0b7b6ee6b41976175 (patch)
tree63c338afed7e9c4734bd0dd0344ed41c0669249a /sysutils/rsyslog3
parentee5e288931533ee2a684d5d12389a7c48635b623 (diff)
downloadfreebsd-ports-gnome-34ad1e3a26e039c51c66d7e0b7b6ee6b41976175.tar.gz
freebsd-ports-gnome-34ad1e3a26e039c51c66d7e0b7b6ee6b41976175.tar.zst
freebsd-ports-gnome-34ad1e3a26e039c51c66d7e0b7b6ee6b41976175.zip
- Add workarounds to support newsyslog(8) and /dev/log
- Describe them in pkg-message - Respect prefix in html docs and manpages - Bump portrevision
Diffstat (limited to 'sysutils/rsyslog3')
-rw-r--r--sysutils/rsyslog3/Makefile7
-rw-r--r--sysutils/rsyslog3/files/pkg-message.in16
-rw-r--r--sysutils/rsyslog3/files/rsyslogd.in26
3 files changed, 45 insertions, 4 deletions
diff --git a/sysutils/rsyslog3/Makefile b/sysutils/rsyslog3/Makefile
index c545c66cb914..799da327c635 100644
--- a/sysutils/rsyslog3/Makefile
+++ b/sysutils/rsyslog3/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/rsyslog3/files/pkg-message.in b/sysutils/rsyslog3/files/pkg-message.in
new file mode 100644
index 000000000000..a6d483ef34f4
--- /dev/null
+++ b/sysutils/rsyslog3/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/rsyslog3/files/rsyslogd.in b/sysutils/rsyslog3/files/rsyslogd.in
index 13272c0acbe7..d33e18b281c4 100644
--- a/sysutils/rsyslog3/files/rsyslogd.in
+++ b/sysutils/rsyslog3/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"