Skip to content

redis daemon fail to start on Mac OS X High Sierra #45

@khoan

Description

@khoan

was working on Sierra, but broke after upgrade to High Sierra.

some salient details.

$ cat /var/log/system.log | grep io.redis 
...
...com.apple.xpc.launchd[1] (io.redis[68292]): Service could not initialize: 17B48: xpcproxy + 11572 [1522][7BE6B6AA-12DD-365C-A5C5-C8C8A2293D0B]: 0xd
... com.apple.xpc.launchd[1] (io.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
...
$ cat /Library/LaunchDaemons/io.redis.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>io.redis</string>
	<key>ProgramArguments</key>
	<array>
		<string>/opt/pkg/bin/redis-server</string>
		<string>/opt/pkg/etc/redis.conf</string>
	</array>
        <key>KeepAlive</key>
        <true/>
        <key>RunAtLoad</key>
        <true/>
	<key>StandardErrorPath</key>
        <string>/var/log/redis/error.log</string>
	<key>StandardOutPath</key>
	<string>/dev/null</string>
        <key>UserName</key>
        <string>redis</string>
</dict>
</plist>
$ sudo -u redis file /opt/pkg/bin/redis-server
/opt/pkg/bin/redis-server: Mach-O 64-bit executable x86_64
$ sudo -u redis file /var/log/redis/error.log
/var/log/redis/error.log: empty
$ dscacheutil -q user
...
name: redis
password: *
uid: 301
gid: 301
dir: /var/empty
shell: /usr/bin/false
gecos: redis
...
$ # remove /Library/LaunchDaemons/io.redis.plist and restart
$ sudo -u redis /opt/pkg/bin/redis-server /opt/pkg/etc/redis.conf
1151:M 29 Nov 14:17:30.363 * Increased maximum number of open files to 10032 (it was originally set to 256)
...
$ sudo launchctl limit maxfiles
	maxfiles    256            unlimited 
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 2128
virtual memory          (kbytes, -v) unlimited

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions