Commit e8e167bd authored by ale's avatar ale

Notify systemd also for readonly instances

Otherwise they won't be able to start.
parent 1b52bb36
Pipeline #4306 passed with stages
in 1 minute and 34 seconds
......@@ -9,6 +9,7 @@ import (
"syscall"
"git.autistici.org/ai3/go-common/serverutil"
"github.com/coreos/go-systemd/daemon"
"github.com/google/subcommands"
"git.autistici.org/ai3/tools/replds"
......@@ -62,7 +63,12 @@ func (c *serverCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}
// If this is a readonly server, just wait for a termination
// signal, otherwise start the HTTP server for our API.
if config.Server.Readonly {
sigCh := make(chan os.Signal)
// We must notify systemd of our successful startup
// (this is normally done by serverutil.Serve in the
// non-readonly case).
daemon.SdNotify(false, "READY=1") // nolint:errcheck
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
<-sigCh
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment