Unable to install Mongodb on Ubuntu 14.04. (error “status: Unknown job: mongod”)

146 views
Skip to first unread message

RawCode

unread,
Apr 2, 2018, 3:34:24 AM4/2/18
to mongodb-user

I'm trying to install Mongodb for Ubuntu 14.04. I followed the official documentation on Mongodb installation from here - https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

I ran the following commands:-

  1. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
  2. echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
  3. sudo apt-get update
  4. sudo apt-get install -y mongodb-org

When I execute the command #4, I get this near the end of the output:

Setting up mongodb-org-server (3.6.3) ...
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
initctl: Unknown job: mongod
Setting up mongodb-org-mongos (3.6.3) ...
Setting up mongodb-org-tools (3.6.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb-org (3.6.3) ...


After this when I run sudo service mongod start I get:

start: Unknown job: mongod


And running mongo results in:-

MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
2018-03-30T12:45:43.635+0530 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-03-30T12:45:43.635+0530 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed


mongo --version results in:-


MongoDB shell version v3.6.3
git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1404
    distarch: x86_64
    target_arch: x86_64


Both /var/log/mongodb and /var/lib/mongodb are empty folders.


I've uninstalled this using instructions on the same docs page linked above, and reinstalled it. No change.


Can't believe official instructions fail and I can't find solution for this anywhere.

Wan Bachtiar

unread,
Apr 2, 2018, 9:40:43 PM4/2/18
to mongodb-user

invoke-rc.d: policy-rc.d denied execution of start.

Hi,

Please check the content of policy-rc.d file (commonly located in /usr/sbin/policy-rc.d). This file contains the policy layer of the local system (i.e. your admin, or docker image author) installation for debian/ubuntu services.

Based on the output of the above, it looks like it prevented mongod to be installed and executed. You can try to change the exit code of policy-rc.d to exit 0 to remove the error. See also Debian: invoke-rc.d and policy-rc.d for more information.

And running mongo results in:-

The output result here indicates that there is no mongod running for mongodb://127.0.0.1:27017 and available for connection. Hence the connect failed message.

If you have further question, could you provide:

  • Content of of policy-rc.d
  • Is this an ubuntu 14.04 via a docker image ?

Regards,
Wan.

Reply all
Reply to author
Forward
0 new messages