mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-04 12:03:43 +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
|
// Setup a channel
|
||||||
sig_ch := make(chan os.Signal, 1)
|
sig_ch := make(chan os.Signal, 1)
|
||||||
|
|
||||||
// subscribe to USR1 signal.
|
// subscribe to SIGHUP signal.
|
||||||
signal.Notify(sig_ch, syscall.SIGUSR1)
|
signal.Notify(sig_ch, syscall.SIGHUP)
|
||||||
|
|
||||||
// Event loop (runs in a seperate thread)
|
// Event loop (runs in a seperate thread)
|
||||||
go func() {
|
go func() {
|
||||||
|
|
@ -85,9 +85,9 @@ func signalEventLoop() {
|
||||||
sig := <- sig_ch
|
sig := <- sig_ch
|
||||||
|
|
||||||
switch sig {
|
switch sig {
|
||||||
// USR1 is sent when logfile is rotated.
|
// SIGHUP is sent when logfile is rotated.
|
||||||
case syscall.SIGUSR1 :
|
case syscall.SIGHUP :
|
||||||
msg := "SIGUSR1 (Logfile was rotated): "
|
msg := "SIGHUP (Logfile was rotated): "
|
||||||
|
|
||||||
if logfd != nil {
|
if logfd != nil {
|
||||||
setLogFile()
|
setLogFile()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue