Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 60487 - syslog-ng init script does not parse valid constructs while checking for "net" dependency
Summary: syslog-ng init script does not parse valid constructs while checking for "net...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Mr. Bones. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-15 14:39 UTC by Tavis Ormandy (RETIRED)
Modified: 2004-08-18 09:42 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tavis Ormandy (RETIRED) gentoo-dev 2004-08-15 14:39:37 UTC
This is used to add a dependency on net in the syslog-ng init script:

sed 's/#.*//' /etc/syslog-ng/syslog-ng.conf | grep -Eq '(source|destination).*(tcp|udp)' && need net

But this is too basic, It had me scratching my head for a while trying to work out why syslog-ng wasnt starting :) It assumes all source declarations are on one line, but this is a valid construct (from my config):

source remote {
        udp(
                ip("192.168.0.1")
                port(514)
        );
};

Which doesnt match that grep. How about this:

# make networking dependency conditional on configuration
sed -e 's/#.*//' -e '/{/,/}/{' -e 'H' -e '/{/h' \
    -e '/}/{g;s/\n/ /gp;}' -e'd}' /etc/syslog-ng/syslog-ng.conf | \
    grep -Eq '(source|destination).*(tcp|udp)' && need net
Comment 1 Tavis Ormandy (RETIRED) gentoo-dev 2004-08-15 14:45:51 UTC
actually, you can make weird constructs that syslog-ng accepts but that doesnt either.

how about making a file for syslog-ng in /etc/conf.d that has DEPEND_ON_NET="yes" or something like that?
Comment 2 Aron Griffis (RETIRED) gentoo-dev 2004-08-16 20:29:46 UTC
sed 's/#.*//' /etc/syslog-ng/syslog-ng.conf | xargs | grep -Eq '(source|destination).*(tcp|udp)' && need net

That's pretty sufficient IMHO (with the xargs).  There's an extremely low chance of false positives.
Comment 3 Tavis Ormandy (RETIRED) gentoo-dev 2004-08-17 01:09:28 UTC
sounds good, i dont think it does any harm depending on net anyway :)
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-08-18 09:42:06 UTC
committed