Skip to content

Commit

Permalink
If "Loaded: not found" is present in the systemctl status command
Browse files Browse the repository at this point in the history
output then the systemd service is also not present. Added the case to
the conflicting installation check.
  • Loading branch information
XuechunHou committed Dec 19, 2024
1 parent 4eac5b0 commit bbcc1c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/ops_agent_uap_wrapper/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (ps *OpsAgentPluginServer) findPreExistentAgent(ctx context.Context, servic
"systemctl", "status", serviceName,
)
output, err := runCommand(findOpsAgentCmd, ps.logger)
if strings.Contains(output, fmt.Sprintf("Unit %s could not be found.", serviceName)) {
if strings.Contains(output, fmt.Sprintf("Unit %s could not be found.", serviceName)) || strings.Contains(output, "Loaded: not-found") {
return false, nil
}
if strings.Contains(output, "Loaded:") {
Expand Down

0 comments on commit bbcc1c5

Please sign in to comment.