Redis for Mac 开机自启动

在/Library/LaunchDaemons下新建com.redis.plist

com.redis.plist内容如下:





        Label
        com.redis
        RunAtLoad
        
        ProgramArguments
        
                /usr/local/bin/redis-server
        


sudo launchctl load /Library/LaunchDaemons/com.redis.plist

如果提示:

/Library/LaunchDaemons/com.redis.plist: Path had bad ownership/permissions

那么就是说权限不够
可以采用执行下面的命令

sudo chown root /Library/LaunchDaemons/com.redis.plist

最后:

sudo launchctl start com.redis

重启电脑试试吧

你可能感兴趣的:(Redis for Mac 开机自启动)