Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@harada4atsushi

Mac OS X,homebrewでインストールしたredisが自動起動出来ない問題

色んな方がredisのインストール方法は書いてくれているので、概ねその通りやればいけるはずなのですが、なぜか自動起動しなかった。

手順は単純にこれ。ちなみにtmux上でlaunchctlを使うとうまくいかないので注意(前にどハマりした)。

$ brew install redis
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

こんな感じのログが出力されていた。

Feb 23 12:21:34 mac-mini com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 23 12:21:44 mac-mini com.apple.xpc.launchd[1] (homebrew.mxcl.redis[1959]): Service could not initialize: 15D21: xpcproxy + 12644 [1472][13E77DA5-3602-31BF-B074-49D4EE27E9D8]: 0xd
Feb 23 12:21:44 mac-mini com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 23 12:21:54 mac-mini com.apple.xpc.launchd[1] (homebrew.mxcl.redis[1961]): Service could not initialize: 15D21: xpcproxy + 12644 [1472][13E77DA5-3602-31BF-B074-49D4EE27E9D8]: 0xd
Feb 23 12:21:54 mac-mini com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

原因はこれ。ログファイルがroot権限になってた。

$ ls -l /usr/local/var/log/redis.log
-rw-r--r--  1 root  admin  46336  2 23 12:31 /usr/local/var/log/redis.log

一般ユーザーに権限を戻して再度lanchctl loadをかけたらちゃんと起動しました。

$ sudo chown username /usr/local/var/log/redis.log

lanchctlが全然原因のログを出してくれないのでちょっと手間取ってしまった。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
0
Help us understand the problem. What are the problem?