Merge pull request #1030 from mrunalp/move_crio_sock

Move crio default sock to /var/run/crio/crio.sock
This commit is contained in:
Antonio Murdaca 2017-10-19 00:53:10 +02:00 committed by GitHub
commit 12ce3ba3ed
8 changed files with 12 additions and 7 deletions

View file

@ -8,6 +8,7 @@ import (
_ "net/http/pprof"
"os"
"os/signal"
"path/filepath"
"sort"
"strings"
@ -419,6 +420,10 @@ func main() {
return fmt.Errorf("invalid --runtime value %q", err)
}
if err := os.MkdirAll(filepath.Dir(config.Listen), 0755); err != nil {
return err
}
// Remove the socket if it already exists
if _, err := os.Stat(config.Listen); err == nil {
if err := os.Remove(config.Listen); err != nil {