It would be nice to enable /etc/init.d/syslog-ng to use some parameters from /etc/conf.d/syslog-ng. Would be easier to run syslog-ng as non-root user/group or chroot it etc. for example running as non root now looks like that: start-stop-daemon --quiet --start --exec usr/sbin/syslog-ng -- -u syslog -g syslog Not using the last "--" results in script ommiting the whole "-u syslog -g syslog" It makes configuration unintuitive. Reproducible: Always Steps to Reproduce: 1. 2. 3.
A patch to show what you have in mind here would go a long way.
*** Bug 150844 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > A patch to show what you have in mind here would go a long way. > hi! no need for patching, syslog-ng "vanilla" allready supports this. the current manpage for syslog-ng gentoo package documents the feature: NAME syslog-ng - logs system messages SYNOPSIS syslog-ng [ -dFsvVy ] [ -f <config-filename> ] [ -p <pid-filename> ] [ -C <chroot-dir> ] [ -u <user> ] [ -g <group> ] (...) OPTIONS -C <directory>, --chroot=<directory> Chroot to directory. (...) -g <group>, --group=<group> Switch to group. (...) -u <user>, --group=<user> Switch to user. (...) DIAGNOSTICS It is expected that syslog-ng will run as root, however, if not running on a priviledged port of it it owned its own log directories, etc, it might run as a non-root user. this last phrase seems confusing, but it's trying to say that syslog-ng can run chrooted and has non-root has long has it owns log directories, and runs on one "unprivilged" port. Also, one more thing, since it allready exists a "chroot" use flag, I thing it would be apropriate if syslog-ng obliged it. =)
No, I meant a patch to the ebuild and files/syslog-ng.rc6 files.
Created attachment 99568 [details, diff] ebuild file patch
Created attachment 99569 [details, diff] init script patch
Created attachment 99570 [details] simple syslog-ng confd file..
Hi there, these patches are my first stab at it. I must say that I'm rather unexperienced with ebuild developtment, I could not test this yet.. (no time, busy, busy, busy... and a semi-broken gentoo system :) ) anyway, these patches serve has prototypes. thankyou in advance. best regards, PS: I've posted these files in my bug report (duplicate of this one) by mistake, re-posting it here.
In the 2.0.0 ebuild. Thanks for the bug report and patches. I didn't include a chroot use flag since it doesn't seem like it's necessary. You can set up the chroot stuff yourself using the conf.d stuff and the .conf file.
(In reply to comment #9) > In the 2.0.0 ebuild. Thanks for the bug report and patches. I didn't include > a chroot use flag since it doesn't seem like it's necessary. You can set up > the chroot stuff yourself using the conf.d stuff and the .conf file. > Sorry to be picky but I just thought I should mention two things... 1) We need a check in the reload() function of the init script to see if we are running in a chroot. If we are it won't work as we can no longer see /etc. 2) We will need to wait until kernel version 2.6.20 at least (the patch missed 2.6.19 to the best of my knowledge) before we can log kernel messages when running as a non-root user. We should probably give a warning to that effect in the /etc/conf.d/syslog-ng example file. See link below: http://thread.gmane.org/gmane.linux.kernel/466034
app-admin/syslog-ng-3.3.5-r1 Syslog init script don't using SYSLOG_NG_OPTS from/etc/conf.d/syslog-ng configuration for checkconfig action. For fixing need to change 42 str: from syslog-ng -s -f "${SYSLOG_NG_CONFIGFILE}" to syslog-ng -s -f "${SYSLOG_NG_CONFIGFILE}" ${SYSLOG_NG_OPTS}