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()