[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:
Backports
Depends
Related
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: SERVER-20930 SERVER-20404: clarify sysconfig and default config override

(cherry picked from commit 985e2a0be95709ac064c57f0a9bb385a55937285)
Branch: v3.2
https://github.com/mongodb/mongo/commit/5d2de9f9525f8567ee9fad8f0a3fc67995db0f25

Comment by Githook User [ 09/Feb/16 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-20930 SERVER-20404: clarify sysconfig and default config override
Branch: master
https://github.com/mongodb/mongo/commit/985e2a0be95709ac064c57f0a9bb385a55937285

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
https://github.com/mongodb/mongo/blob/master/debian/init.d#L63

If possible we should also prevent this behavior. If you've modified your init script, we shouldn't overwrite it.

Generated at Thu Feb 08 03:54:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.