Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nagkumar opened this issue May 17, 2024 · 1 comment

Comments

@nagkumar
Copy link

_#!/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
Copy link
Author

nagkumar commented May 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant