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
Michael, how about grepping /etc/syslog-ng/syslog-ng.conf for a pattern, then conditionally add the need in /etc/init.d/syslog-ng?
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.
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.
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 }
I've adjusted my syslog-ng init script to need net and it seems to work well here.
Fixed and closed