Skip to content

Commit ef62238

Browse files
committed
Skip disabled Tari daemon recovery
1 parent 5efbe4e commit ef62238

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

fix_daemon.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Usage: fix_daemon.sh [--dry-run] <reason> [options]
1717
Reasons:
1818
xmr-lag restart monerod and xtm_mm
1919
proxy-unhealthy restart monerod and xtm_mm
20-
xtm-lag restart local xtm if present and xtm_mm
21-
template-stuck restart monerod, local xtm if present, and xtm_mm
20+
xtm-lag restart local xtm if present/enabled and xtm_mm
21+
template-stuck restart monerod, local xtm if present/enabled, and xtm_mm
2222
2323
Options:
2424
--port <port>
@@ -108,6 +108,10 @@ service_exists() {
108108
systemctl cat "$1" >/dev/null 2>&1
109109
}
110110

111+
service_enabled() {
112+
systemctl is-enabled "$1" >/dev/null 2>&1
113+
}
114+
111115
run_service() {
112116
local action="$1"
113117
local unit="$2"
@@ -127,6 +131,10 @@ run_optional_service() {
127131
return 0
128132
fi
129133
if service_exists "$unit"; then
134+
if [ "$action" != "stop" ] && ! service_enabled "$unit"; then
135+
log "skipping $action $unit because the unit is disabled"
136+
return 0
137+
fi
130138
run_service "$action" "$unit"
131139
else
132140
log "skipping $action $unit because the unit is not present"

0 commit comments

Comments
 (0)