Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion commands/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@ func updateUserdataFile(driverOpts *rpcdriver.RPCFlags, machineName, hostname, u
// on how hostnames are set in cloud-config (userdata)
func writeCloudConfig(machineName, encodedData, machineOS, hostname string, cf map[interface{}]interface{}, newUserDataFile *os.File) error {
command := "sh"
path := "/usr/local/custom_script/install.sh"
// allow the script to work on distros with read-only /usr partitions
path := "/var/run/install.sh"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path := "/var/run/install.sh"
path := "/opt/rancher-system-agent/install.sh"

I believe we install the system agent within that directory anyway if /usr is not writable, so I'd rather reuse that if possible.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That path wouldn't exist on the machine initially. /var/run is the most portable path that could be used, since it will definitely exist and will always be writable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakefhyde are you happy with the PR as-is?

key := "hostname"
if strings.Contains(machineOS, "windows") {
// the writeFile path should ideally be C:\usr\local\custom_script\install.ps1
Expand Down