From 6f5c28108974e0bfeae8ab66bc6d8645f7b444c9 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 2 Aug 2026 05:56:53 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20add=20Symlink=20constant,=20create=20/op?= =?UTF-8?q?t/wallarm=20=E2=86=92=20instance=20after=20move?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/native/native.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/native/native.go b/internal/native/native.go index b93b0ea..2f7e096 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -13,7 +13,8 @@ import ( const ( BaseDir = "/opt/fw" - DeployTo = "/opt/wallarm" // setup.sh hardcodes this, deploy here then move + DeployTo = "/opt/wallarm" + Symlink = "/opt/wallarm" ) func installerURL() string { @@ -133,15 +134,17 @@ func InstallNode(node state.Node, apiToken, apiHost, labels string) error { } } - // 7. Move /opt/wallarm → /opt/fw/{name}/wallarm + // 8. Move /opt/wallarm → /opt/fw/{name}/wallarm os.MkdirAll(filepath.Join(BaseDir, node.Name), 0755) os.RemoveAll(instanceDir) os.Rename(DeployTo, instanceDir) - // 8. Patch hardcoded /opt/wallarm paths - patchPaths(instanceDir) + // 9. Create symlink so ELF binaries find their interpreter + os.Remove(Symlink) + os.Symlink(instanceDir, Symlink) - // 9. Set up systemd service + // 10. Patch paths + systemd + patchPaths(instanceDir) GenerateSystemdTemplate() svc := "wallarm-node@" + node.Name exec.Command("systemctl", "enable", svc).Run()