1

I want to start MongoDB (aka mondgod) as a service under FreeBSD. I have the following in rc.conf:

mongod_enable="YES" mongod_config="/usr/local/etc/mongodb.conf" mongod_dpath="/var/db/mongod" 

But service mongodb stop (and mongod) give me:

mongod does not exist in /etc/rc.d or the local startup directories (/usr/local/etc/rc.d), or is not executable 

I need the right startup script for /usr/local/etc/rc.d but I'm a MongoDB newbie. I have searched for a script, including on the MongoDB site, without success. I realize MongoDB on FreeBSD is not optimal, and not popular, but runs well enough for a non-production box. My FreeBSD version is 12.0-RELEASE. MongoDB version is v3.0.15

6
  • 1
    Is there a file called /usr/local/etc/rc.d/mongod? Probably not, in which case the package is not correctly installed. Use: pkg info to see what packages are installed on the machine. Commented Feb 7, 2019 at 9:52
  • pkg info does not list anything for mongodb. Apparently it was installed form source. Would running pkg add over mongodb installed from source cause problems? Commented Feb 10, 2019 at 1:14
  • Well, problem partly solved. Mongod doesn't have a freebsd version. The one installed on my machine was installed from source with the linux compatibility layer in place. Since mongodb isn't a freebsd application, it has no script for rc.d and pkg search doesn't have a package for it. I've been Googling for one. Apparently nobody has published such a thing. Bugzilla has a bug with a referance to a /usr/local/etc/rc.d/mongod script but I don't have it. Commented Feb 10, 2019 at 1:52
  • That version has since been deleted (the original rc.d script is probably this one). You may be able to adapt the rc.d script from the mongodb34 or mongodb36 ports. Commented Feb 10, 2019 at 11:50
  • Adapting this one looks probable. I'l tackle it tomorrow. Thanks. Commented Feb 12, 2019 at 0:03

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.