[WIP] Add restart command to instance

This commit is contained in:
Vladimir Stoilov
2024-09-26 13:51:42 +03:00
parent c9631daa3e
commit 61babe2822
15 changed files with 81 additions and 98 deletions

View File

@@ -19,7 +19,6 @@ import (
"github.com/safing/portmaster/service/process"
"github.com/safing/portmaster/service/resolver"
"github.com/safing/portmaster/service/status"
"github.com/safing/portmaster/service/updates"
"github.com/safing/portmaster/spn/captain"
)
@@ -149,8 +148,8 @@ func shutdown(_ *api.Request) (msg string, err error) {
func restart(_ *api.Request) (msg string, err error) {
log.Info("core: user requested restart via action")
// Let the updates module handle restarting.
updates.RestartNow()
// Trigger restart
module.instance.Restart()
return "restart initiated", nil
}

View File

@@ -114,6 +114,7 @@ func New(instance instance) (*Core, error) {
type instance interface {
Shutdown()
Restart()
AddWorkerInfoToDebugInfo(di *debug.Info)
BinaryUpdates() *updates.Updates
IntelUpdates() *updates.Updates