9 "git.curoverse.com/arvados.git/sdk/go/config"
10 "github.com/coreos/go-systemd/daemon"
16 configPath := flag.String("config", "/etc/arvados/ws/ws.yml", "`path` to config file")
17 dumpConfig := flag.Bool("dump-config", false, "show current configuration and exit")
18 cfg := defaultConfig()
21 err := config.LoadFile(&cfg, *configPath)
29 txt, err := config.Dump(&cfg)
33 fmt.Print(string(txt))
38 eventSource := &pgEventSource{
39 DataSource: cfg.Postgres.ConnectionString(),
40 QueueSize: cfg.ServerEventQueue,
44 ReadTimeout: time.Minute,
45 WriteTimeout: time.Minute,
46 MaxHeaderBytes: 1 << 20,
49 eventSource: eventSource,
50 newPermChecker: func() permChecker { return newPermChecker(cfg.Client) },
53 // Bootstrap the eventSource by attaching a dummy subscriber
55 eventSource.NewSink().Stop()
57 if _, err := daemon.SdNotify(false, "READY=1"); err != nil {
58 log.WithError(err).Warn("error notifying init daemon")
61 log.WithField("Listen", srv.Addr).Info("listening")
62 log.Fatal(srv.ListenAndServe())