elastic / observability-examples

This repository contains examples for Elastic Observability
Apache License 2.0
19 stars 14 forks source link

redis directory shell script entrypoint.sh fails on windows based docker desktop #38

Open nagkumar opened 6 months ago

nagkumar commented 6 months ago

_#!/bin/bash

start a background process that periodically runs redis-cli CLIENT PAUSE to stall the server, if the env var TOGGLE_CLIENT_PAUSE is set to true

echo "performing backup" >&1 if [ "$TOGGLE_CLIENT_PAUSE" = "true" ]; then echo "Starting redis client-pause loop" while true; do echo "performing backup" >&1 redis-cli CLIENT PAUSE 3000 >&1 sleep 30 done & fi

start redis

echo "Starting redis-server" exec redis-server_

fails with message

Syntax error: Bad fd number

nagkumar commented 6 months ago

solution was remove all >&1.. pl. check if ok as per the chatgpt..

!/bin/bash
# Start a background process that periodically runs redis-cli CLIENT PAUSE to stall the server, if the env var TOGGLE_CLIENT_PAUSE is set to true
echo "performing backup"

if [ "$TOGGLE_CLIENT_PAUSE" = "true" ]; then
  echo "Starting redis client-pause loop"
  while true; do
    echo "performing backup"
    redis-cli CLIENT PAUSE 3000
    sleep 30
  done &
fi

# Start redis
echo "Starting redis-server"
exec redis-server

after this change redis did work fine

image