-
Notifications
You must be signed in to change notification settings - Fork 24.6k
[BUG] No error when systemd configured but not compiled #7735
Description
Describe the bug
If you setup Redis with systemd but you use a binary that was not compiled with systemd support, there is no clear error in the log. Info command does not show if the systemd support was compiled or not. I would prefer that Redis would log an error that the systemd support must be compiled if you use supervised systemd.
https://serverfault.com/questions/1031891/redis-service-hangs-with-systemctl-and-type-notify
To reproduce
Compile Redis without systemd support.
redis.service
[Service]
Type=notify
ExecStart=/opt/redis/bin/redis-server /opt/redis/conf/redis-master.conf
TimeoutStartSec=60
TimeoutStopSec=60
RestartSec=5s
Restart=on-success
redis-master.conf
daemonize no
supervised systemd
When I run this service, the Redis process starts but the systemctl hangs and I have to press Ctrl-C to get back to shell. This is in the logs:
69486:C 28 Aug 2020 17:31:14.545 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=69486, just started
69486:C 28 Aug 2020 17:31:14.545 # Configuration loaded
69486:C 28 Aug 2020 17:31:14.545 # WARNING supervised by systemd - you MUST set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.
69486:M 28 Aug 2020 17:31:14.546 * Increased maximum number of open files to 4096 (it was originally set to 1024).
69486:M 28 Aug 2020 17:31:14.547 * Running mode=standalone, port=6380.
69486:M 28 Aug 2020 17:31:14.547 # Server initialized
Expected behavior
Redis shall log that supervised systemd requires libsystemd support to be compiled in.
Additional information
Any additional information that is relevant to the problem.