PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
REFACTOR (dev): Find the process holding the backend port with find -lname instead of parsing ls output
Rostislav Dugin9930c18895fb
diff --git a/scripts/dev.sh b/scripts/dev.shindex 77b9603e..b69584b3 100755--- a/scripts/dev.sh+++ b/scripts/dev.sh@@ -37,8 +37,7 @@ free_backend_port() {[[ -n "$inode" ]] || return 0for process_dir in /proc/[0-9]*; dopid=${process_dir#/proc/}- # shellcheck disable=SC2010 # the match is on the socket link targets, not on file names- if ls -l "/proc/$pid/fd" 2>/dev/null | grep -q "socket:\[$inode\]"; then+ if [[ -n "$(find "$process_dir/fd" -lname "socket:\[$inode\]" -print -quit 2>/dev/null)" ]]; thenecho "freeing port $backend_port: killing stale backend pid $pid"kill -9 "$pid" 2>/dev/null || truefi