You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnerrors.Wrap(err, "Error while executing the HAProxy configuration update command (command: \""+updater.CmdOnUpdated+"\")")
}
returnnil
}
This implementation works, but can be improved: we can call systemd API via DBus and this opens a lot of possibilities (for example, we can restart, reload the service or introspect it). For the Go language there is go-systemd, a module that exposes the DBus systemd API to the language ( https://pkg.go.dev/github.com/coreos/go-systemd/v22/dbus). We should evaluate whether using the DBus API is better for the agent than running the systemd command directly, since it introduces a new dependency (and the DBus server must be running).
The text was updated successfully, but these errors were encountered:
Currently, the DFaaS agent restarts the HAProxy service by executing a command defined in the configuration file:
https://github.com/unimib-datAI/dfaas/blob/034794c87d7bfe638c098c40f09811cb0c35048b/dfaasagent.env#L23C38-L23C80
The command is executed using the
os/exec
package, which creates a temporary bash shell and checks the exit code:dfaas/dfaasagent/agent/hacfgupd/hacfgupd.go
Lines 42 to 66 in 034794c
This implementation works, but can be improved: we can call systemd API via DBus and this opens a lot of possibilities (for example, we can restart, reload the service or introspect it). For the Go language there is go-systemd, a module that exposes the DBus systemd API to the language (
https://pkg.go.dev/github.com/coreos/go-systemd/v22/dbus). We should evaluate whether using the DBus API is better for the agent than running the systemd command directly, since it introduces a new dependency (and the DBus server must be running).
The text was updated successfully, but these errors were encountered: