From d4f7fa0730d2497e9296e1255e8afea34ee89336 Mon Sep 17 00:00:00 2001 From: Robert Glonek Date: Wed, 4 Sep 2024 12:13:49 -0700 Subject: [PATCH] fix instance shutdown issues with EFS race condition --- src/cmdAgiCreate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmdAgiCreate.go b/src/cmdAgiCreate.go index a19a59b2..5eb2cfe1 100644 --- a/src/cmdAgiCreate.go +++ b/src/cmdAgiCreate.go @@ -1011,7 +1011,7 @@ func (c *agiCreateCmd) Execute(args []string) error { if a.opts.Config.Backend.Type == "docker" { installScript = fmt.Sprintf(agiCreateScriptDocker, override, c.NoDIM, c.Owner, edition, edition, cedition, toolsUpgrade, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, wbs, c.ClusterName, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml) } else { - shutdownCmd := "/sbin/poweroff -p || /sbin/poweroff" + shutdownCmd := "/usr/bin/systemctl stop aerospike; /usr/bin/sync; /sbin/poweroff -p || /sbin/poweroff" installScript = fmt.Sprintf(agiCreateScript, override, c.NoDIM, c.Owner, edition, edition, cedition, toolsUpgrade, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, wbs, maxWriteCache, c.ClusterName, shutdownCmd, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml) } flist = append(flist, fileListReader{filePath: "/root/agiinstaller.sh", fileContents: strings.NewReader(installScript), fileSize: len(installScript)})