From 989264681426a5fd472a5c39f8d740c9ddaeae94 Mon Sep 17 00:00:00 2001 From: GnomeZworc Date: Sun, 4 Jan 2026 17:43:51 +0100 Subject: [PATCH] f-8: code: start/stop metadata service Signed-off-by: GnomeZworc --- cmd/meta_cli/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/meta_cli/main.go b/cmd/meta_cli/main.go index a357991..9782b5f 100644 --- a/cmd/meta_cli/main.go +++ b/cmd/meta_cli/main.go @@ -7,6 +7,7 @@ import ( configuration "git.g3e.fr/syonad/two/internal/config/agent" "git.g3e.fr/syonad/two/internal/load_db/nocloud" "git.g3e.fr/syonad/two/pkg/db/kv" + "git.g3e.fr/syonad/two/pkg/systemd" ) func main() { @@ -22,6 +23,8 @@ func main() { flag.Parse() + service, _ := systemd.New() + conf, err := configuration.LoadConfig(*conf_file) if err != nil { fmt.Println(err) @@ -43,7 +46,9 @@ func main() { Password: *password, SSHKEY: *ssh_key, }, db) + service.Start("metadata@" + *vm_name) } else if *stop { nocloud.UnLoadNoCloudInDB(*vm_name, db) + service.Stop("metadata@" + *vm_name) } }