Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Nov 10, 2011 1:22 pm 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
I'm assuming the answer to this question is yes, but I thought I'd ask...

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?


Top
   
 Post subject:
PostPosted: Thu Nov 10, 2011 2:27 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Config files ONLY apply to their OWN application.


Top
   
 Post subject:
PostPosted: Thu Nov 10, 2011 2:41 pm 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
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?


Top
   
 Post subject:
PostPosted: Thu Nov 10, 2011 3:30 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
It depends on the individual application. Generally, yes, but you should test it yourself by setting something and then setting it again to something different and seeing which applies.


Top
   
 Post subject:
PostPosted: Thu Nov 10, 2011 3:34 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
jzimmerlin wrote:
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.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Nov 10, 2011 3:42 pm 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
Would search/replace be the only other way to automate setting config options for OpenSSH/Apache/PHP/MySQL/Postfix using a shell script?


Top
   
 Post subject:
PostPosted: Thu Nov 10, 2011 4:07 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I usually use the template approach (via chef, but other configuration management systems do similar things). eRuby/erubis is well-suited to this sort of thing.

It's essentially search-and-replace, but with more smarts.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group