1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-17 04:50:02 +02:00

src/main.go: newsyslog actually sends SIGHUP, not SIGUSR1

This commit is contained in:
Henrik Hautakoski 2021-12-24 11:06:30 +01:00
parent 8be4466d66
commit 0ddbf6dea0

View file

@ -75,8 +75,8 @@ func signalEventLoop() {
// Setup a channel
sig_ch := make(chan os.Signal, 1)
// subscribe to USR1 signal.
signal.Notify(sig_ch, syscall.SIGUSR1)
// subscribe to SIGHUP signal.
signal.Notify(sig_ch, syscall.SIGHUP)
// Event loop (runs in a seperate thread)
go func() {
@ -85,9 +85,9 @@ func signalEventLoop() {
sig := <- sig_ch
switch sig {
// USR1 is sent when logfile is rotated.
case syscall.SIGUSR1 :
msg := "SIGUSR1 (Logfile was rotated): "
// SIGHUP is sent when logfile is rotated.
case syscall.SIGHUP :
msg := "SIGHUP (Logfile was rotated): "
if logfd != nil {
setLogFile()