Fix vault health check - quote URL to prevent & being interpreted as shell background

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-12-15 18:04:53 -03:00
parent 62915b2164
commit 9a309b4bea
2 changed files with 4 additions and 4 deletions

View file

@ -220,7 +220,7 @@ impl BootstrapManager {
// Check if Vault is already running before trying to start // Check if Vault is already running before trying to start
let vault_already_running = Command::new("sh") let vault_already_running = Command::new("sh")
.arg("-c") .arg("-c")
.arg("curl -f -s http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200 >/dev/null 2>&1") .arg("curl -f -s 'http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200' >/dev/null 2>&1")
.stdout(std::process::Stdio::null()) .stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null()) .stderr(std::process::Stdio::null())
.status() .status()
@ -244,7 +244,7 @@ impl BootstrapManager {
for i in 0..10 { for i in 0..10 {
let vault_ready = Command::new("sh") let vault_ready = Command::new("sh")
.arg("-c") .arg("-c")
.arg("curl -f -s http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200 >/dev/null 2>&1") .arg("curl -f -s 'http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200' >/dev/null 2>&1")
.stdout(std::process::Stdio::null()) .stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null()) .stderr(std::process::Stdio::null())
.status() .status()
@ -432,7 +432,7 @@ impl BootstrapManager {
// Check if Vault is already running // Check if Vault is already running
let vault_running = Command::new("sh") let vault_running = Command::new("sh")
.arg("-c") .arg("-c")
.arg("curl -f -s http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200 >/dev/null 2>&1") .arg("curl -f -s 'http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200' >/dev/null 2>&1")
.stdout(std::process::Stdio::null()) .stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null()) .stderr(std::process::Stdio::null())
.status() .status()

View file

@ -920,7 +920,7 @@ impl PackageManager {
data_download_list: Vec::new(), data_download_list: Vec::new(),
exec_cmd: "nohup {{BIN_PATH}}/vault server -config={{CONF_PATH}}/vault/config.hcl > {{LOGS_PATH}}/vault.log 2>&1 &" exec_cmd: "nohup {{BIN_PATH}}/vault server -config={{CONF_PATH}}/vault/config.hcl > {{LOGS_PATH}}/vault.log 2>&1 &"
.to_string(), .to_string(),
check_cmd: "curl -f -s http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200 >/dev/null 2>&1" check_cmd: "curl -f -s 'http://localhost:8200/v1/sys/health?standbyok=true&uninitcode=200&sealedcode=200' >/dev/null 2>&1"
.to_string(), .to_string(),
}, },
); );