install run dir before running
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2022-03-15 18:19:12 -03:00
parent 71ac5427e0
commit c3124adec4
3 changed files with 18 additions and 2 deletions

View file

@ -28,6 +28,7 @@ RUN apk add --no-cache redis
COPY --from=build /etc/redis.conf /etc/redis.conf
COPY ./monit.conf /etc/monit.d/redis.conf
COPY ./redisd.sh /usr/local/bin/redisd
EXPOSE 6379
VOLUME "/var/lib/redis"

View file

@ -1,4 +1,4 @@
check process redis with pidfile /run/redis/redis.pid
start program = "/usr/bin/redis-server /etc/redis.conf" as uid "redis" and gid "redis"
stop program = "/usr/bin/redis-cli shutdown"
start program = "/usr/local/bin/redisd start"
stop program = "/usr/local/bin/redisd stop"
if failed port 6379 protocol redis 3 times within 5 cycles then restart

15
redisd.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
run=/run/redis
case $1 in
start)
install -dm 750 -o redis -g redis $run
su redis -c "/usr/bin/redis-server /etc/redis.conf"
;;
stop)
/usr/bin/redis-cli shutdown
;;
esac
exit $?