...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package etcdmain
16
17 import (
18 "fmt"
19 "os"
20
21 "github.com/coreos/go-systemd/v22/daemon"
22 "go.uber.org/zap"
23 )
24
25 func Main(args []string) {
26 checkSupportArch()
27
28 if len(args) > 1 {
29 cmd := args[1]
30 switch cmd {
31 case "gateway", "grpc-proxy":
32 if err := rootCmd.Execute(); err != nil {
33 fmt.Fprint(os.Stderr, err)
34 os.Exit(1)
35 }
36 return
37 }
38 }
39
40 startEtcdOrProxyV2(args)
41 }
42
43 func notifySystemd(lg *zap.Logger) {
44 lg.Info("notifying init daemon")
45 _, err := daemon.SdNotify(false, daemon.SdNotifyReady)
46 if err != nil {
47 lg.Error("failed to notify systemd for readiness", zap.Error(err))
48 return
49 }
50 lg.Info("successfully notified init daemon")
51 }
52
View as plain text