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
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?
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.
sounds good, i dont think it does any harm depending on net anyway :)
committed