File tree Expand file tree Collapse file tree 5 files changed +41
-38
lines changed Expand file tree Collapse file tree 5 files changed +41
-38
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,43 @@ echo "starting tunneled solr prod in background"
88ssh -L 8983:ldpd-solr-prod1.cul.columbia.edu:8983 -C -N
[email protected] &
99echo $! > ./tmp/ssh_tunnel.pid
1010
11- bin/solr_monitor.sh &
11+ # (bin/solr_monitor.sh </dev/null > /dev/tty 2>/dev/tty) &
12+ MONITOR_FILE="./tmp/shutdown_tunnel_signal"
13+ PID_FILE="./tmp/ssh_tunnel.pid"
14+
15+ if [ -f "$PID_FILE" ]; then
16+ TUNNEL_PID=$(cat "$PID_FILE")
17+ echo "Solr monitor read PID from $PID_FILE: $TUNNEL_PID"
18+ else
19+ echo "Solr monitor PID file $PID_FILE not found. Monitor exiting."
20+ exit 1
21+ fi
22+
1223
1324echo "Running docker compose up"
14- docker compose up
25+ docker compose up --exit-code-from dlc
26+ container_id=$(docker ps -aqf "name=dlc")
27+ exit_code=$(docker inspect $container_id --format='{{.State.ExitCode}}')
28+
29+ if [ $exit_code -ne 0 ]; then
30+ echo "Sending signal to shut down solr tunnel"
31+ echo "SHUTDOWN TUNNEL" > ./tmp/shutdown_tunnel_signal;
32+ fi
33+
34+ while true; do
35+ if [ -f "$MONITOR_FILE" ]; then
36+ echo "Signal file detected. Killing tunnel process with PID $TUNNEL_PID..."
37+
38+ if kill "$TUNNEL_PID"; then
39+ echo "Tunnel process killed successfully."
40+ else
41+ echo "Failed to kill tunnel process or process not found."
42+ fi
43+
44+ rm -f "$MONITOR_FILE"
45+ rm -f "$PID_FILE"
46+
47+ exit 0
48+ fi
49+ sleep 1
50+ done
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ FileUtils.chdir APP_ROOT do
1818 system ( 'bundle check' ) || system! ( 'bundle install' )
1919
2020 # Install JavaScript dependencies
21- # system(' bin/yarn' )
21+ system! ( " bin/yarn" )
2222
2323 # puts "\n== Copying sample files =="
2424 # unless File.exist?('config/database.yml')
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ development:
66 adapter : solr
77 timeout : 120
88test :
9- url : http://localhost:9983/solr/dlc
9+ url : http://localhost:9983/solr/dcv
1010 adapter : solr
1111 timeout : 120
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ development:
22 url : http://localhost:8983/solr/dlc
33 timeout : 120
44test :
5- url : http://localhost:9983/solr/dlc
5+ url : http://localhost:9983/solr/dcv
66 timeout : 120
You can’t perform that action at this time.
0 commit comments