mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-06-18 05:00:03 +02:00
src/main.go: newsyslog actually sends SIGHUP, not SIGUSR1
This commit is contained in:
parent
8be4466d66
commit
0ddbf6dea0
1 changed files with 5 additions and 5 deletions
10
src/main.go
10
src/main.go
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue