Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101387 - Syslog init script could use /etc/conf.d/syslog-ng configuration.
Summary: Syslog init script could use /etc/conf.d/syslog-ng configuration.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Mr. Bones. (RETIRED)
URL:
Whiteboard:
Keywords:
: 150844 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-04 15:35 UTC by Tomasz Lisiecki
Modified: 2013-02-26 10:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild file patch (syslog-ng-1.6.11.ebuild.diff,1.10 KB, patch)
2006-10-13 11:07 UTC, Miguel Sousa Filipe
Details | Diff
init script patch (syslog-ng.initd.diff,438 bytes, patch)
2006-10-13 11:07 UTC, Miguel Sousa Filipe
Details | Diff
simple syslog-ng confd file.. (syslog-ng.confd,56 bytes, text/plain)
2006-10-13 11:08 UTC, Miguel Sousa Filipe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Lisiecki 2005-08-04 15:35:30 UTC
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.
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2005-09-14 17:47:03 UTC
A patch to show what you have in mind here would go a long way.
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2006-10-11 11:43:40 UTC
*** Bug 150844 has been marked as a duplicate of this bug. ***
Comment 3 Miguel Sousa Filipe 2006-10-11 12:39:30 UTC
(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. =)
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2006-10-11 12:50:00 UTC
No, I meant a patch to the ebuild and files/syslog-ng.rc6 files.
Comment 5 Miguel Sousa Filipe 2006-10-13 11:07:16 UTC
Created attachment 99568 [details, diff]
ebuild file patch
Comment 6 Miguel Sousa Filipe 2006-10-13 11:07:36 UTC
Created attachment 99569 [details, diff]
init script patch
Comment 7 Miguel Sousa Filipe 2006-10-13 11:08:00 UTC
Created attachment 99570 [details]
simple syslog-ng confd file..
Comment 8 Miguel Sousa Filipe 2006-10-13 11:09:47 UTC
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.
Comment 9 Mr. Bones. (RETIRED) gentoo-dev 2006-11-02 13:00:16 UTC
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.
Comment 10 Max Hacking 2007-01-26 18:15:17 UTC
(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
Comment 11 hedgeven 2013-02-26 10:39:23 UTC
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}