1
0
mirror of https://github.com/rancher/os.git synced 2025-07-07 11:58:38 +00:00

Merge pull request #570 from ibuildthecloud/systemd

Fix systemd emulation
This commit is contained in:
Darren Shepherd 2015-09-22 11:04:34 -07:00
commit 2caa8f95ac
5 changed files with 15 additions and 12 deletions

4
Godeps/Godeps.json generated
View File

@ -351,8 +351,8 @@
},
{
"ImportPath": "github.com/rancher/docker-from-scratch",
"Comment": "1.8.1-2-gbcc17ea",
"Rev": "bcc17eae6f79e46cb65a74e4406cb3bcc24c38fb"
"Comment": "v1.8.2-1",
"Rev": "500f0babfdbfcd55fbdbf6690e4508ceb7323474"
},
{
"ImportPath": "github.com/rancher/netconf",

View File

@ -138,7 +138,7 @@ func CreateSymlinks(pathSets [][]string) error {
func CreateSymlink(src, dest string) error {
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 {
return err
}
@ -458,14 +458,16 @@ func prepare(config *Config, docker string, args ...string) error {
func setupSystemd(config *Config) error {
if !config.EmulateSystemd {
cgroups, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cgroup", os.Getpid()))
if err != nil {
return err
}
return nil
}
if !strings.Contains(string(cgroups), "name=systemd") {
return nil
}
cgroups, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cgroup", os.Getpid()))
if err != nil {
return err
}
if strings.Contains(string(cgroups), "name=systemd") {
return nil
}
if err := createMounts(systemdMounts...); err != nil {

View File

@ -47,7 +47,7 @@ else
cp assets/base-files.tar.gz build
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
chmod +x build/docker

View File

@ -1 +1 @@
1.8.1
1.8.2

View File

@ -140,6 +140,7 @@ func getLaunchConfig(cfg *config.CloudConfig, dockerCfg *config.DockerConfig) (*
launchConfig.DnsConfig.Nameservers = cfg.Rancher.Network.Dns.Nameservers
launchConfig.DnsConfig.Search = cfg.Rancher.Network.Dns.Search
launchConfig.Environment = dockerCfg.Environment
launchConfig.EmulateSystemd = true
if !cfg.Rancher.Debug {
launchConfig.LogFile = config.SYSTEM_DOCKER_LOG