...
Version: 2.6.1 OS : CentOS 6.x, Amazon linux I am trying to turn off the mongod service on one of my servers. #chkconfig mongod off #chkconfig --list mongod mongod 0:off 1:off 2:off 3:off 4:off 5:off 6:off However on reboot i notice that the mongod service is running. Doesn't look like the chkconfig config is respected by the mongod server.
ernie.hershey@10gen.com commented on Thu, 3 Jul 2014 19:03:15 +0000: Hi dharshanr@scalegrid.net - when you run "ps auwx | grep mongod" it's listing mongos because it's running as the "mongod" user. As you can see, there's no mongod process so chkconfig did indeed disable starting mongod. Do you have any other questions or problems that should be addressed in this ticket? You can generally get more help if you email the user group which has a wider audience of people who can help with issues like this. https://groups.google.com/forum/#!forum/mongodb-user dharshanr@scalegrid.net commented on Fri, 13 Jun 2014 00:53:08 +0000: Here you go [root@ip-172-31-36-150 ec2-user]# ps auwx | grep mongod root 1250 0.0 0.0 152344 1540 ? S Jun12 0:00 su -s /bin/bash mongodb-mms-agent -c /usr/bin/mongodb-mms-monitoring-agent -conf /etc/mongodb-mm config 218 1259 0.0 0.1 488296 8104 ? Ssl Jun12 0:02 /usr/bin/mongodb-mms-monitoring-agent -conf /etc/mongodb-mms/monitoring-agent.config mongod 1408 0.1 0.1 273692 11852 ? Sl Jun12 0:14 /usr/bin/mongos -f /etc/mongos.conf root 2548 0.0 0.0 110268 844 pts/0 S+ 00:47 0:00 grep mongod It's fairly confusing - why is mongos appearing as mongod? I hacked together the /etc/init.d script based on the mongod script. Killing this process and then running "service mongos start" appears to do the trick Here it my mongos start script #!/bin/bash mongos - Startup script for mongos chkconfig: 35 85 15 description: Mongo is a scalable, document-oriented database. processname: mongod config: /etc/mongos.conf pidfile: /var/run/mongo/mongos.pid . /etc/rc.d/init.d/functions things from mongod.conf get there by mongod reading it 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/mongos.conf" OPTIONS=" -f $CONFIGFILE" SYSCONFIG="/etc/sysconfig/mongos" FIXME: 1.9.x has a --shutdown flag that parses the config file and shuts down the correct running pid, but that's unavailable in 1.8 for now. This can go away when this script stops supporting 1.8. DBPATH=`awk -F= '/^dbpath=/ {print $2}' "$CONFIGFILE"` PIDFILE=`awk -F= '/^dbpath\s=\s/{print $2} ' "$CONFIGFILE"` mongos=/usr/bin/mongos MONGO_USER=mongod MONGO_GROUP=mongod if [ -f "$SYSCONFIG" ]; then . "$SYSCONFIG" fi Handle NUMA access to CPUs (SERVER-3574) This verifies the existence of numactl as well as testing that the command works NUMACTL_ARGS="--interleave=all" if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null then NUMACTL="numactl $NUMACTL_ARGS" else NUMACTL="" fi start() { echo -n $"Starting mongos: " daemon --user "$MONGO_USER" $NUMACTL $mongos $OPTIONS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mongos } stop() { echo -n $"Stopping mongos: " killproc -p "$PIDFILE" -d 300 /usr/bin/mongos restart ;; condrestart) [ -f /var/lock/subsys/mongos ] && restart || : ;; status) status $mongos RETVAL=$? ;; *) echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart} " RETVAL=1 esac exit $RETVAL ~ ramon.fernandez commented on Tue, 10 Jun 2014 22:22:24 +0000: Hi dharshanr@scalegrid.net, we still need more information to diagnose this ticket. If this is still an issue for you, can you please provide the information Ernie requested above? Thanks, Ramón. ernie.hershey@10gen.com commented on Wed, 28 May 2014 22:10:05 +0000: The symlinks under /etc/rc.d look like the chkconfig command did what it was supposed to. Can you run "ps auwx | grep mongod" and show the output? You can also run this to see if another script under /etc/init.d is starting it: grep -r mongod /etc/init.d Can you provide more detail on the MMS agent you have installed? How did you install it? What's the version? dharshanr@scalegrid.net commented on Wed, 28 May 2014 01:27:12 +0000: Here are the results after I disable the service and reboot. "service status mongod" says the service is stopped but the mongod process is running. [root@ip-10-251-86-194 ec2-user]# find /etc/ -name *mongod -ls 11939 4 rw-rr- 1 root root 47 May 16 16:58 /etc/sysconfig/mongod 5776 0 lrwxrwxrwx 1 root root 16 May 28 01:03 /etc/rc.d/rc2.d/K15mongod -> ../init.d/mongod 5808 0 lrwxrwxrwx 1 root root 16 May 28 01:03 /etc/rc.d/rc4.d/K15mongod -> ../init.d/mongod 11935 4 -rwxr-xr-x 1 root root 2342 May 16 16:58 /etc/rc.d/init.d/mongod 11953 0 lrwxrwxrwx 1 root root 16 May 28 00:35 /etc/rc.d/rc6.d/K15mongod -> ../init.d/mongod 11948 0 lrwxrwxrwx 1 root root 16 May 28 00:35 /etc/rc.d/rc1.d/K15mongod -> ../init.d/mongod 5820 0 lrwxrwxrwx 1 root root 16 May 28 01:03 /etc/rc.d/rc5.d/K15mongod -> ../init.d/mongod 5798 0 lrwxrwxrwx 1 root root 16 May 28 01:03 /etc/rc.d/rc3.d/K15mongod -> ../init.d/mongod 11947 0 lrwxrwxrwx 1 root root 16 May 28 00:35 /etc/rc.d/rc0.d/K15mongod -> ../init.d/mongod [root@ip-10-251-86-194 ec2-user]# pgrep mongod 1179 [root@ip-10-251-86-194 ec2-user]# service mongod status mongod is stopped ernie.hershey@10gen.com commented on Tue, 27 May 2014 21:35:44 +0000: Hm, we've basically done that and can't reproduce the problem yet. We'll keep trying but can you post the output of the command I mentioned? Can you also show the output of "ps" or the command you're using to tell that the process is running? dharshanr@scalegrid.net commented on Tue, 27 May 2014 20:58:42 +0000: That would be my guess as well. I have the mongodb monitoring agent installed on the box. If I do "service mongod status" it shows up as "stopped" but the mongod process is running. Is it possible that somehow the MMS agent is trigger the process manually. It is very simple to repro 1) Install mongod server, mongod shell, tools on box 2) Disable the mongod process - "chkconfig mongod off" 3) Reboot the box ernie.hershey@10gen.com commented on Tue, 27 May 2014 19:44:11 +0000: dharshanr@scalegrid.net - is it possible something other than the normal mongod init script is starting up mongod? To help troubleshoot, can you post the output of this command? find /etc/ -name \*mongod -ls