diff --git a/pkg/cluster/module/systemd.go b/pkg/cluster/module/systemd.go index f38387b676..cb2546aae0 100644 --- a/pkg/cluster/module/systemd.go +++ b/pkg/cluster/module/systemd.go @@ -77,7 +77,7 @@ func NewSystemdModule(config SystemdModuleConfig) *SystemdModule { systemctl, strings.ToLower(config.Action), config.Unit) if config.CheckActive { - cmd = fmt.Sprintf("if [[ $(%s is-active %s) == \"active\" ]]; then %s; fi", + cmd = fmt.Sprintf("if %s is-active %s &>/dev/null; then %s; fi", systemctl, config.Unit, cmd) }