おいちゃんと呼ばれています

ウェブ技術や日々考えたことなどを綴っていきます

launchctl load xxx.plist すると Permission denied って言われてつらいときの対処

Mac を起動するたびにミドルウェア(例えば Redis とか)を起ち上げるのが面倒なので、LaunchAgents を使うじゃないですか。

そうしたら、下記のエラーが出たのでメモしておきます。

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Could not open job overrides database at: /private/var/db/launchd.db/com.apple.launchd/overrides.plist: 13: Permission denied
launch_msg(): Socket is not connected

tmux 上からコマンド打ったのが原因でした

Permission denied launching agent on OS X 10.8 · Issue #86 · defunkt/dotjs

Figured it out. I was running the command from within tmux. It needs to be run from Terminal.app for the permissions to work out.

要は tmux じゃなくて、素のターミナルとか(iTerm でも OK)から実行すればいけました。

以下、おまけ

brew services は終わるらしい

そういえば、LaunchAgents じゃなくて、Homebrew のコマンドでバックグラウンドで動かすやつあったなーと思いまして。

初めて打ってみたら既にオワコンでした。\(^O^)/

$ brew services list
Warning: brew services is unsupported and will be removed soon.
You should use launchctl instead.
Please feel free volunteer to support it in a tap.

Warning: No user-space services controlled by `brew services` running...

終了の理由は、もうメンテナンスできないかららしい。

LaunchRocket というのもあるらしい

LaunchRocket - Homebrewでインストールしたサービスの起動/終了管理設定パネル MOONGIFT

いろいろありますなー。

f:id:inouetakuya:20181224103837p:plain