Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20208

service returns 'stopped' for mongod even when running on Ubuntu

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Packaging
    • Labels:
      None
    • ALL
    • Hide
      1. Install Ubuntu 12.04
      2. Follow the documented steps per the Manual - http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu/
      3. Issue the command "sudo service mongod start"
      4. Issue the command "sudo service mongod status"
      Show
      Install Ubuntu 12.04 Follow the documented steps per the Manual - http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu/ Issue the command "sudo service mongod start" Issue the command "sudo service mongod status"

      Hi All,

      On the Community version of MongoDB version 2.6 when installed on Ubuntu the service command status returns stop/waiting even when the daemon is running correctly. The Enterprise 2.6 version correctly returns that the daemon is running.

      Issuing the command:

      $ sudo service mongod start
      

      followed by:

      $ sudo service mongod status
      mongod stop/waiting
      

      /etc/init/mongod.conf

      # Ubuntu upstart file at /etc/init/mongod.conf
       
      # Recommended ulimit values for mongod or mongos
      # See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
      #
      limit fsize unlimited unlimited
      limit cpu unlimited unlimited
      limit as unlimited unlimited
      limit nofile 64000 64000
      limit rss unlimited unlimited
      limit nproc 32000 32000
       
      kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
       
      pre-start script
          mkdir -p /var/lib/mongodb/
          mkdir -p /var/log/mongodb/
      end script
       
      start on runlevel [2345]
      stop on runlevel [06]
       
      script
        ENABLE_MONGOD="yes"
        CONF=/etc/mongod.conf
        DAEMON=/usr/bin/mongod
        DAEMONUSER=${DAEMONUSER:-mongodb}
       
        if [ -f /etc/default/mongod ]; then . /etc/default/mongod; 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="$(which numactl) -- $NUMACTL_ARGS"
          DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF"}
        else
          NUMACTL=""
          DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
        fi
       
        if [ "x$ENABLE_MONGOD" = "xyes" ]
        then
          exec start-stop-daemon --start --chuid $DAEMONUSER --exec $NUMACTL $DAEMON $DAEMON_OPTS
        fi
      end script
      

      /etc/apt/sources.list.d/mongodb.list

      deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
      

      Thanks!
      Eoin

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            eoin.brazil@mongodb.com Eoin Brazil
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: