Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51004 - firewall is disabled when syslog-ng is restarted with a bad config file
Summary: firewall is disabled when syslog-ng is restarted with a bad config file
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-13 21:39 UTC by Diederik van der Boor
Modified: 2004-09-24 17:13 UTC (History)
1 user (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 Diederik van der Boor 2004-05-13 21:39:01 UTC
If one messes with his syslog-ng config file, and runs "/etc/init.d/syslog-ng reload", everything appears to be working correctly. However, if the syslog-ng.conf file contains errors, the following situation will happen:


root@pts/5 syslog-ng # /etc/init.d/syslog-ng reload
 * Reloading configuration and re-opening log files...         [ ok ]
root@pts/5 syslog-ng # /etc/init.d/syslog-ng restart
 * Shutting down atd...                                        [ ok ]
 * Stopping firewall...                                        [ ok ]
 * Stopping vixie-cron...                                      [ ok ]
 * Stopping syslog-ng...                                       [ ok ]
 * Starting syslog-ng...
parse error at 24
Parse error reading configuration file, exiting. (line 24)
 * Failed to start syslog-ng                                                                                                                            [ !!]


Thus, the firewall will remain inactive until it is started manually again.



Reproducible: Always
Steps to Reproduce:



Expected Results:  
* syslog-ng being restarted without stopping all services first (or at least
iptables)
* the reload option giving information about syntax errors in the config file
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2004-05-14 08:28:36 UTC
could you try to change
need logger
to
use logger
in /etc/init.d/firewall
Comment 2 Diederik van der Boor 2004-05-14 10:53:50 UTC
I've changed depend section of the /etc/init.d/iptables script into:

depend() {
    use logger
    need net
}

This seams to work! The firewall won't be stopped, only vixie-cron and atd are stopped if syslog fails to reload.

It also solves another issue I had today: If the syslog-ng.conf file had errors, the iptables didn't start at boot time because it's dependencies didn't start successfully.

When I issue a "/etc/init.d/syslog-ng reload" at the console, syslog does seam to drop a message (a second later) if there is an syntax error. I don't know why this didn't happen before, because I can't reproduce it.
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2004-08-16 19:24:41 UTC
The latest version of the syslog-ng init script checks the syntax of the file before killing syslog-ng so at least you find out about the issue sooner.
Comment 4 Joakim 2004-08-27 08:15:50 UTC
I just upgraded syslog-ng and on giving it a

#/etc/init.d/syslog-ng restart

command, it seam to stop several services but not start them again.

Exiting: Nothing left to do; exiting. :)
merc ~ # /etc/init.d/syslog-ng restart
 * Re-caching dependency info (mtimes differ)...
  [ ok ]ing fcron...
  [ ok ]ing Usermin...
  [ ok ]ing Webmin...
  [ ok ]ing syslog-ng...
  [ ok ]ing syslog-ng...
merc ~ # /etc/init.d/webmin status    
 * status:  stopped
merc ~ # /etc/init.d/usermin status
 * status:  stopped
merc ~ # /etc/init.d/fcron status  
 * status:  stopped

Is this a correct behave or is it wrong to use the restart command?
Comment 5 Joakim 2004-08-27 08:19:39 UTC
OT: Btw when I have it upfront, I always been puzzled why [OK] is overwriting the start of result prompt when restarting someting in init.d/ - anyone?
Comment 6 Mr. Bones. (RETIRED) gentoo-dev 2004-09-24 17:13:36 UTC
I'm going to mark this bug invalid because the situation you describe is doing everything correctly from a dependency point of view.  Since the init scripts claim to require a system logger, if you shut down the system logger, you must shut down the services that require it.  There could be a problem with the dependencies in the init scripts of some packages but those need separate bugs.

You can avoid the situation by using /etc/init.d/syslog-ng checkconfig to verify that the config is correct before you attempt to restart syslog-ng.