remysaissy / mongodb-macosx-prefspane

MacOSX Preferences pane for MongoDB
GNU Lesser General Public License v3.0
225 stars 25 forks source link

Cannot start MongoDB #10

Open Mange opened 12 years ago

Mange commented 12 years ago

Hi,

I realize most of the information here is useless for debugging. Help me collect information for you. I cannot figure out how to debug this further.

I installed the prefpane and could not start the instance. I started the Lingon program to edit my launchctl files and noticed that it had not migrated my plist since I wasn't using the one that comes with Homebrew. It's exactly the same commandline and all, I just modified the name.

Here's the commandline:

/usr/local/bin/mongod run --config /usr/local/etc/mongod.conf

So I tried editing the one that was created by the prefpane to use the same commandline. That didn't work.

I then removed all plists about MongoDB, loaded the ones from the Homebrew install like the instructions and then started the prefpane again. The plist was now migrated. Still no go.

I try starting from the commandline using launctl start com.remysaissy.mongodbprefspane, but the server does not come up. The logs are not touched.

I've unloaded, loaded, started, stopped, changed, etc. until my head hurts. I cannot understand why it's not starting up. Starting up manually using the same commandline as in the plist works normally.


› mongod --version # Installed with Homebrew
db version v2.0.2, pdfile version 4.5
Wed Aug  8 10:00:00 git version: 514b122d308928517f5841888ceaa4246a7f18e3
› uname -v
Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
Mange commented 12 years ago

I re-added the homebrew plist and it works like it should. Here's the diff (ignoring whitespace with -w):

--- homebrew.mxcl.mongodb.plist 2012-08-08 10:01:46.000000000 +0200
+++ com.remysaissy.mongodbprefspane.plist   2012-08-08 10:04:24.000000000 +0200
@@ -2,8 +2,10 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+   <key>KeepAlive</key>
+   <false/>
   <key>Label</key>
-  <string>homebrew.mxcl.mongodb</string>
+   <string>com.remysaissy.mongodbprefspane</string>
   <key>ProgramArguments</key>
   <array>
     <string>/usr/local/bin/mongod</string>
@@ -13,15 +15,13 @@
   </array>
   <key>RunAtLoad</key>
   <true/>
-  <key>KeepAlive</key>
-  <false/>
-  <key>UserName</key>
-  <string>mange</string>
-  <key>WorkingDirectory</key>
-  <string>/usr/local</string>
   <key>StandardErrorPath</key>
   <string>/usr/local/var/log/mongodb/output.log</string>
   <key>StandardOutPath</key>
   <string>/usr/local/var/log/mongodb/output.log</string>
+   <key>UserName</key>
+   <string>mange</string>
+   <key>WorkingDirectory</key>
+   <string>/usr/local</string>
 </dict>
 </plist>

No real differences there. It must be something with the prefpane, or something. I don't get it.

remysaissy commented 12 years ago

Hi Mange, do you know if the migrated plist has started (or at least tried to) with the UserName mange?

Mange commented 12 years ago

Is there a good way to test this? Changing the command to whoami > /tmp/test?

remysaissy commented 11 years ago

Sorry, I didn't see your message before. yes, whoami would do the job. Replace mongod by whoami in the launchd plist.

Mange commented 11 years ago

I changed the command to bash -c "whoami > /tmp/test" and it contains mange.