File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ Usage: fix_daemon.sh [--dry-run] <reason> [options]
1717Reasons:
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
2323Options:
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+
111115run_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"
You can’t perform that action at this time.
0 commit comments