Skip to content

Commit fca50be

Browse files
committed
Debug and fix some more OpenSearch issues on devcontainer startup
1 parent 69d1454 commit fca50be

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

unipept-index/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@ setup_database() {
168168
cat > /usr/local/bin/unipept-start-services.sh << 'EOF'
169169
#!/bin/bash
170170
set -euo pipefail
171-
CONTAINER_USER="${_REMOTE_USER:-vscode}"
171+
echo "Removing stale OpenSearch lock files..."
172+
sudo rm -f /var/lib/opensearch/nodes/0/node.lock /var/lib/opensearch/nodes/0/_state/write.lock
172173
echo "Starting OpenSearch..."
173-
sudo -u "$CONTAINER_USER" nohup /usr/share/opensearch/bin/opensearch > /var/log/opensearch/startup.log 2>&1 &
174+
nohup /usr/share/opensearch/bin/opensearch > /var/log/opensearch/startup.log 2>&1 &
174175
disown
175176
timeout 90s bash -c 'until curl -s http://localhost:9200; do echo "Waiting for OpenSearch..."; sleep 5; done'
176177
echo "OpenSearch is ready."

0 commit comments

Comments
 (0)