diff --git a/keepalived-vip/keepalived.go b/keepalived-vip/keepalived.go index c1b14122dc..9733ad4d79 100644 --- a/keepalived-vip/keepalived.go +++ b/keepalived-vip/keepalived.go @@ -100,6 +100,8 @@ type keepalived struct { useUnicast bool } +// WriteCfg creates a new keepalived configuration file. +// In case of an error with the generation it returns the error func (k *keepalived) WriteCfg(svcs []vip) error { w, err := os.Create("/etc/keepalived/keepalived.conf") if err != nil { @@ -129,6 +131,8 @@ func (k *keepalived) WriteCfg(svcs []vip) error { return t.Execute(w, conf) } +// Start starts a keepalived process in foreground. +// In case of any error it will terminate the execution with a fatal error func (k *keepalived) Start() { cmd := exec.Command("keepalived", "--dont-fork", @@ -148,6 +152,7 @@ func (k *keepalived) Start() { } } +// Reload sends SIGHUP to keepalived to reload the configuration. func (k *keepalived) Reload() error { glog.Info("reloading keepalived") _, err := k8sexec.New().Command("killall", "-1", "keepalived").CombinedOutput() diff --git a/keepalived-vip/main.go b/keepalived-vip/main.go index ed635cb268..d753f981a9 100644 --- a/keepalived-vip/main.go +++ b/keepalived-vip/main.go @@ -23,7 +23,6 @@ import ( "github.com/golang/glog" flag "github.com/spf13/pflag" - "github.com/openshift/origin/pkg/util/proc" "k8s.io/kubernetes/pkg/client/unversioned" kubectl_util "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/util" @@ -85,8 +84,6 @@ func main() { glog.Fatalf("Terminating execution: %v", err) } - proc.StartReaper() - glog.Info("starting LVS configuration") if *useUnicast { glog.Info("keepalived will use unicast to sync the nodes")