Project

General

Profile

Support #9113

Alpine 3.8 Redis 4.0.10 package misses some important configuration

Added by Tu Nguyen 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
07/19/2018
Due date:
% Done:

100%

Estimated time:

Description

I use Alpine Linux 3.8 Docker image to install Redis 4.0.10.
I found /etc/redis.conf file misses "daemonize no" so Redis Server can't not start.


Related issues

Related to Alpine Linux - Bug #9146: redis should start successfully when using the default redis.conf fileResolved2018-07-28

Has duplicate Alpine Linux - Bug #9080: Redis package errorClosed2018-07-13

Associated revisions

Revision c4d4e9aa (diff)
Added by Jakub Jirutka 6 months ago

main/redis: create /run/redis if OpenRC is not present

Fixes #9146 <https://bugs.alpinelinux.org/issues/9146>
Fixes #9113 <https://bugs.alpinelinux.org/issues/9113>

History

#1 Updated by Tu Nguyen 6 months ago

Nobody cares about this broken package?

# Alpine 3.7

################################# GENERAL #####################################

# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
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
#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
#   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 liveness pings back to your supervisor.
supervised no
# Alpine 3.8

################################# GENERAL #####################################

# 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
#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
#   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 liveness pings back to your supervisor.
supervised no

#2 Updated by Jakub Jirutka 6 months ago

  • Status changed from New to Feedback
  • Priority changed from High to Normal

The redis package is not broken, it works perfectly well on normal Alpine installation. Actually the current default should work better even inside Docker, where you're supposed to run just a single process (that does not fork into background itself). Anyway, if you have different requirements, you can always adjust the configuration for your own needs or just start redis with --daemonize yes.

This is what's done in the OpenRC init script (just opposite, --daemonize no) and that's why it's removed from the default config, to not confuse users -- daemonize set in the config is ignored when started using init script.

#3 Updated by Jakub Jirutka 6 months ago

  • Tracker changed from Bug to Support

#4 Updated by Jakub Jirutka 6 months ago

I've just verified that Redis starts without any problem even when I remove --daemonize no from the init script (and it starts in foreground), i.e. this directive is not required in the configuration file.

#5 Updated by Tu Nguyen 6 months ago

Alpine 3.8

# apk update

# apk add redis

# redis-server /etc/redis.conf

Redis Server can not run, it works perfectly on Alpine 3.7.

It must have something wrong in redis.conf!

#6 Updated by Tu Nguyen 6 months ago

After I use redis.conf from Alpine 3.7, Redis Server run on Alpine 3.8

#7 Updated by Dave Hall 6 months ago

I use Alpine Linux 3.8 Docker image to install Redis 4.0.10.

Can you share the full Dockerfile for your redis container? If it is in a private repo can you share it here? I would like to replicate the issue locally.

#8 Updated by Tu Nguyen 6 months ago

FROM alpine:3.7

RUN apk --no-cache add tzdata redis

RUN ln -fs /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime

RUN addgroup -g 1000 terra && adduser -D -u 1000 -G terra terra

EXPOSE 6379

ENTRYPOINT ["redis-server", "/etc/redis.conf", "--bind 0.0.0.0", "--protected-mode no", "--daemonize no"]
FROM alpine:3.8

RUN apk --no-cache add tzdata redis

RUN ln -fs /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime

RUN addgroup -g 1000 terra && adduser -D -u 1000 -G terra terra

EXPOSE 6379

ENTRYPOINT ["redis-server", "/etc/redis.conf", "--bind 0.0.0.0", "--protected-mode no", "--daemonize no"]

Ubuntu 18.04

Client:
 Version:           18.06.0-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        0ffa825
 Built:             Wed Jul 18 19:09:54 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.0-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       0ffa825
  Built:            Wed Jul 18 19:07:56 2018
  OS/Arch:          linux/amd64
  Experimental:     false

It's exactly the same, different Alpine version.

#9 Updated by Dave Hall 6 months ago

Thanks for the Dockerfiles. I'll run it locally and come back to you. It might be the weekend before I have a lot of time to work on it.

#10 Updated by Jakub Jirutka 6 months ago

This has absolutely nothing to do with the daemonize directive. The problem causes unixsocket and missing directory /run/redis, as revealed in #9146. This directory is normally created by OpenRC init script. You have to create it yourself in dockerfile, or disable unixsocket via CLI.

It would save our time if OP provided proper error log...

#11 Updated by Jakub Jirutka 6 months ago

  • Related to Bug #9146: redis should start successfully when using the default redis.conf file added

#12 Updated by Jakub Jirutka 6 months ago

  • Has duplicate Bug #9080: Redis package error added

#13 Updated by Dave Hall 6 months ago

Based on the comments in #9146 I optimised the Dockerfile and added logic to create /run/redis. See below for the version I tested with. This appears to have resolved the issue of redis not starting on Alpine 3.8 under docker. I have pushed a patch upstream in <a href="https://github.com/alpinelinux/aports/pull/4891">PR:4891</a> to fix this issue and avoid the hack in the Dockerfile.


FROM alpine:3.8

EXPOSE 6379

RUN apk --no-cache --update add redis \
    && install -o redis -g redis -m 0770 -d /run/redis

USER redis

ENTRYPOINT ["redis-server", "/etc/redis.conf", "--bind 0.0.0.0", "--protected-mode no", "--daemonize no"]

#14 Updated by Jakub Jirutka 6 months ago

  • Status changed from Feedback to Resolved

#15 Updated by Jakub Jirutka 6 months ago

  • % Done changed from 0 to 100

#16 Updated by Natanael Copa 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF