Wrap service commands in bash -c to ensure session persistence
All checks were successful
Build and Release / build-and-release (push) Successful in 1m10s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m10s
- Use bash -c to properly execute service start/stop command sequences - Ensure SSH session stays alive for user input prompt - Fix escaping issues with nested quotes in commands - Update version to 0.1.89
This commit is contained in:
parent
980c9a20a2
commit
7ae464e172
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.88"
|
||||
version = "0.1.89"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@ -301,7 +301,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.88"
|
||||
version = "0.1.89"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -324,7 +324,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.88"
|
||||
version = "0.1.89"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"serde",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.88"
|
||||
version = "0.1.89"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.88"
|
||||
version = "0.1.89"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -267,7 +267,7 @@ impl TuiApp {
|
||||
if let (Some(service_name), Some(hostname)) = (self.get_selected_service(), self.current_host.clone()) {
|
||||
let connection_ip = self.get_connection_ip(&hostname);
|
||||
let service_start_command = format!(
|
||||
"echo 'Starting service: {} on {}' && ssh -tt {}@{} \"sudo systemctl start {} & sudo journalctl -fu {} --since=\\\"1 second ago\\\" --no-pager & while ! systemctl is-active {} >/dev/null 2>&1; do sleep 0.5; done; sudo pkill -f 'journalctl -fu {}' 2>/dev/null || true; echo 'Press any key to close...'; read -n 1 -s\"",
|
||||
"echo 'Starting service: {} on {}' && ssh -tt {}@{} \"bash -c 'sudo systemctl start {} & sudo journalctl -fu {} --since=\\\"1 second ago\\\" --no-pager & while ! systemctl is-active {} >/dev/null 2>&1; do sleep 0.5; done; sudo pkill -f \\\"journalctl -fu {}\\\" 2>/dev/null || true; echo \\\"Press any key to close...\\\"; read -n 1 -s'\" ",
|
||||
service_name,
|
||||
hostname,
|
||||
self.config.ssh.rebuild_user,
|
||||
@ -293,7 +293,7 @@ impl TuiApp {
|
||||
if let (Some(service_name), Some(hostname)) = (self.get_selected_service(), self.current_host.clone()) {
|
||||
let connection_ip = self.get_connection_ip(&hostname);
|
||||
let service_stop_command = format!(
|
||||
"echo 'Stopping service: {} on {}' && ssh -tt {}@{} \"sudo systemctl stop {} & sudo journalctl -fu {} --since=\\\"1 second ago\\\" --no-pager & sleep 1; while systemctl is-active {} >/dev/null 2>&1; do sleep 0.5; done; sleep 2; sudo pkill -f 'journalctl -fu {}' 2>/dev/null || true; echo 'Press any key to close...'; read -n 1 -s\"",
|
||||
"echo 'Stopping service: {} on {}' && ssh -tt {}@{} \"bash -c 'sudo systemctl stop {} & sudo journalctl -fu {} --since=\\\"1 second ago\\\" --no-pager & sleep 1; while systemctl is-active {} >/dev/null 2>&1; do sleep 0.5; done; sleep 2; sudo pkill -f \\\"journalctl -fu {}\\\" 2>/dev/null || true; echo \\\"Press any key to close...\\\"; read -n 1 -s'\" ",
|
||||
service_name,
|
||||
hostname,
|
||||
self.config.ssh.rebuild_user,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.88"
|
||||
version = "0.1.89"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user