[SERVER-25961]  mongo 3.2.9 doesn't start with chkconfig on Centos 7 Created: 05/Sep/16  Updated: 05/Nov/16  Resolved: 25/Oct/16

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 3.2.9
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Carlo Alberto Scaglia Assignee: Sam Kleinman (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

change config file name
change default directories and pid file name
give permission to mongod to the paths
add service mongod_dr to chkconfig

Sprint: Evergreen 2016-10-31
Participants:

 Description   

Hi,
I setted up a replicaset on Centos 7 and I am facing issue with permission and automatic restart after a reboot.
This is an extract of the config which I named mongod_dr:

systemLog:
  destination: file
  logAppend: true
  path: /log/mongo/DR/mongo.log
 
# Where and how to store data.
storage:
  dbPath: /data/mongo/DR
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:
 
# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod_dr.pid  # location of pidfile
 
# network interfaces
net:
  port: 27017

and this the extract of the associated init.d script /etc/initd./mongod_dr:

# NOTE: if you change any OPTIONS here, you get what you pay for:
# this script assumes all options are in the config file.
CONFIGFILE="/etc/mongod_dr.conf"
OPTIONS=" -f $CONFIGFILE"
SYSCONFIG="/etc/sysconfig/mongod"
 
PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d "[:blank:]\"'" | awk -F'#' '{print $1}'`
 
mongod=${MONGOD-/usr/bin/mongod}
 
MONGO_USER=mongod
MONGO_GROUP=mongod

I also already setted up chkconfig:

mongod_dr       0:off   1:off   2:off   3:on    4:off   5:on    6:off

I also already change the permission for the user mongod to all the involved paths, but what is happening is that after the reboot it doesn't start and even with the command:

sudo service mongod_dr start

the only way to start is this:

/usr/bin/mongod -f /etc/mongod_dr.conf

Is there anyway to fix this?what am i doing wrong?

Regards,
Carlo Alberto



 Comments   
Comment by Sam Kleinman (Inactive) [ 25/Oct/16 ]

I'm going to go ahead and close this ticket, but if we find a reproduction of this issue using the default config files and init scripts, then we should reopen.

Comment by Sam Kleinman (Inactive) [ 14/Oct/16 ]

Hello,

Sorry for the delay in getting back to you.

  1. Does using sudo service mongod start work to start the process?
  2. Can you set up the default mongod service with chkconfig?

While we expect that users will modify the configuration files that come with the packages, to some extent, the setup scripts included with the package are intended to run in unmodified form, and we don't support alternate or modified init scripts.

Please let us know if there are problems with the default configuration scripts.

Regards,
sam

Generated at Thu Feb 08 04:10:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.