[SERVER-10871] starting mongodb as a service fails on ubuntu (precise) with new separated packages Created: 24/Sep/13  Updated: 11/Jul/16  Resolved: 04/Oct/13

Status: Closed
Project: Core Server
Component/s: Build, Packaging
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: Ernie Hershey
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu, precise 64


Issue Links:
Gantt Dependency
Operating System: Linux
Steps To Reproduce:

On a fresh vagrant vm:
1) vagrant ssh
2) sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
3) echo 'deb http://distro-deb2.build.10gen.cc/rebrand/ubuntu-upstart/ dist mongodb' | sudo tee /etc/apt/sources.list.d/mongodb.list
4) sudo apt-get update
5) sudo apt-get install mongodb-org-unstable
6) sudo service mongodb start

Expected result: mongodb service starts

Actual result:
vagrant@precise64:~$ sudo service mongodb start
mongodb: unrecognized service

Participants:

 Description   

vagrant@precise64:~$ sudo service mongodb start
mongodb: unrecognized service

Starting mongodb as a service does not work when installing new mongodb-org-unstable package from http://distro-deb2.build.10gen.cc/rebrand/ubuntu-upstart/. See "Steps to Reproduce" for more information.

It looks like the control script is missing: there is no /etc/init.d/mongodb.



 Comments   
Comment by carl [ 13/Nov/14 ]

Hi Ernie, looks like that might just be the issue. Thanks

Comment by Ernie Hershey [ 13/Nov/14 ]

Hi dogmatic69 - it looks like you may be installing the Ubuntu packages in Debian. What are the contents of /etc/apt/sources.list.d/mongodb.list on your system? Based on your uname, you should be using this page - http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/.

This ticket is quite old and probably not actually related to the problem you're having. You'll probably get more/better help if you post to the mongodb-user mailing list instead - https://groups.google.com/forum/#!forum/mongodb-user.

Comment by carl [ 13/Nov/14 ]

I just installed using the guide on the site and have the same issue. Not using unstable, just the latest stable

apt-get install mongodb-org

$ uname -a
Linux hostname.dh.bytemark.co.uk 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2 x86_64 GNU/Linux

$ mongo --version
MongoDB shell version: 2.6.5

$ ls -al /etc/init.d/mongod
lrwxrwxrwx 1 root root 21 Oct 8 18:25 /etc/init.d/mongod -> /lib/init/upstart-job

$ cat /etc/init.d/mongod
(nothing here)

The output from the install:

$ sudo apt-get install mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libaudio2 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libmng1 libmysqlclient18.1 libnet-daemon-perl liborc-0.4-0 libplrpc-perl libqt4-network libqt4-xml libqtcore4 libqtdbus4 libqtgui4 libqtwebkit4 ruby-trollop
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/115 MB of archives.
After this operation, 290 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 67628 files and directories currently installed.)
Unpacking mongodb-org-shell (from .../mongodb-org-shell_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org-server.
Unpacking mongodb-org-server (from .../mongodb-org-server_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org-mongos.
Unpacking mongodb-org-mongos (from .../mongodb-org-mongos_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org-tools.
Unpacking mongodb-org-tools (from .../mongodb-org-tools_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org.
Unpacking mongodb-org (from .../mongodb-org_2.6.5_amd64.deb) ...
Processing triggers for man-db ...
Setting up mongodb-org-shell (2.6.5) ...
Setting up mongodb-org-server (2.6.5) ...
insserv: script mongod is not an executable regular file, skipped!
Setting up mongodb-org-mongos (2.6.5) ...
Setting up mongodb-org-tools (2.6.5) ...
Setting up mongodb-org (2.6.5) ...

Comment by auto [ 01/Nov/13 ]

Author:

{u'username': u'shunwen', u'name': u'shunwen', u'email': u'hsiaoshunwen@gmail.com'}

Message: Fixed debian/init.d typo introduced by SERVER-10871

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/991e6a89e5b05b4c6adb5252cb7f803785742f8d

Comment by auto [ 04/Oct/13 ]

Author:

{u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}

Message: SERVER-10871 Change 'mongodb' to 'mongo' to mean the mongod process and service
Branch: master
https://github.com/mongodb/mongo/commit/09ffdcc9274e20b879710cdb5d1271a65e6c6470

Comment by Tyler Brock [ 30/Sep/13 ]

Given my recent discussion with Ernie it seems like the "--" is appropriate and necessary to ensure that start-stop-daemon does not interpret the flags for mongo as its own. However the chuid user is incorrect: mongod vs mongodb (which we decided with akshay was better). Starting mongod fails because the logging directory, etc give permissions to the mongodb user instead of mongod as we previously had it.

Comment by Tyler Brock [ 30/Sep/13 ]

Starting mongod still doesn't work with the latest packages.

It seems that there is an extra "--" in the init script exec line.

Comment by Ernie Hershey [ 26/Sep/13 ]

I think this has to do with the filename on the upstart config file, both in the repo and in the intermediate packaging staging directory packager.py and packager-enterprise.py use. I have a change I'm re-generating packages with now. I'll also put up a code review to see what changes I made after I get new packages generated.

Comment by Ernie Hershey [ 24/Sep/13 ]

Okay, thanks.

I'll look at this more.

Comment by David Storch [ 24/Sep/13 ]

"sudo service mongod start" also does not work. The mongodb init.d script is entirely missing, so I don't think it's a naming problem. The same problem does not appear on Redhat, so maybe it has to do with the code that was moved into the rpm/mongo-10gen-unstable.spec file as shown in the code review for the original server ticket (http://codereview.10gen.com/10571011).

See below for the uname and lsb_release output.

vagrant@precise64:~$ uname -a
Linux precise64 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

vagrant@precise64:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

Comment by Ernie Hershey [ 24/Sep/13 ]

Nice, thanks!

Can you include the output of 'uname -a' and 'lsb_release -a' in general to make it easier to correlate "precise" to "12.04" ? I always use numbers and forget which version is which. Also we'll have exact versions on record that way.

It should work as "mongod" instead of "mongodb" which is a change as part of SERVER-3579. If that works then I think all we need is documentation.

Comment by David Storch [ 24/Sep/13 ]

Discovered while performing testing for QA-223

Generated at Thu Feb 08 03:24:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.