Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38475 - syslog-ng fails to start when using network logging, because it does not depend on net
Summary: syslog-ng fails to start when using network logging, because it does not depe...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mr. Bones. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-16 18:32 UTC by Javier Fernandez-Ivern
Modified: 2004-02-14 17:12 UTC (History)
2 users (show)

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 Javier Fernandez-Ivern 2004-01-16 18:32:28 UTC
When enabling network logging, /etc/init.d/syslog-ng fails to run because it does not depend on net.  Adding net to it's "need" line fixes the problem.


Reproducible: Always
Steps to Reproduce:
1. Add a network source to /etc/syslog-ng/syslog-ng.conf, for example:

source servers { tcp(ip(192.168.0.2) port(5140) keep-alive(yes)); };

Where the IP is the local IP of the interface on which to bind the server.  Once this is done, reboot.

2.
3.  Profit!

Actual Results:  
syslog-ng failed to load on boot

Expected Results:  
syslog-ng should have loaded
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2004-01-19 14:40:32 UTC
Michael, how about grepping /etc/syslog-ng/syslog-ng.conf for a pattern, then conditionally add the need in /etc/init.d/syslog-ng?
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2004-01-19 14:44:49 UTC
That might work, but my first instinct for this bug is to say "Tough".  syslog-ng
works as shipped by Gentoo.  If people start changing the config file, they should
be ready to make any additional changes they need to their systems to support
those changes.  On the other hand, I wonder what the down-side would be
of unconditionally adding need net to the syslog-ng init script.
Comment 3 Paul de Vrieze (RETIRED) gentoo-dev 2004-01-20 01:10:24 UTC
We could use a lesser dependency like use, but if you don't use network logging you normally would like syslog-ng to be started as soon as possible, which is before net is started.
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-01-20 07:36:05 UTC
Michael, imho files in /etc/init.d are not intended to be configuration files.  They shouldn't need editing just because the configuration changed.

Considering what Paul mentioned (about wanting syslog-ng to start ASAP if it doesn't depend on net), I think the best thing would be a grep.  How about...

depend() {
    # make networking dependency conditional on configuration
    sed 's/#.*//' /etc/syslog-ng/syslog-ng.conf | \
    grep -Eq '(source|destination).*(tcp|udp)' && need net

    need clock hostname
    provide logger
}

Comment 5 Jason Wever (RETIRED) gentoo-dev 2004-02-13 10:16:45 UTC
I've adjusted my syslog-ng init script to need net and it seems to work well here.
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2004-02-14 17:12:32 UTC
Fixed and closed