From 69d03cb4e2a8f22a0f59cc32448b2d5dddd039ff Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 7 Oct 2021 13:31:31 +0300 Subject: [PATCH] Linux does not have SIGINFO --- cmd/godlighty/info.go | 8 ++++++++ cmd/godlighty/info_linux.go | 8 ++++++++ cmd/godlighty/main.go | 2 +- doc/index.texi | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 cmd/godlighty/info.go create mode 100644 cmd/godlighty/info_linux.go diff --git a/cmd/godlighty/info.go b/cmd/godlighty/info.go new file mode 100644 index 0000000..fc3e8c1 --- /dev/null +++ b/cmd/godlighty/info.go @@ -0,0 +1,8 @@ +//go:build !linux +// +build !linux + +package main + +import "syscall" + +var InfoSignal = syscall.SIGINFO diff --git a/cmd/godlighty/info_linux.go b/cmd/godlighty/info_linux.go new file mode 100644 index 0000000..386d6b3 --- /dev/null +++ b/cmd/godlighty/info_linux.go @@ -0,0 +1,8 @@ +//go:build linux +// +build linux + +package main + +import "syscall" + +var InfoSignal = syscall.SIGUSR1 diff --git a/cmd/godlighty/main.go b/cmd/godlighty/main.go index e15c165..1344aaa 100644 --- a/cmd/godlighty/main.go +++ b/cmd/godlighty/main.go @@ -96,7 +96,7 @@ func main() { } info := make(chan os.Signal) - signal.Notify(info, syscall.SIGINFO) + signal.Notify(info, InfoSignal) go func() { for { <-info diff --git a/doc/index.texi b/doc/index.texi index 9265d5e..2b86584 100644 --- a/doc/index.texi +++ b/doc/index.texi @@ -61,7 +61,8 @@ have to recompile it every time configuration changes. Is it a problem? I doubt, because Go is very fast. But it produces huge statically linked executables, you say! Use @command{bsdiff}/@command{bspatch}! -Send @code{SIGINFO} signal to get current daemon's configuration. +Send @code{SIGINFO} (@code{SIGUSR1} on Linux) signal to get current +daemon's configuration. Initially @command{godlighty} has basic static files handlers (with compression, HTTP preconditions are enabled of course). In the example -- 2.44.0