File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 113113 Type = "oneshot" ;
114114 RemainAfterExit = true ;
115115 User = "root" ;
116+ StandardOutput = "journal+console" ;
117+ StandardError = "journal+console" ;
116118 ExecStart = pkgs . writeShellScript "csf-cp-ready" ''
117119 set -euo pipefail
118120
119121 CURL=${ pkgs . curl } /bin/curl
120122 TIMEOUT=120
121123 ELAPSED=0
122124
123- echo "CSF Control Plane starting..." > /dev/tty1
124-
125125 while [ "$ELAPSED" -lt "$TIMEOUT" ]; do
126126 if "$CURL" -sf http://localhost:8000/api/public-key > /dev/null 2>&1; then
127- IP=$(hostname -I | awk '{print $1}')
128- echo "" > /dev/tty1
129- echo "CSF Control Plane ready." > /dev/tty1
130- echo "API: http://$IP:8000" > /dev/tty1
127+ IP=$(${ pkgs . iproute2 } /bin/ip route get 1.1.1.1 2>/dev/null | awk '/src/{print $7; exit}' || true)
128+ echo "[INFO] csf control plane ready host=$IP port=8000"
131129 exit 0
132130 fi
133131
134- echo "Waiting for API gateway... ( '' ${ELAPSED}s)" > /dev/tty1
132+ echo "[INFO] csf control plane not ready elapsed= '' ${ELAPSED}s timeout= '' ${TIMEOUT}s"
135133 sleep 5
136134 ELAPSED=$((ELAPSED + 5))
137135 done
138136
139- echo "CSF Control Plane did not become ready within '' ${TIMEOUT}s" > /dev/tty1
140- echo "Check: sudo docker logs csf-csf-api-gateway-1" > /dev/tty1
137+ echo "[ERROR] csf control plane readiness timeout elapsed='' ${TIMEOUT}s"
141138 exit 1
142139 '' ;
143140 } ;
You can’t perform that action at this time.
0 commit comments