Skip to content

Commit 71dc94f

Browse files
committed
CLEANUP/MINOR: s6: do not double stop signal
s6 already receives signal for stopping from k8s, no need to send it again here
1 parent ff2284e commit 71dc94f

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

pkg/haproxy/process/s6-overlay.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,20 @@ type s6Control struct {
1616
API api.HAProxyClient
1717
}
1818

19-
func (d *s6Control) Service(action string) (err error) {
19+
func (d *s6Control) Service(action string) error {
2020
if d.OSArgs.Test {
2121
logger.Infof("HAProxy would be %sed now", action)
2222
return nil
2323
}
2424
var cmd *exec.Cmd
2525

26-
//nolint:gosec //checks on HAProxyBinary should be done in configuration module.
2726
switch action {
2827
case "start":
2928
// no need to start it is up already (s6)
3029
return nil
31-
/*if processErr == nil {
32-
logger.Error("haproxy is already running")
33-
return nil
34-
}
35-
cmd = exec.Command("s6-svc", "-u", "/var/run/s6/services/haproxy")
36-
cmd.Stdout = os.Stdout
37-
cmd.Stderr = os.Stderr
38-
return cmd.Start()*/
3930
case "stop":
40-
cmd = exec.Command("s6-svc", "-d", "/var/run/s6/services/haproxy")
41-
cmd.Stdout = os.Stdout
42-
cmd.Stderr = os.Stderr
43-
return cmd.Run()
31+
// no need to stop it (s6)
32+
return nil
4433
case "reload":
4534
logger.Error(saveServerState(d.Env.StateDir, d.API))
4635
cmd = exec.Command("s6-svc", "-2", "/var/run/s6/services/haproxy")

0 commit comments

Comments
 (0)