mirror of
https://github.com/rancher/os.git
synced 2025-08-18 23:09:04 +00:00
Fix respawn.conf.d
This commit is contained in:
parent
22ab564dac
commit
92e20827d8
@ -6,6 +6,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
@ -180,9 +181,11 @@ func writeRespawn() error {
|
|||||||
files, err := ioutil.ReadDir("/etc/respawn.conf.d")
|
files, err := ioutil.ReadDir("/etc/respawn.conf.d")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
content, err := ioutil.ReadFile(f.Name())
|
p := path.Join("/etc/respawn.conf.d", f.Name())
|
||||||
|
content, err := ioutil.ReadFile(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
log.Error("Failed to read %s: %v", p, err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
respawn += fmt.Sprintf("\n%s", string(content))
|
respawn += fmt.Sprintf("\n%s", string(content))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user