hupfile is a SIGHUP aware output only file which implement io.WriteCloser.
When did it accepts SIGHUP, it reopen an underlying file.
This is intended to use with logrotate.
hupredir command reads from STDIN and write to a file.
And it accepts SIGHUP then reopen the file.
It makes your command support log rotation easily.
How to start hupredir:
$ your-cmd-output-stdout | hupredir -out my.log -pid my.pid &How to rotate log:
$ mv my.log my.log.1
$ kill -HUP $(cat my.pid)How to install and update hupredir:
$ go install github.com/koron-go/hupfile/cmd/hupredir@latestOr you can download the executable from the release.