question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Launch on startup no longer working on macOS

See original GitHub issue

Describe Your Problem: I had a working Homebridge setup that launched in the background when my Mac started. After running updates to my Homebridge setup (npm update for it and all plugins), this launch on startup stopped working.

The command launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist executed, but Homebridge does not start. It does start without issues manually in the Terminal. This command used to work.

Then I read about hb-service and removed my entire Homebridge setup to go with the new, easier route of sudo hb-service install but it didn’t start anything. The message did read:

ℹ Installing Homebridge Service
ℹ Starting Homebridge Service...
✔ Homebridge Started

Manage Homebridge by going to one of the following in your browser:

* http://localhost:8080
* http://192.168.2.2:8080
* http://[fe80::404:46fb:1125:232]:8080

Default Username: admin
Default Password: admin

✔ Homebridge Setup Complete

But nothing started. The .homebridge folder wasn’t created and Homebridge UI was not available. When doing sudo hb-service start it says:

ℹ Starting Homebridge Service...
/Library/LaunchDaemons/com.homebridge.server.plist: service already loaded
✔ Homebridge Started

After a manual homebridge it ran a cleanly installed Homebridge. I quit it and moved all config files back. So my setup is working again, but still not in the background.

Any idea how I can get it to launch on startup in the background?

Could it be related to this warning during installation? npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

Logs: hb-service logs gives:

✖ ERROR: Log file does not exist at expected location: /Users/Lex/.homebridge/homebridge.log

Environment:

  • Node.js Version: v12.16.1
  • NPM Version: 6.14.4
  • Homebridge Version: 0.4.53
  • Operating System: macOS 10.15.4
  • Process Supervisor: I wish I knew. I think it should be hb-service, but that’s not working

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:23 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
oznucommented, Mar 29, 2020

Strange, it’s managed to figure out the username, “Lex” for the username key, but hasn’t correctly resolved the home directory for that user.

During my testing of standard installs on Mojave and Catalina this worked fine.

Try this:

sudo hb-service uninstall
sudo hb-service install -U /Users/Lex/.homebridge
2reactions
oznucommented, Mar 29, 2020

In the homebridge-http-webhooks plugin config set the cache directory (the plugin should really just store files in the homebridge storage directory).

"platforms": [
  {
    "platform": "HttpWebHooks",
    "cache_directory": "/Users/Lex/.homebridge/http-webhooks"

And make that directory for good measure:

# do not use sudo
mkdir /Users/Lex/.homebridge/http-webhooks

Then restart.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If your Mac doesn't start up as expected - Apple Support
Blue startup screen​​ Restart your Mac in safe mode. If your Mac successfully starts up in safe mode, choose Apple menu > Restart...
Read more >
How to Fix a Mac Application That's Not Starting - Lifewire
Restart the Mac. It's always smart to start with the simplest fix possible. · Update the app. · Delete the app preference file...
Read more >
How to Stop Mac Apps From Launching at Startup - PCMag
The simplest way to disable an app from launching on startup is from the Dock. Right-click on the app and hover over Options...
Read more >
How to get apps to launch at system startup on Mac
Two more ways. 1) A quicker way to open apps on startup is to right-click on the app in Mac's Dock and choose...
Read more >
How to Stop, Change, or Remove Startup Items on Mac - Avast
How to stop Mac programs and apps from opening on startup · Click the Apple menu in the top-left corner and select System...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found