Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions build/ansible/roles/supervisord/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
option: file
value: /run/supervisor/supervisor.sock

- name: Modify supervisord.conf
ini_file:
dest: /etc/supervisord.conf
section: unix_http_server
option: username
value: dummy

- name: Modify supervisord.conf
ini_file:
dest: /etc/supervisord.conf
section: unix_http_server
option: password
value: dummy

Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Modify supervisord.conf
ini_file:
dest: /etc/supervisord.conf
Expand Down
4 changes: 0 additions & 4 deletions managed/cmd/pmm-managed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1154,10 +1154,6 @@ func main() { //nolint:gocognit,maintidx,cyclop
return nil
}))

wg.Go(func() {
supervisord.Run(ctx)
})

wg.Go(func() {
updater.Run(ctx)
})
Expand Down
6 changes: 3 additions & 3 deletions managed/services/encryption/encryption_rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func startPMMServer() error {
return nil
}

cmd := exec.Command("supervisorctl", "start pmm-managed")
cmd := exec.Command("supervisorctl", "start", "pmm-managed") //nolint:noctx
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%w: %s", err, output)
Expand All @@ -90,7 +90,7 @@ func stopPMMServer() error {
return nil
}

cmd := exec.Command("supervisorctl", "stop pmm-managed")
cmd := exec.Command("supervisorctl", "stop", "pmm-managed") //nolint:noctx
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%w: %s", err, output)
Expand All @@ -104,7 +104,7 @@ func stopPMMServer() error {
}

func pmmServerStatus(status string) bool {
cmd := exec.Command("supervisorctl", "status pmm-managed")
cmd := exec.Command("supervisorctl", "status", "pmm-managed") //nolint:noctx
output, _ := cmd.CombinedOutput()

return strings.Contains(string(output), strings.ToUpper(status))
Expand Down
5 changes: 0 additions & 5 deletions managed/services/supervisord/devcontainer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package supervisord

import (
"context"
"os"
"path/filepath"
"testing"
Expand All @@ -38,10 +37,6 @@ func TestDevContainer(t *testing.T) {
s := New("/etc/supervisord.d", &models.Params{VMParams: vmParams, PGParams: &models.PGParams{}, HAParams: &models.HAParams{}})
require.NotEmpty(t, s.supervisorctlPath)

ctx, cancel := context.WithCancel(t.Context())
defer cancel()
go s.Run(ctx)

// restore original files after test
originals := make(map[string][]byte)
matches, err := filepath.Glob("/etc/supervisord.d/*.ini")
Expand Down
93 changes: 0 additions & 93 deletions managed/services/supervisord/maintail.go

This file was deleted.

107 changes: 0 additions & 107 deletions managed/services/supervisord/maintail_test.go

This file was deleted.

12 changes: 1 addition & 11 deletions managed/services/supervisord/pmm_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,7 @@ func saveConfig(path string, cfg []byte) (err error) {
return err
}

// TODO: remove [unix_http_server] and [supervisorctl] as they duplicate supervisord.conf.
var pmmTemplate = template.Must(template.New("").Option("missingkey=error").Parse(`[unix_http_server]
chmod = 0700

@ademidoff ademidoff Aug 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues:

  1. these were duplicating the default values of /etc/supervisord.conf.
  2. pmm.conf is a wrong place to configure these values.

username = dummy
password = dummy

[supervisorctl]
username = dummy
password = dummy

[program:pmm-init]
var pmmTemplate = template.Must(template.New("").Option("missingkey=error").Parse(`[program:pmm-init]
command = /usr/bin/ansible-playbook /opt/ansible/pmm-docker/init.yml
directory = /
autorestart = unexpected
Expand Down
Loading
Loading