supervised systemd
在 Ubuntu Server 20.04 上,Redis (5.0.7) 设置为 on后不会启动/etc/redis/redis.conf
,但使用 . 手动运行时不会打印错误/usr/bin/redis-server /etc/redis/redis.conf
。
此外,当手动运行时,可能会发现它正在侦听 6379 端口netstat -tulpn
。
重现
作为根:
- 更新软件包并安装 Redis
apt update && apt install redis-server
- 上
/etc/redis/redis.conf
,将行更改supervised no
为supervised systemd
- 尝试使用
service redis-server restart
or重启 Redissystemctl restart redis
上述命令的输出是:
Job for redis-server.service failed because the control process exited with error code.
See "systemctl status redis-server.service" and "journalctl -xe" for details.
的输出systemctl status redis-server.service
是:
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-02-03 12:15:56 -03; 28s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 3851 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)
Feb 03 12:15:56 mywebsite.com systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 5.
Feb 03 12:15:56 mywebsite.com systemd[1]: Stopped Advanced key-value store.
Feb 03 12:15:56 mywebsite.com systemd[1]: redis-server.service: Start request repeated too quickly.
Feb 03 12:15:56 mywebsite.com systemd[1]: redis-server.service: Failed with result 'exit-code'.
Feb 03 12:15:56 mywebsite.com systemd[1]: Failed to start Advanced key-value store.
尝试重新启动 Redis 服务时不会打印任何日志/var/log/redis/redis-server.log
,但手动运行时会打印以下文本:
4231:C 03 Feb 2021 12:27:52.053 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4231:C 03 Feb 2021 12:27:52.053 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=4231, just started
4231:C 03 Feb 2021 12:27:52.053 # Configuration loaded
4232:M 03 Feb 2021 12:27:52.063 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.7 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 4232
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
4232:M 03 Feb 2021 12:27:52.065 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
4232:M 03 Feb 2021 12:27:52.065 # Server initialized
4232:M 03 Feb 2021 12:27:52.066 * Ready to accept connections
软件版本:
Redis 服务器 v=5.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=636cde3b5c7a3923
Ubuntu 20.04.2 LTS - 64 位
系统 245 (245.4-4ubuntu3.4)