When installing redis from source, the default etc/redis/redis.conf includes the following line:
supervisedsystemd
which results in the following error when trying to start redis-server:
*** FATAL CONFIG FILE ERROR (Redis 7.0.12) ***
Reading the configuration file, at line 327
>>> 'supervisedsystemd'
Bad directive or wrong number of arguments
The above line in etc/redis/redis.conf is missing space:
supervised systemd
Comment From: hwware
Hi @ramblehead ,
Thank you for reporting the issue, as per the 7.0 code it's having space as expected. here is the reference : https://github.com/redis/redis/blob/8e73f9d34821a937165884f13a2981883f44a074/redis.conf#L316C1-L316C1
also in my mchines /etc/redis/redis.conf it's supervised is auto:
# When Redis is supervised by upstart or systemd, this parameter has no impact.
daemonize yes
# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
# supervised no - no supervision interaction
# supervised upstart - signal upstart by putting Redis into SIGSTOP mode
# requires "expect stop" in your upstart job config
# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
# on startup, and updating Redis status on a regular
# basis.
# supervised auto - detect upstart or systemd method based on
# UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
# They do not enable continuous pings back to your supervisor.
#
# The default is "no". To run under upstart/systemd, you can simply uncomment
# the line below:
#
supervised auto
# If a pid file is specified, Redis writes it where specified at startup
# and removes it at exit.
Will check on my machine again by re-installing and confirm. If possible can you give the steps you followed that would be easy for me to reproduce.
Comment From: hwware
Re-installed the server but still not seeing as you have observed.
:~$ sudo apt-get -y install redis-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
redis-tools
Suggested packages:
ruby-redis
The following NEW packages will be installed:
redis-server redis-tools
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/1615 kB of archives.
After this operation, 9397 kB of additional disk space will be used.
Selecting previously unselected package redis-tools.
(Reading database ... 134991 files and directories currently installed.)
Preparing to unpack .../redis-tools_6%3a7.0.12-1rl1~jammy1_amd64.deb ...
Unpacking redis-tools (6:7.0.12-1rl1~jammy1) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../redis-server_6%3a7.0.12-1rl1~jammy1_amd64.deb ...
Unpacking redis-server (6:7.0.12-1rl1~jammy1) ...
Setting up redis-tools (6:7.0.12-1rl1~jammy1) ...
Setting up redis-server (6:7.0.12-1rl1~jammy1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning candidates...
Scanning linux images...
Restarting services...
Service restarts being deferred:
/etc/needrestart/restart.d/dbus.service
systemctl restart docker.service
systemctl restart getty@tty1.service
Comment From: ramblehead
Hi @hwware
Thank you for the quick reply!
I am using my custom helper scripts to run installation process: https://github.com/ramblehead/rhpm/tree/master/packages/redis/.project
It stooped working for me at around 7.0.11 and I presumed that it was an upstream bug, so I reported it here.
My presumption was wrong - the bug is at my side. At some stage I changed the script lines from:
CMD=(sed -i -E)
CMD+=("'s/^#*\s*(supervised\s+).*/\1systemd/'")
CMD+=("/usr/local/stow/${STOW_NAME}/etc/redis/redis.conf")
echo + "${CMD[@]}" && eval "${CMD[@]}"
to
CMD=(sed -i -E)
CMD+=("'s/^#*\s*(supervised)\s+auto\$/\1systemd/'")
CMD+=("/usr/local/stow/${STOW_NAME}/etc/redis/redis.conf")
echo + "${CMD[@]}" && eval "${CMD[@]}"
Where "\s+" escaped the regex capture making sed erasing the space.
Thank you for your answer and apology for my confusion.