From b6629d44fb0d7ea9f3182b44d1b64b191bd1524f Mon Sep 17 00:00:00 2001 From: niusmallnan Date: Tue, 31 Jul 2018 17:32:37 +0800 Subject: [PATCH] Fix the missing of CloudConfigScriptFile --- init/init.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init/init.go b/init/init.go index 7bac5838..828e12c0 100644 --- a/init/init.go +++ b/init/init.go @@ -362,6 +362,7 @@ func RunInit() error { config.CfgFuncData{"read cfg and log files", func(cfg *config.CloudConfig) (*config.CloudConfig, error) { filesToCopy := []string{ config.CloudConfigInitFile, + config.CloudConfigScriptFile, config.CloudConfigBootFile, config.CloudConfigNetworkFile, config.MetaDataFile, @@ -418,7 +419,11 @@ func RunInit() error { if strings.HasPrefix(name, "/var/lib/rancher/conf/") { // only make the conf files harder to get to dirMode = os.ModeDir | 0700 - fileMode = os.FileMode(0400) + if name == config.CloudConfigScriptFile { + fileMode = os.FileMode(0755) + } else { + fileMode = os.FileMode(0400) + } } if err := os.MkdirAll(filepath.Dir(name), dirMode); err != nil { log.Error(err)