sous-chefs / redisio

Development repository for the redisio cookbook
https://supermarket.chef.io/cookbooks/redisio
Apache License 2.0
297 stars 301 forks source link

After OS restart, redis listens only on loopback #439

Closed ariva07 closed 2 years ago

ariva07 commented 3 years ago

We use a little wrapper to get actual ip address of the machine and confgure redis to listen on loopback interface and eth interface. Cookbook redisio, version 4.2.0. After initial start, service listens correctly on both interfaces, but after OS (tested on CentOS7, CentOS8, Oracle Linux 8) restart, it listens only on loopback. Manual restart of the service, fixes the problem.

I started to testing the systemd unit entry and found that simple change from:

[Unit]
Description=Redis (%i) persistent key-value database
After=network.target

to:

[Unit]
Description=Redis (%i) persistent key-value database
Wants=network-online.target
After=network-online.target

in templates/default/redis@.service.erb solves the problem.

redis cookbook version: 4.2.0 chef-client version: 14.15.6

Steps To Reproduce

Create redis service, restart server

:police_car: Expected behavior

Redis service listens on all defined and available interfaces

ramereth commented 3 years ago

@ariva07 please feel free to make a PR which fixes this.