1
0
mirror of https://github.com/rancher/os.git synced 2025-08-01 23:17:50 +00:00

Merge pull request #1324 from joshwget/console-done-before-rc-local

Write /run/console-done before executing /etc/rc.local
This commit is contained in:
Darren Shepherd 2016-10-14 11:37:17 -07:00 committed by GitHub
commit 0c32665255
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")
}