[SERVER-1654] dbpath and logpath options in /etc/mongodb.conf are ignored in the Ubuntu Created: 22/Aug/10  Updated: 12/Jul/16  Resolved: 02/Aug/12

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 1.6.1
Fix Version/s: 2.2.0-rc1

Type: Improvement Priority: Major - P3
Reporter: Tsz Ming Wong Assignee: Michael A. Fiedler
Resolution: Done Votes: 0
Labels: initscript
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-6855 debian mongodb package ignores some i... Closed
is duplicated by SERVER-6066 Init-script ignores mongodb.conf dbpa... Closed
is duplicated by SERVER-7303 dbpath not being read from mongodb.co... Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

Even I changed the dbpath and logpath in /etc/mongodb.conf, they are ignored as these two values are hard coded in the init script (/etc/init.d/mongodb)

DAEMONUSER=${DAEMONUSER:-mongodb}
DAEMON_OPTS=${DAEMON_OPTS:-"--dbpath $DATA --logpath $LOGFILE run"}
DAEMON_OPTS="$DAEMON_OPTS --config $CONF"

Other options are okay.

A simple fix would be reorder the line 2 and line 3 in the above commands.



 Comments   
Comment by auto [ 02/Aug/12 ]

Author:

{u'date': u'2012-08-02T10:52:47-07:00', u'email': u'miketheman@gmail.com', u'name': u'Mike Fiedler'}

Message: SERVER-1654 modifies Debian startup script
Branch: master
https://github.com/mongodb/mongo/commit/9dca13232a0578e30311f2f27bd150d83bb0b00d

Comment by Mendeley sysadmin [ 21/Dec/10 ]

in addition the script itself is buggy – although it claims that setting defaults in /etc/default/mongodb should work, the name of the logfile is in fact derived before this file is sourced, so LOGDIR in defaults/mongodb has no effect

patch:

— mongodb 2010-09-16 15:15:06.000000000 +0000
+++ mongodb.new 2010-12-21 17:55:49.000000000 +0000
@@ -56,7 +56,6 @@
DATA=/var/lib/mongodb
LOGDIR=/var/log/mongodb
PIDFILE=/var/run/$NAME.pid
-LOGFILE=$LOGDIR/$NAME.log # Server logfile
ENABLE_MONGODB=yes

  1. Include mongodb defaults if available
    @@ -64,6 +63,8 @@
    . /etc/default/$NAME
    fi

+LOGFILE=$LOGDIR/$NAME.log # Server logfile
+
if test ! -x $DAEMON; then
echo "Could not find $DAEMON"
exit 0

Generated at Thu Feb 08 02:57:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.