cmd/cli: handle stop signal from service manager

So using "ctrld stop" or service manager to stop ctrld will end up with
the same result, stopped ctrld with a working DNS, and deactivation pin
code will always have effects if set.
This commit is contained in:
Cuong Manh Le
2025-03-20 22:26:35 +07:00
committed by Cuong Manh Le
parent dacc67e50f
commit c6365e6b74
7 changed files with 60 additions and 42 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ func selfUninstall(p *prog, logger zerolog.Logger) {
logger.Fatal().Err(err).Msg("could not determine executable")
}
args := []string{"uninstall"}
if !deactivationPinNotSet() {
if deactivationPinSet() {
args = append(args, fmt.Sprintf("--pin=%d", cdDeactivationPin.Load()))
}
cmd := exec.Command(bin, args...)