karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
298 stars 106 forks source link

kh15 - HUP signal does not always re-open logfiles (for logrotate) #330

Closed hrodenburg closed 3 years ago

hrodenburg commented 3 years ago

Hi,

Last week we updated from kh14 to kh15. We notice that sending an HUP signal sometimes would not re-open the logfiles, which we use for logrotate. Instead it keeps writing to the rotated logfile, which will be deleted after gzipping.

When investigating a faulty process:

$ sudo lsof -u ics2bss | grep log
icecast 5341 ics2bss    2w   REG     249,6  7768621    123073 /d/0/ss/ics2b/dlog/error.log.20200910.rotated (deleted)
icecast 5341 ics2bss   16w   REG     249,6  1304512    123074 /d/0/ss/ics2b/dlog/access.log.20200914.rotated (deleted) 

Sending a HUP signal re-opens the accesslog (which it didn't do when done by our logrotate scripts), but not the errorlog:

$ ps -fu ics2bss
UID        PID  PPID  C STIME TTY          TIME CMD
ics2bss   5341     1  1 Sep10 ?        02:22:57 icecast -c /e/ss/ics2b/conf/icecast.xml -b 1

$ sudo kill -HUP 5341

$ sudo lsof -u ics2bss | grep log
icecast 5341 ics2bss    2w   REG     249,6  7768876    123073 /d/0/ss/ics2b/dlog/error.log.20200910.rotated (deleted)
icecast 5341 ics2bss   16w   REG     249,6     1053    122982 /d/0/ss/ics2b/dlog/access.log 

We have multiple kh15 instances running into these problems. We also have still some kh14 instances running, which have no problems at all, so it's clearly introduced in kh15.

BenHippynet commented 3 years ago

Looks like it could be the same as #313 and #326. We went with the Master Tree and is solved it for us.

Ben

hrodenburg commented 3 years ago

Hi Ben,

Thanks! I totally missed that. I did searched through the open issues, but skipped the closed ones (and also missed the commit in the master branch...). We will patch our kh15 download with the commit in master https://github.com/karlheyes/icecast-kh/commit/e06f7b43f927a997c445b97dd81776b02d921cfb, which has been confirmed (by you) as a fix for this.

Hugo