When a config option is set twice...
With:
/etc/ssh/sshd_config
/etc/apache2/apache2.conf
/etc/php5/apache2/php.ini
/etc/mysql/my.cnf
/etc/postfix/main.cf
If a config setting, like MaxClients, is declared twice, OpenSSH/Apache/PHP/MySQL/Postfix will all go with whatever the second config setting says, right?
6 Replies
With OpenSSH, Apache, PHP, MySQL, and Postfix, if you declare a variable twice in their config files, it will always go with the second declaration, right?
@jzimmerlin:
Sorry, poorly worded. Let me clarify.
With OpenSSH, Apache, PHP, MySQL, and Postfix, if you declare a variable twice in their config files, it will always go with the second declaration, right?
It depends on how they parse their configuration files, and may also depend on other settings. It's usually undefined behavior. The best case is that the application will refuse to start until it's fixed; the next-best case is that it will throw an error, tell you what it has chosen to do, and proceed accordingly.
If you're relying on predictable behavior, you're probably going to have to do some testing.