You are not logged in.

#1 2018-08-07 23:36:38

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 80
Website

redis fails to start as unix socket does not get created

After today's redis upgrade from (4.0.10-1 -> 4.0.11-1) unixsocket is no longer created. This is reproducible across multiple identical hosts. I looked over the Redis Wiki  to see if something perhaps changed, but to no avail the documentation is the same.

From redis.conf

# unixsocket /tmp/redis.sock
unixsocket /run/redis/redis.sock
# unixsocketperm 700
unixsocketperm 770

Using systemd fails

# systemctl status -l redis
● redis.service - Advanced key-value store
   Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2018-08-07 16:25:22 PDT; 2min 53s ago
  Process: 471683 ExecStart=/usr/bin/redis-server /etc/redis.conf (code=exited, status=217/USER)
 Main PID: 471683 (code=exited, status=217/USER)

Aug 07 16:25:22 venus systemd[1]: Started Advanced key-value store.
Aug 07 16:25:22 venus systemd[471683]: redis.service: Failed to determine user credentials: No such process
Aug 07 16:25:22 venus systemd[471683]: redis.service: Failed at step USER spawning /usr/bin/redis-server: No such process
Aug 07 16:25:22 venus systemd[1]: redis.service: Main process exited, code=exited, status=217/USER
Aug 07 16:25:22 venus systemd[1]: redis.service: Failed with result 'exit-code'

If the specified redis unix socket is manually created manually starting redis with /usr/bin/redis-server /etc/redis.conf starts up just fine.

For reference here is the distributed systemd service file which I have tried playing around with to no avail.

[Unit]
Description=Advanced key-value store
After=network.target

[Service]
Type=simple
User=redis
Group=redis
ExecStart=/usr/bin/redis-server /etc/redis.conf
ExecStop=/usr/bin/redis-cli shutdown
CapabilityBoundingSet=
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
ProtectHome=true
NoNewPrivileges=true
RuntimeDirectory=redis
RuntimeDirectoryMode=755
LimitNOFILE=10032

[Install]
WantedBy=multi-user.target

I remember not too long ago there being some systemd updates that basically were overzealous systemd service security options and was reported as a bug for other services using a unix socket.

Offline

#2 2018-08-07 23:48:45

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 80
Website

Re: redis fails to start as unix socket does not get created

Quick update - it looks like going from the recent systemd update 239.0-2 -> 238.76-1 fixes the problem. If anyone else can confirm the same problem with redis or any other service that uses a unix socket maybe we should open a systemd bug for systemd 239.0 unless it is confirmed a bug with the Arch specific 239.0-2 release.

Offline

#3 2018-08-08 05:21:19

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 80
Website

Re: redis fails to start as unix socket does not get created

I don't really understand why redis was not starting earlier today, but went ahead and reinstalled latest systemd 239.0-2, reloaded daemon and restarted redis just to verify startup - it did.

Offline

#4 2018-08-09 12:49:44

caleb
Member
Registered: 2016-04-16
Posts: 14

Re: redis fails to start as unix socket does not get created

Same problem here today. Gitlab didn't come back up after a `pacman -Syu`, traced it to redis not starting, then to this. Forcing a re-install with `pacman -S systemd` did the trick.

Offline

#5 2018-08-10 07:38:15

ml
Member
From: Germany
Registered: 2014-06-21
Posts: 20

Re: redis fails to start as unix socket does not get created

Same problem with MariaDb today. Thanks to caleb, I figured that a deamon re-exec would solve this problem. (No reinstallation required)

systemctl daemon-reexec

Offline

Board footer

Powered by FluxBB