#45434 closed enhancement (fixed)
base should create var/log, var/run and other common directories
Reported by: | p.perroud@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 2.3.5 |
Component: | base | Version: | |
Keywords: | haspatch | Cc: | ryandesign (Ryan Carsten Schmidt) |
Port: |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
mongodb is building fine on yosemite with macports 2.3.2 but refuses to connect:
$ mongo MongoDB shell version: 2.6.5 connecting to: test 2014-10-18T08:00:52.404+0200 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused 2014-10-18T08:00:52.405+0200 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146 exception: connect failed
A pretty generic error that does'nt mean much but this port was not configured correctly at installation time.
No log written to /opt/local/var/log/mongodb/
But this trace in system.log:
Oct 18 08:09:11 iMac27.local sudo[4559]: root : TTY=unknown ; PWD=/ ; USER=pperroud ; COMMAND=/opt/local/bin/mongod --dbpath /opt/local/var/db/mongodb --logpath /opt/local/var/log/mongodb/mongodb.log --logappend Oct 18 08:09:11 iMac27 com.apple.xpc.launchd[1] (org.macports.mongodb): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Attachments (1)
Change History (13)
comment:1 Changed 10 years ago by p.perroud@…
comment:2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|---|
Owner: | changed from macports-tickets@… to ryandesign@… |
comment:3 Changed 10 years ago by knightcode (Dylan)
I also edited org.macports.mongodb.plist, but I changed it just to use the --config option and refer to settings in /opt/local/etc/mongo/mongod.conf.
I also chown'ed the data directory to _mongo:wheel (I use a custom location) as an alternative
comment:4 Changed 10 years ago by moderndeveloperllc (Mark Garrett)
On a contrary note, I am not having any issues. I uninstalled mongodb
along with the other ports. Reinstalled my Macports binary from the dmg, and made sure I had Xcode 6.1 command line tools installed. I actually did a port install
and installed all my requested ports (port echo requested | cut -d ' ' -f 1 > requested.txt
) instead of all the installed ports.
I even restarted. I can connect fine from the command line and from the PHP driver on my install. Have y'all followed all the steps on wiki:Migration? Doing sudo port -f uninstall installed
does not remove any data, but the binaries and libraries and it's a requirement. Another issue might have been using Xcode before 6.1. That was causing many issues with various ports.The reason I bring this up is that after I first upgraded to Yosemite - but before I did all the uninstall/reinstall work, I had the same issue you describe.
comment:5 Changed 10 years ago by p.perroud@…
In my case it was a new install on a new mac therefore it was not a migration. I was using XCode 6.0.1 because 6.1 was not released yet. Most importantly you said you had uninstalled then re-installed with new port app - etc. Which seems to confirm my initial statement: the issue in my case was the _mongo user that was not created with sudo right set. The only change I've made to make it works - replacing _mongo by root user in the plist file - proves something in my opinion...
comment:6 Changed 10 years ago by moderndeveloperllc (Mark Garrett)
I think I found the issue. It's not in the mongo port - it's somewhere else I think. The problem is that /opt/local/var/log
is getting created by some port with a 0744
permission as opposed to the proper 0755
. This means that the _mongo user can't get down to the /opt/local/var/log/mongodb
directory to store it's logs. This means that mongod
does not launch.
As soon as I did
sudo chmod 755 /opt/local/var/log/
the mongod
instance started and I was able to connect.
comment:7 follow-up: 10 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign@… added |
---|---|
Component: | ports → base |
Owner: | changed from ryandesign@… to macports-tickets@… |
Port: | mongodb removed |
Summary: | mongodb refuses to connect on yosemite → base should create var/log, var/run and other common directories |
Type: | defect → enhancement |
Seems like MacPorts itself should take on the responsibility of creating common directories like ${prefix}/var/log and ${prefix}/var/run. As it is now, prefix.mtree.in only creates ${prefix}/var, not anything inside it.
Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | prefix.mtree.in.diff added |
---|
comment:8 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | haspatch added |
---|
Attached patch proposes adding cache, db, log, run, and spool directories to the var directory, based on directories I found on my system from my installed ports.
comment:10 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Milestone: | → MacPorts Future |
---|
Replying to ryandesign@…:
Seems like MacPorts itself should take on the responsibility of creating common directories like ${prefix}/var/log and ${prefix}/var/run.
Still don't know which port created it with 744 permissions on your system...
comment:11 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | new → closed |
I'll call this good enough, because if the problem did indeed come from a port, then the problem will resolve itself once a new version of MacPorts containing r135998 is released and the affected port is rebuilt.
comment:12 Changed 8 years ago by jmroot (Joshua Root)
Milestone: | MacPorts Future → MacPorts 2.3.5 |
---|
I was able to address the issue by editing the org.macports.mongodb.plist file — changing -u param to root as _mongo is not a sudoer...