mirror of
https://github.com/rancher/os.git
synced 2025-07-08 12:28:37 +00:00
Merge pull request #570 from ibuildthecloud/systemd
Fix systemd emulation
This commit is contained in:
commit
2caa8f95ac
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -351,8 +351,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/rancher/docker-from-scratch",
|
"ImportPath": "github.com/rancher/docker-from-scratch",
|
||||||
"Comment": "1.8.1-2-gbcc17ea",
|
"Comment": "v1.8.2-1",
|
||||||
"Rev": "bcc17eae6f79e46cb65a74e4406cb3bcc24c38fb"
|
"Rev": "500f0babfdbfcd55fbdbf6690e4508ceb7323474"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/rancher/netconf",
|
"ImportPath": "github.com/rancher/netconf",
|
||||||
|
8
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scratch.go
generated
vendored
8
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scratch.go
generated
vendored
@ -138,7 +138,7 @@ func CreateSymlinks(pathSets [][]string) error {
|
|||||||
|
|
||||||
func CreateSymlink(src, dest string) error {
|
func CreateSymlink(src, dest string) error {
|
||||||
if _, err := os.Lstat(dest); os.IsNotExist(err) {
|
if _, err := os.Lstat(dest); os.IsNotExist(err) {
|
||||||
log.Debugf("Symlinking %s => %s", src, dest)
|
log.Debugf("Symlinking %s => %s", dest, src)
|
||||||
if err = os.Symlink(src, dest); err != nil {
|
if err = os.Symlink(src, dest); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -458,15 +458,17 @@ func prepare(config *Config, docker string, args ...string) error {
|
|||||||
|
|
||||||
func setupSystemd(config *Config) error {
|
func setupSystemd(config *Config) error {
|
||||||
if !config.EmulateSystemd {
|
if !config.EmulateSystemd {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
cgroups, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cgroup", os.Getpid()))
|
cgroups, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cgroup", os.Getpid()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(string(cgroups), "name=systemd") {
|
if strings.Contains(string(cgroups), "name=systemd") {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if err := createMounts(systemdMounts...); err != nil {
|
if err := createMounts(systemdMounts...); err != nil {
|
||||||
return err
|
return err
|
||||||
|
2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/download
generated
vendored
2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/download
generated
vendored
@ -47,7 +47,7 @@ else
|
|||||||
cp assets/base-files.tar.gz build
|
cp assets/base-files.tar.gz build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
download 9a711e6b98a388b12091cf716c5996b67a2e223a https://get.docker.com/builds/Linux/x86_64/docker-1.8.1
|
download ad3618b980105d907aae7bba40ca3ababb7c3d6d https://get.docker.com/builds/Linux/x86_64/docker-1.8.2
|
||||||
|
|
||||||
cp assets/docker-* build/docker
|
cp assets/docker-* build/docker
|
||||||
chmod +x build/docker
|
chmod +x build/docker
|
||||||
|
2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/version
generated
vendored
2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/version
generated
vendored
@ -1 +1 @@
|
|||||||
1.8.1
|
1.8.2
|
||||||
|
@ -140,6 +140,7 @@ func getLaunchConfig(cfg *config.CloudConfig, dockerCfg *config.DockerConfig) (*
|
|||||||
launchConfig.DnsConfig.Nameservers = cfg.Rancher.Network.Dns.Nameservers
|
launchConfig.DnsConfig.Nameservers = cfg.Rancher.Network.Dns.Nameservers
|
||||||
launchConfig.DnsConfig.Search = cfg.Rancher.Network.Dns.Search
|
launchConfig.DnsConfig.Search = cfg.Rancher.Network.Dns.Search
|
||||||
launchConfig.Environment = dockerCfg.Environment
|
launchConfig.Environment = dockerCfg.Environment
|
||||||
|
launchConfig.EmulateSystemd = true
|
||||||
|
|
||||||
if !cfg.Rancher.Debug {
|
if !cfg.Rancher.Debug {
|
||||||
launchConfig.LogFile = config.SYSTEM_DOCKER_LOG
|
launchConfig.LogFile = config.SYSTEM_DOCKER_LOG
|
||||||
|
Loading…
Reference in New Issue
Block a user