mirror of
https://github.com/rancher/os.git
synced 2025-08-18 14:58:32 +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:
commit
0c32665255
@ -111,6 +111,11 @@ func Main() {
|
|||||||
if err := runScript(startScript); err != nil {
|
if err := runScript(startScript); err != nil {
|
||||||
log.Error(err)
|
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 {
|
if err := runScript("/etc/rc.local"); err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
}
|
}
|
||||||
@ -122,10 +127,6 @@ func Main() {
|
|||||||
log.Fatal(err)
|
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()))
|
log.Fatal(syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,13 +15,14 @@ write_files:
|
|||||||
permissions: "0755"
|
permissions: "0755"
|
||||||
owner: root
|
owner: root
|
||||||
content: |
|
content: |
|
||||||
touch /home/rancher/test4
|
wait-for-docker
|
||||||
|
docker run -d nginx
|
||||||
- path: /var/lib/rancher/conf/cloud-config-script
|
- path: /var/lib/rancher/conf/cloud-config-script
|
||||||
permissions: "0755"
|
permissions: "0755"
|
||||||
owner: root
|
owner: root
|
||||||
content: |
|
content: |
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
touch /home/rancher/test5
|
touch /home/rancher/test4
|
||||||
runcmd:
|
runcmd:
|
||||||
- []
|
- []
|
||||||
- [ test ]
|
- [ test ]
|
||||||
|
@ -10,7 +10,8 @@ func (s *QemuSuite) TestStartCommands(c *C) {
|
|||||||
err := s.RunQemu("--cloud-config", "./tests/assets/test_26/cloud-config.yml")
|
err := s.RunQemu("--cloud-config", "./tests/assets/test_26/cloud-config.yml")
|
||||||
c.Assert(err, IsNil)
|
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, fmt.Sprintf("ls /home/rancher | grep test%d", i))
|
||||||
}
|
}
|
||||||
|
s.CheckCall(c, "docker ps | grep nginx")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user