1
0
mirror of https://github.com/rancher/os.git synced 2025-09-04 08:14:21 +00:00

Write /run/console-done before executing /etc/rc.local

This commit is contained in:
Josh Curl
2016-10-14 10:48:32 -07:00
parent 9654e4eaad
commit e608377088
3 changed files with 10 additions and 7 deletions

View File

@@ -111,6 +111,11 @@ func Main() {
if err := runScript(startScript); err != nil {
log.Error(err)
}
if err := ioutil.WriteFile(consoleDone, []byte(cfg.Rancher.Console), 0644); err != nil {
log.Error(err)
}
if err := runScript("/etc/rc.local"); err != nil {
log.Error(err)
}
@@ -122,10 +127,6 @@ func Main() {
log.Fatal(err)
}
if err := ioutil.WriteFile(consoleDone, []byte(cfg.Rancher.Console), 0644); err != nil {
log.Error(err)
}
log.Fatal(syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ()))
}

View File

@@ -15,13 +15,14 @@ write_files:
permissions: "0755"
owner: root
content: |
touch /home/rancher/test4
wait-for-docker
docker run -d nginx
- path: /var/lib/rancher/conf/cloud-config-script
permissions: "0755"
owner: root
content: |
#!/bin/bash
touch /home/rancher/test5
touch /home/rancher/test4
runcmd:
- []
- [ test ]

View File

@@ -10,7 +10,8 @@ func (s *QemuSuite) TestStartCommands(c *C) {
err := s.RunQemu("--cloud-config", "./tests/assets/test_26/cloud-config.yml")
c.Assert(err, IsNil)
for i := 1; i < 6; i++ {
for i := 1; i < 5; i++ {
s.CheckCall(c, fmt.Sprintf("ls /home/rancher | grep test%d", i))
}
s.CheckCall(c, "docker ps | grep nginx")
}