$OpenBSD: patch-agent_appconfig_constants_unix_go,v 1.10 2019/04/16 08:06:42 ajacoutot Exp $

Index: agent/appconfig/constants_unix.go
--- agent/appconfig/constants_unix.go.orig
+++ agent/appconfig/constants_unix.go
@@ -26,49 +26,49 @@ import (
 const (
 
 	// PackageRoot specifies the directory under which packages will be downloaded and installed
-	PackageRoot = "/var/lib/amazon/ssm/packages"
+	PackageRoot = "/var/db/amazon/ssm/packages"
 
 	// PackageLockRoot specifies the directory under which package lock files will reside
-	PackageLockRoot = "/var/lib/amazon/ssm/locks/packages"
+	PackageLockRoot = "/var/db/amazon/ssm/locks/packages"
 
 	// PackagePlatform is the platform name to use when looking for packages
 	PackagePlatform = "linux"
 
 	// DaemonRoot specifies the directory where daemon registration information is stored
-	DaemonRoot = "/var/lib/amazon/ssm/daemons"
+	DaemonRoot = "/var/db/amazon/ssm/daemons"
 
 	// LocalCommandRoot specifies the directory where users can submit command documents offline
-	LocalCommandRoot = "/var/lib/amazon/ssm/localcommands"
+	LocalCommandRoot = "/var/db/amazon/ssm/localcommands"
 
 	// LocalCommandRootSubmitted is the directory where locally submitted command documents
 	// are moved when they have been picked up
-	LocalCommandRootSubmitted = "/var/lib/amazon/ssm/localcommands/submitted"
-	LocalCommandRootCompleted = "/var/lib/amazon/ssm/localcommands/completed"
+	LocalCommandRootSubmitted = "/var/db/amazon/ssm/localcommands/submitted"
+	LocalCommandRootCompleted = "/var/db/amazon/ssm/localcommands/completed"
 
 	// LocalCommandRootInvalid is the directory where locally submitted command documents
 	// are moved if the service cannot validate the document (generally impossible via cli)
-	LocalCommandRootInvalid = "/var/lib/amazon/ssm/localcommands/invalid"
+	LocalCommandRootInvalid = "/var/db/amazon/ssm/localcommands/invalid"
 
 	// DownloadRoot specifies the directory under which files will be downloaded
 	DownloadRoot = "/var/log/amazon/ssm/download/"
 
 	// DefaultDataStorePath represents the directory for storing system data
-	DefaultDataStorePath = "/var/lib/amazon/ssm/"
+	DefaultDataStorePath = "/var/db/amazon/ssm/"
 
 	// EC2ConfigDataStorePath represents the directory for storing ec2 config data
-	EC2ConfigDataStorePath = "/var/lib/amazon/ec2config/"
+	EC2ConfigDataStorePath = "/var/db/amazon/ec2config/"
 
 	// EC2ConfigSettingPath represents the directory for storing ec2 config settings
-	EC2ConfigSettingPath = "/var/lib/amazon/ec2configservice/"
+	EC2ConfigSettingPath = "/var/db/amazon/ec2configservice/"
 
 	// UpdaterArtifactsRoot represents the directory for storing update related information
-	UpdaterArtifactsRoot = "/var/lib/amazon/ssm/update/"
+	UpdaterArtifactsRoot = "/var/db/amazon/ssm/update/"
 
 	// DefaultPluginPath represents the directory for storing plugins in SSM
-	DefaultPluginPath = "/var/lib/amazon/ssm/plugins"
+	DefaultPluginPath = "/var/db/amazon/ssm/plugins"
 
 	// ManifestCacheDirectory represents the directory for storing all downloaded manifest files
-	ManifestCacheDirectory = "/var/lib/amazon/ssm/manifests"
+	ManifestCacheDirectory = "/var/db/amazon/ssm/manifests"
 
 	// List all plugin names, unfortunately golang doesn't support const arrays of strings
 
@@ -95,10 +95,10 @@ const (
 var PowerShellPluginCommandName string
 
 // DefaultProgramFolder is the default folder for SSM
-var DefaultProgramFolder = "/etc/amazon/ssm/"
-var DefaultDocumentWorker = "/usr/bin/ssm-document-worker"
-var DefaultSessionWorker = "/usr/bin/ssm-session-worker"
-var DefaultSessionLogger = "/usr/bin/ssm-session-logger"
+var DefaultProgramFolder = "${SYSCONFDIR}/amazon/ssm/"
+var DefaultDocumentWorker = "${LOCALBASE}/bin/ssm-document-worker"
+var DefaultSessionWorker = "${LOCALBASE}/bin/ssm-session-worker"
+var DefaultSessionLogger = "${LOCALBASE}/bin/ssm-session-logger"
 
 // AppConfigPath is the path of the AppConfig
 var AppConfigPath = DefaultProgramFolder + AppConfigFileName
@@ -107,9 +107,9 @@ func init() {
 	/*
 	   Powershell command used to be poweshell in alpha versions, now it's pwsh in prod versions
 	*/
-	PowerShellPluginCommandName = "/usr/bin/powershell"
+	PowerShellPluginCommandName = "${LOCALBASE}/bin/powershell"
 	if _, err := os.Stat(PowerShellPluginCommandName); err != nil {
-		PowerShellPluginCommandName = "/usr/bin/pwsh"
+		PowerShellPluginCommandName = "${LOCALBASE}/bin/pwsh"
 	}
 
 	// Find current directory path for amazon-ssm-agent, DefaultDocumentWorker should exist in same directory
