LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-07-2024, 09:49 AM   #1
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Mongodb refuses to start


I have installed allienbobs Mongodb package on Slackware 15.0. I have followed the instructions on this link:

https://alien.slackbook.org/blog/how...-on-slackware/

Here are the results:

Code:
root@duelie:~# /etc/rc.d/rc.mongodb start
about to fork child process, waiting until server is ready for connections.
forked process: 5818
ERROR: child process failed, exited with 1
To see additional information in this output, start without the "--fork" option.
MongoDB server failed to start, exiting now...
I edited /etc/mongod.conf and changed the "fork" to false, and receivd even less informaiton on what is wrong.

Here is the last error line from mongod.log.

Code:
{"t":{"$date":"2024-05-07T10:35:37.054-04:00"},"s":"I",  "c":"CONTROL",  "id":23330,   
82 "ctx":"main","msg":"ERROR: Cannot write pid file to {path_string}: {errAndStr_second}",
83 "attr":{"path_string":"/var/run/mongodb/mongod.pid","errAndStr_second":"No such file or directory"}}
Any help would be appreciated. I have no experience with data base programs.
 
Old 05-07-2024, 09:57 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
could it be you are missing the needed user:group to use the package?

if you haven't done it already and the user and group mongo are not already in your system (you can check with "grep mongo /etc/{passwd,group}") run these two commands
Code:
groupadd -g 285 mongo
useradd -g 285 -u 285 -M -d /var/lib/mongodb -s /bin/false mongo
then reinstall Alien Bob's package and try again to restart it via the rc script.
 
Old 05-07-2024, 10:04 AM   #3
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Original Poster
Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
The user and gropup got created by the install. I have check the presence of other files in /etc. I have a login.defs file, a mongod.conf file and a mongodb.conf file. User mongo I can log into from a shell. ( I think that is the way it is supposed to be.)

I have the deps installed Alienbob has posted.

Quote:
ls -l /var/lib/pkgtools/packages | grep python-cheetah3
-rw-r--r-- 1 root root 21K May 1 09:39 python-cheetah3-3.2.6-x86_64-1alien
(Tue May-5 11:18:52am)-(CPU 0.0%:0:Net 33)-(cliff:~)-(86M:199)
> ls -l /var/lib/pkgtools/packages | grep python-psutil
-rw-r--r-- 1 root root 9.6K May 1 09:40 python-psutil-5.6.7-x86_64-1alien
(Tue May-5 11:22:39am)-(CPU 0.0%:0:Net 34)-(cliff:~)-(86M:199)
> ls -l /var/lib/pkgtools/packages | grep python-yaml
-rw-r--r-- 1 root root 5.1K May 1 09:40 python-yaml-5.3.1-x86_64-1alien

Last edited by camorri; 05-07-2024 at 10:24 AM. Reason: fixed spelling
 
Old 05-07-2024, 10:33 AM   #4
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
I asked because the error shown is "Cannot write pid file to {path_string}" and "path_string":"/var/run/mongodb/mongod.pid","errAndStr_second":"No such file or directory": that could happen because the path /var/run/mongodb either doesn't exist or because it has not the right owner/permissions...
 
Old 05-07-2024, 10:39 AM   #5
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Original Poster
Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
You are correct, there was no mongodb dir in /var/run/. I have created it by root user, not sure who has to own it though. root:root ownership has not changed the result.
 
Old 05-07-2024, 10:46 AM   #6
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,118

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
Quote:
Originally Posted by camorri View Post
You are correct, there was no mongodb dir in /var/run/. I have created it by root user, not sure who has to own it though. root:root ownership has not changed the result.
then there's something wrong in the rc.mongodb you are using: it should create the directory itself and apply the correct ownership (mongo:mongo) and permissions.
I think you are using another rc.mongodb different from the one provided by the Alien Bob's package.

maybe the right one is called /etc/rc.d/rc.mongodb.new because when you installed Alien Bob's mongodb package there was already an /etc/rc.d/rc.mongodb present in your system.

Last edited by ponce; 05-07-2024 at 10:59 AM.
 
Old 05-07-2024, 11:24 AM   #7
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,679

Rep: Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796Reputation: 1796
or you can try to compare it with the one provided in SBo
 
Old 05-07-2024, 12:25 PM   #8
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Original Poster
Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
I created the dir, /var/run/mongodb and chown to mongo:mongo and:

Quote:
root@duelie:/var/run# /etc/rc.d/rc.mongodb start
about to fork child process, waiting until server is ready for connections.
forked process: 5054
child process started successfully, parent exiting
MongoDB server started successfully.
Thank-you all.
 
Old 05-07-2024, 02:31 PM   #9
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,533

Rep: Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515Reputation: 8515
Quote:
Originally Posted by camorri View Post
I created the dir, /var/run/mongodb and chown to mongo:mongo and:
Something to note is that /var/run is a symlink to /run, which is a tmpfs. When you reboot, the directory will no longer be there.

The usual solution for this is to have the rc script create the directory.
 
  


Reply

Tags
mongodb error, will not start



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: AWS DocumentDB not MongoDB-compatible, says MongoDB Inc LXer Syndicated Linux News 0 12-07-2021 06:05 AM
samba refuses to start on startup, but will start manually pepsimachine15 Linux - Software 8 04-20-2009 11:03 AM
Mandrake 10 - Geforce 5200 - X Refuses to Start houston1981 Mandriva 3 06-09-2004 05:03 PM
apache refuses to start after hostname change Mux Linux - Software 3 02-01-2004 01:13 AM
x refuses to start for root k4zau Linux - Software 8 10-16-2003 11:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration