Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Brew services start and stop issue

I've got two services one is elasticsearch, the other is mongodb, recently I found the mongodb service have some issues while i start or stop it.

The case is while I start mongo with the following command when the mongodb service is actually stopped. brew services start mongodb, it shows me following errorCode but it was started ----------Error Code------------- /Users/attis/Library/LaunchAgents/homebrew.mxcl.mongodb.plist: service already loaded Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/attis/Library/LaunchAgents/homebrew.mxcl.mongodb.plist exited with 133.

while I stop mongo with the following command when the mongodb service is actually started. it shows me the following errorCode but it was stopped after it. ---------Error Code--------------- Error: Service mongodb is not started.

I'm not familliar with the launchctl mechanism. Could any one suggest to help me fix the annoying issue. especially while i start all services it will block all the following services that start after mongodb from getting started.

when started the picture also suggest with yellow warning

like image 983
Qingjian Wang Avatar asked Nov 17 '22 14:11

Qingjian Wang


1 Answers

I just had the same issue with RabbitMQ and the fix was intuitive - simply unload the plist manually. Not sure if it will fix Mongodb but worth a shot. In my case I did:

$ brew services start rabbitmq
/Users/XXXX/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist: service already loaded
Error: Failure while executing; `/bin/launchctl bootstrap gui/502 /Users/XXXX/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist` exited with 37.

$ launchctl unload /Users/XXXX/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist
$ brew services start rabbitmq
==> Successfully started `rabbitmq` (label: homebrew.mxcl.rabbitmq)
like image 148
Charlie Avatar answered Jan 17 '23 22:01

Charlie