| Summary: | app-admin/syslog-ng-3.3.5-r1 - syslog-ng: Error creating persistent state file; filename='/var/lib/misc/syslog-ng.persist-', error='Permission denied (13)' | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | wbrana |
| Component: | [OLD] Core system | Assignee: | Mr. Bones. (RETIRED) <mr_bones_> |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | CC: | yac |
| Priority: | Normal | Keywords: | PATCH |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | complete patch RC1 | ||
|
Description
wbrana
2013-01-19 18:41:52 UTC
then use --persist-file to someplace that user can write to. I created directories and used --persist-file and --pidfile, but it wasn't enough.
Error opening control socket, bind() failed; socket='/var/run/syslog-ng.ctl', error='Address already in use (98)'
I had to change ebuild
--- syslog-ng-3.3.5-r1.ebuild 2012-06-08 20:50:14.000000000 +0200
+++ syslog-ng-3.3.5-r131.ebuild 2013-01-19 18:46:01.021751100 +0100
@@ -68,8 +68,8 @@
--disable-systemd \
--with-ivykis=internal \
--sysconfdir=/etc/syslog-ng \
- --localstatedir=/var/lib/misc \
- --with-pidfile-dir=/var/run \
+ --localstatedir=/var/lib/misc/syslog \
+ --with-pidfile-dir=/var/run/syslog \
--with-module-dir=/usr/$(get_libdir)/syslog-ng \
$(use_enable caps linux-caps) \
$(use_enable ipv6) \
change /etc/init.d/syslog-ng
from
SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE:-/var/run/${SVCNAME}.pid}
to
SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE:-/var/run/syslog/${SVCNAME}.pid}
syslog seems to run now, but it is possible it is still broken
/var/run/syslog has to be always created
--- syslog-ng.old 2013-01-19 18:54:51.000000000 +0100
+++ syslog-ng 2013-01-22 11:10:22.844060488 +0100
@@ -13,7 +13,7 @@
SYSLOG_NG_SERVICE=${SYSLOG_NG_SERVICE:-syslog-ng}
SYSLOG_NG_CONFIGFILE=${SYSLOG_NG_CONFIGFILE:-/etc/syslog-ng/${SYSLOG_NG_SERVICE}.conf}
-SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE:-/var/run/${SVCNAME}.pid}
+SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE:-/var/run/syslog/${SVCNAME}.pid}
SYSLOG_NG_OPTS="--cfgfile ${SYSLOG_NG_CONFIGFILE} --pidfile ${SYSLOG_NG_PIDFILE} ${SYSLOG_NG_OPTS}"
depend() {
@@ -50,6 +50,8 @@
checkconfig || return 1
ebegin "Starting ${SVCNAME}"
[ -n "${SYSLOG_NG_OPTS}" ] && SYSLOG_NG_OPTS="-- ${SYSLOG_NG_OPTS}"
+ mkdir /var/run/syslog
+ chown syslog /var/run/syslog
start-stop-daemon --start --pidfile "${SYSLOG_NG_PIDFILE}" --exec /usr/sbin/syslog-ng ${SYSLOG_NG_OPTS}
eend $? "Failed to start ${SVCNAME}"
}
Created attachment 337002 [details, diff]
complete patch RC1
(In reply to comment #4) > Created attachment 337002 [details, diff] [details, diff] > complete patch RC1 It seems syslog running as user syslog isn't safe enough. Syslog should run in chroot. chroot support in syslog-ng is useless I replaced syslog-ng with app-admin/sysklogd, which is safe enough without chroot. |