{"id":574,"date":"2018-02-15T00:25:57","date_gmt":"2018-02-15T06:25:57","guid":{"rendered":"http:\/\/www.schwie.com\/brad\/?p=574"},"modified":"2018-08-10T23:10:26","modified_gmt":"2018-08-11T05:10:26","slug":"homebridge-launchagents-and-launchdaemons","status":"publish","type":"post","link":"https:\/\/www.schwie.com\/brad\/?p=574","title":{"rendered":"Homebridge, LaunchAgents, and LaunchDaemons!"},"content":{"rendered":"<p>Thanks to Homebridge, I&#8217;ve forced a few non-Homekit devices in the house to play with the existing HomeKit devices in our house. Along the way, I followed <a href=\"https:\/\/github.com\/nfarina\/homebridge\/wiki\/Install-Homebridge-on-macOS\">nfarina&#8217;s advice<\/a> to make a LaunchAgent for macOS Sierra, but I&#8217;m running macOS Sierra Server and I noticed Console.app-&gt;system.log keeps reporting the following errors<\/p>\n<p><code>Feb 15 00:04:33 schwie com.apple.xpc.launchd[1] (com.homebridge.server): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.<\/code><br \/>\n<code>Feb 15 00:04:43 schwie com.apple.xpc.launchd[1] (com.homebridge.server[62564]): Service could not initialize: 17C205: xpcproxy + 11572 [1522][1729AB5E-4591-3F1B-AC72-36700ABA4F74]: 0xd<\/code><\/p>\n<p>I first installed HomeBridge a couple years ago, so nfarina&#8217;s instructions may be different from what I followed. I also perused <a href=\"https:\/\/treefort54.com\/mies\/thread-2467-post-15869.html\">these posts<\/a> and decided I could try to fix the situation:<\/p>\n<p>1. Unload the existing LaunchAgent you created as described by nfarina:<\/p>\n<p style=\"text-align: left;\"><code>launchctl unload ~\/Library\/LaunchAgents\/com.homebridge.server.plist<\/code><\/p>\n<p>2. Move the LaunchAgent .plist you created for HomeBridge from the ~\/Library\/LaunchAgents folder to the \/Library\/LaunchDaemons folder.<\/p>\n<p>3. Load the LaunchDaemon for HomeBridge with the following command in Terminal:<\/p>\n<p style=\"text-align: left;\"><code>sudo launchctl load -wF \/Library\/LaunchDaemons\/com.homebridge.server.plist<\/code><\/p>\n<p>This seems to fix the problem for me, although step #3 causes system.log to spew out this message:<\/p>\n<p><code>Feb 15 00:12:01 schwie com.apple.xpc.launchd[1] (com.homebridge.server): This service is defined to be constantly running and is inherently inefficient.<\/code><\/p>\n<p>Console.app only reports this error message once, so I think I can live with my inherently inefficient situation for a little while.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thanks to Homebridge, I&#8217;ve forced a few non-Homekit devices in the house to play with the existing HomeKit devices in our house. Along the way, I followed nfarina&#8217;s advice to make a LaunchAgent for macOS Sierra, but I&#8217;m running macOS &hellip; <a href=\"https:\/\/www.schwie.com\/brad\/?p=574\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-574","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts\/574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=574"}],"version-history":[{"count":13,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts\/574\/revisions"}],"predecessor-version":[{"id":580,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=\/wp\/v2\/posts\/574\/revisions\/580"}],"wp:attachment":[{"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.schwie.com\/brad\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}