1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 15:24:32 +00:00

Fix the missing of CloudConfigScriptFile

(cherry picked from commit b6629d44fb)
This commit is contained in:
niusmallnan
2018-07-31 17:32:37 +08:00
committed by niusmallnan
parent 06c5d45d4a
commit b1d3274bce

View File

@@ -362,6 +362,7 @@ func RunInit() error {
config.CfgFuncData{"read cfg and log files", func(cfg *config.CloudConfig) (*config.CloudConfig, error) { config.CfgFuncData{"read cfg and log files", func(cfg *config.CloudConfig) (*config.CloudConfig, error) {
filesToCopy := []string{ filesToCopy := []string{
config.CloudConfigInitFile, config.CloudConfigInitFile,
config.CloudConfigScriptFile,
config.CloudConfigBootFile, config.CloudConfigBootFile,
config.CloudConfigNetworkFile, config.CloudConfigNetworkFile,
config.MetaDataFile, config.MetaDataFile,
@@ -418,8 +419,12 @@ func RunInit() error {
if strings.HasPrefix(name, "/var/lib/rancher/conf/") { if strings.HasPrefix(name, "/var/lib/rancher/conf/") {
// only make the conf files harder to get to // only make the conf files harder to get to
dirMode = os.ModeDir | 0700 dirMode = os.ModeDir | 0700
if name == config.CloudConfigScriptFile {
fileMode = os.FileMode(0755)
} else {
fileMode = os.FileMode(0400) fileMode = os.FileMode(0400)
} }
}
if err := os.MkdirAll(filepath.Dir(name), dirMode); err != nil { if err := os.MkdirAll(filepath.Dir(name), dirMode); err != nil {
log.Error(err) log.Error(err)
} }