Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

色んな方が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が全然原因のログを出してくれないのでちょっと手間取ってしまった。

harada4atsushi
mofmof inc.のエンジニア兼代表取締役。3日間で実際に動くWEBサービスを作る「いきなりMVP」と、月額制の受託開発やってます。Ruby on Railsが少し得意。三度の飯より小動物をもふもふするのが好き。週末の楽しみは一人お菓子パーティー。Rails/Atom/Ansible/Android
http://www.mof-mof.co.jp/
mof-mof
「つくって人をしあわせにする」をビジョンにAIチャットボットや開発チームレンタル等のサービスを提供している渋谷のIT企業です
https://www.mof-mof.co.jp/about
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした