[SERVER-20404] Add Option for Config File in init Script Created: 14/Sep/15 Updated: 15/Dec/18 Resolved: 09/Feb/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Packaging |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.4, 3.3.2 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Peter Garafano (Inactive) | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | bkp | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Backport Requested: |
v3.2
|
||||||||||||
| Sprint: | Build A (10/09/15), Build B (10/30/15), Build 10 (02/19/16) | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
When upgrading to a newer version of MongoDB, the init script is overwritten. This removes any changes the user may have made to the script, such as changing the SERVICE_USER. Adding the ability to persist changes like this between versions of MongoDB would be helpful. One possible way of doing this would be to add the ability to maintain a config file outside the init script. When the script starts, it checks the presence of this file, uses the information inside, or if it doesn't exist, use the default values. |
| Comments |
| Comment by Githook User [ 24/Feb/16 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: (cherry picked from commit 985e2a0be95709ac064c57f0a9bb385a55937285) |
| Comment by Githook User [ 09/Feb/16 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by Ernie Hershey [ 25/Sep/15 ] |
|
This may be under-documented. You can set environment variables in /etc/sysconfig/mongod for rpm packages or /etc/default/mongod for .deb's and the files will be sourced in the init scripts. We should probably add big comment blocks in the init scripts with instructions for using those files instead of modifying init scripts. https://github.com/mongodb/mongo/blob/master/rpm/init.d-mongod#L20 If possible we should also prevent this behavior. If you've modified your init script, we shouldn't overwrite it. |