ole2242527 commited on
Commit
1374f29
·
verified ·
1 Parent(s): 1a83948

Upload start-space.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. start-space.sh +4 -0
start-space.sh CHANGED
@@ -36,6 +36,10 @@ redis-server --daemonize yes --bind 127.0.0.1 --port 6379 --dir "$REDIS_DATA" --
36
 
37
  if [ -z "${DATABASE_HOST:-}" ]; then
38
  if [ ! -s "$PG_DATA/PG_VERSION" ]; then
 
 
 
 
39
  su-exec postgres initdb -D "$PG_DATA" --auth=trust >"$PG_DATA/init.log"
40
  fi
41
 
 
36
 
37
  if [ -z "${DATABASE_HOST:-}" ]; then
38
  if [ ! -s "$PG_DATA/PG_VERSION" ]; then
39
+ # No valid PG data — remove stale directory and recreate clean
40
+ rm -rf "$PG_DATA"
41
+ mkdir -p "$PG_DATA"
42
+ chown postgres:postgres "$PG_DATA"
43
  su-exec postgres initdb -D "$PG_DATA" --auth=trust >"$PG_DATA/init.log"
44
  fi
45