Why is spotifyd daemon failing to start - terminal

Every time I run the command brew services start spotifyd on my terminal, the error Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/homefolder/Library/LaunchAgents/homebrew.mxcl.spotifyd.plist` exited with 5. appears, preventing me from using the service.
I have tried:
sudo launchctl stop /Library/LaunchDaemons/rustlang.spotifyd.plist followed by sudo launchctl unload -w /Library/LaunchDaemons/rustlang.spotifyd.plist and then sudo launchctl load -w /Library/LaunchDaemons/rustlang.spotifyd.plist followed by sudo launchctl start /Library/LaunchDaemons/rustlang.spotifyd.plist and finally brew services restart spotifyd
But the issue remains

Well, I ended up finding a solution to the issue... running the command brew services restart spotifyd as root, meaning sudo brew services restart spotifyd actually allows for successful execution.

Related

Cannot start jenkins-lts on mac using homebrew

I am trying to install/run jenkins on a mac machine using homebrew. This is what I did
brew install jenkins-lts
On running this command. I see that jenkins-lts is installed and I see this message
Note: When using launchctl the port will be 8080.
To have launchd start jenkins-lts now and restart at login:
brew services start jenkins-lts.
Or, if you don't want/need a background service you can just run:
jenkins-lts
If I run jenkins-lts, Jenkins starts at port 8080 successfully. I can reach it from the browser.
If I run brew services start jenkins-lts . I see the message
Successfully started jenkins-lts (label:homebrew.mxcl.jenkins-lts)
But I cannot reach the server on port 8080. I tried checking the status of the service
I tried checking the status of the service brew services list
Name Status User Plist
jenkins-lts unknown ec2-user /Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist
I see that status is unknown.
After a while I see that this service is not listed anymore in the brew services list command. If I try to start it again. I see this message
/Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist: service already loaded
Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist exited
with 37
Where can I find the jenkins logs and how to get it working.
likely you have not configured you host setings
so after starting the service
use
http://127.0.0.1:8080/
not
http://localhost:8080/
This is my experience , brew services list showed up as :
Name Status User Plist
jenkins-lts error cskjk16 /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.#CD6R ~
and the fix was:
1. brew services stop jenkins-lts
2. brew services start jenkins-lts
and now brew services list showed up as :
Name Status User Plist
jenkins-lts started cskjk16 /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.#CD6R ~
My solution was to uninstall Jenkins using brew (brew uninstall jenkins-lts), followed by brew doctor, followed by brew clanup, and re-install jenkins (brew install jenkins-lts).
After, I was able to start Jenkins using brew services start jenkins-lts.
Your password will be available at $ cat /User/..../.jenkins/secrets/initialAdminPassword.
Use it to create the admin account and continue the configuration.
The issue here is that, macos was running as a dedicated host on AWS.
I was connected to this macos from my windows machine using putty and trying to run the command.
brew services start jenkins-lts
This does not work. I had to login to macos via some Remote Desktop client like VNC and then run the same command from the the terminal window of mac.
In some cases, there will be a pop up which you needs user input. Hence this did not work when I was connected via putty from my windows machine.
We had the same issues on MacBooks and this is what fixed it.
run this:
chmod u+w /usr/local/var/log
and then run this:
sudu chown -R $(whoami) /usr/local/var/log
then:
brew install jenkins-lts
and it worked

Can't stop or prevent apache server from launching on macOS Catalina

I have searched and tried a lot of solutions here and all over Google. My situation is as follows.
I just don't want Apache to be running.
1) localhost leads to "It works!" page
2) The command sudo apachectl stop results in:
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
3) sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist leads to the same output as in the number 2.
I was experiencing the same issue, based on this guide the following worked for me:
$ sudo apachectl stop
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

Cannot permanently disable httpd on Mac 10.14 Mojave after upgrade

I'm running Mojave on a Mac Pro. Prior to this version of the OS I used Apple's Server app to manage Apache/httpd. Now I can't seem to permanently kill or stop httpd. Something keeps it alive and restarts it even when I do the following as root...
launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
apachectl stop
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
apachectl -k stop
httpd (no pid file) not running
If I 'killall httpd' it just comes back. If I kill the main root httpd process in Activity Monitor, it comes right back. Restart the computer, it's still running.
I just want to permanently kill httpd so I can do an alternate installation, possibly with brew or on another machine. I don't want it running and I don't understand what keeps relaunching httpd on me.
The command you mentioned first works for me. I just added 'sudo'
local:~ mac$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
The solution explained in Answer 1 did not work for me when Mojave server.app was installed.
I had to use this:
sudo launchctl unload -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist

Why doesn't homebrew apache start at startup?

I’m trying to figure out why my apache doesn’t start at startup… (I would like for it to).
My OS: OSX Mojave
Impressions I’m under: that I’m running homebrew’s apache
Upon a fresh boot…
If I hit http://localhost in a browser I get
Unable to connect
Firefox can’t establish a connection to the server at localhost.
Fire up terminal…
$brew services list
returns
httpd started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.httpd.plist
php started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.php.plist
(That first line makes me think httpd is running and I should be able to hit localhost).
$which -a apachectl
returns
/usr/local/bin/apachectl
/usr/sbin/apachectl
then
$apachectl configtest
returns
Syntax OK
then
$sudo apachectl -V
returns (among other things)
-D SERVER_CONFIG_FILE="/usr/local/etc/httpd/httpd.conf"
(Isn’t this brew’s httpd.conf?)
There's a brew command (which I forget) that I already ran that is supposed to run httpd at startup.
Once I run
$sudo apachectl start
everything is jake. So it’s a low-priority question, but one I would like to solve and understand.
I had the same issue with Homebrew NGINX.
Running the brew services command with sudo solved the problem for me.
It appears that the Homebrew web-server packages require sudo to start | stop | restart.
Try running:
sudo brew services start apache2

Installing dnsmasq with Homebrew

I have installed dnsmasq using Homebrew. All seemed to go fine installing.
After installing I followed the instructions...
cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
The Problem:
dnsmasq doesn't seem to to bes working. When I run:
sudo dnsmasq
I get:
dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use
When I run:
sudo launchctl stop /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
I get:
launchctl stop error: No such process
Any ideas what is going on or how to tell if it is installed and running correctly?
launchctl stop takes a job label, not a path (same with launchctl's stop and list commands). Assuming the label is homebrew.mxcl.dnsmasq, you can check the daemon's status with sudo launchctl list homebrew.mxcl.dnsmasq (if it has a PID listed, it's running), and if necessary stop it with sudo launchctl stop homebrew.mxcl.dnsmasq. If that's not the right label, check in /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist for the string following the Label key.

Resources