Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

[Solved] mongod: unrecognized service

Help for Current Versions of MX
Post Reply
Message
Author
User avatar
creationspirit
Forum Novice
Forum  Novice
Posts: 2
Joined: Sun Sep 16, 2018 1:04 am

[Solved] mongod: unrecognized service

#1 Post by creationspirit » Sun Sep 16, 2018 1:24 am

I recently installed mongodb-org package officially supported by MongoDB team following these instructions:

https://docs.mongodb.com/manual/tutoria ... on-debian/

Afterwards, when I tried to start mongo service with

Code: Select all

sudo service mongod start
it says

Code: Select all

mongod: unrecognized service
.

I went looking for a file and found out that there is no mongod start script in /etc/init.d/, but there is mongod.service file in /lib/systemd/system/. The contents of this file are:

Code: Select all

[Unit]
Description=MongoDB Database Server
After=network.target
Documentation=https://docs.mongodb.org/manual

[Service]
User=mongodb
Group=mongodb
EnvironmentFile=-/etc/default/mongod
ExecStart=/usr/bin/mongod --config /etc/mongod.conf
PIDFile=/var/run/mongodb/mongod.pid
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false

# Recommended limits for for mongod as specified in
# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings

[Install]
WantedBy=multi-user.target
Is there a solution to this? I also had the same problem installing expressvpn client from official stable repository but decided to setup connection manually with openvpn as I thought this was a freak case. But apparently it is not.
Last edited by creationspirit on Mon Sep 17, 2018 8:16 pm, edited 2 times in total.

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1473
Joined: Wed Apr 11, 2018 5:09 pm

Re: mongod: unrecognized service

#2 Post by fehlix » Sun Sep 16, 2018 6:39 am

Hmme...,
installing mangodb-server version 3.2.11 from with MX Package Installer.

Code: Select all

$ LANG=C apt policy mongodb-server
mongodb-server:
  Installed: 1:3.2.11-2+deb9u1
  Candidate: 1:3.2.11-2+deb9u1
  Version table:
 *** 1:3.2.11-2+deb9u1 500
        500 http://ftp.de.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status
I do have /etc/init.d/mongodb

Code: Select all

$ apt-file search /etc/init.d/mongodb
mongodb-server: /etc/init.d/mongodb
and checking wit sysv-rc-conf
it shows me it's running nicely

Code: Select all

┌ SysV Runlevel Config   -: stop service  =/+: start service  h: help  q: quit ────┐
│                                                                                  │
│ service      1       2       3       4       5       0       6       S           │
│ ----------------------------------------------------------------------------     │
│ mongodb     [ ]     [X]     [X]     [X]     [X]     [ ]     [ ]     [ ]          │
│ motd        [X]     [X]     [X]     [X]     [X]     [ ]     [ ]     [ ]          │
│ network-m$  [ ]     [X]     [X]     [X]     [X]     [ ]     [ ]     [ ]          │
│ networking  [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [X]          │
│ ntp         [ ]     [X]     [X]     [X]     [X]     [ ]     [ ]     [ ]          │
│ openvpn     [ ]     [X]     [X]     [X]     [X]     [ ]     [ ]     [ ]          │
│ procps      [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [X]          │
│ rc.local    [ ]     [X]     [X]     [X]     [X]     [ ]     [ ]     [ ]          │
│ reboot      [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]          │
│ resolvconf  [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [X]          │
│                                                                                  │
└──────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────┐
│ Use the arrow keys or mouse to move around.      ^n: next pg     ^p: prev pg     │
│                        space: toggle service on / off                            │
└──────────────────────────────────────────────────────────────────────────────────┘
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
creationspirit
Forum Novice
Forum  Novice
Posts: 2
Joined: Sun Sep 16, 2018 1:04 am

Re: mongod: unrecognized service

#3 Post by creationspirit » Mon Sep 17, 2018 4:59 am

Yes, this unofficial version from debian repositories aka. 'mongodb' package works. But, I tried to install 'mongodb-org' a package maintained by MongoDB team which is not in debian stable repositories, (i think its version 4.0.2).

Anyway, I figured out a hack. It is not a solution, but its a hack that works :happy: First I installed mongodb package from debian stable. Then I installed mongodb-org and package manager automatically deleted mongodb package because of conflict. But it seems that the service startup script remained because now I can start mongodb service and it starts version 4.0.2 from mongodb-org package. The only difference is that the service is called mongodb, not mongod. This didn't produce any bugs yet, it works...

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1473
Joined: Wed Apr 11, 2018 5:09 pm

Re: mongod: unrecognized service

#4 Post by fehlix » Mon Sep 17, 2018 5:45 am

Great, you found a solution.
Please mark this thread as [Solved] within the subject line of your first post.
Thanks.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Post Reply

Return to “MX Help”