daemon(8): Make daemon aware of log rotation
commit9f0202884c1ad1d00fb71dad7c6dc087f2fb4beb
authorPeeter Must <karu.pruun@gmail.com>
Sun, 10 May 2020 08:49:05 +0000 (10 11:49 +0300)
committerPeeter Must <karu.pruun@gmail.com>
Sun, 10 May 2020 08:49:05 +0000 (10 11:49 +0300)
treef94a1d866dafc719b260f53627f14c1d5391b31c
parent651194323784d49085ce3ebfdf7d1670bc2659aa
daemon(8): Make daemon aware of log rotation

* Make daemon listen to SIGUSR1 so that when newsyslog
  has finished log rotation, it can send SIGUSR1 to
  daemon, who can then reopen the log file specified by
  the '-o' option.

* Failure to open the log file will be logged through
  syslog with LOG_NOTICE. The next attempt to reopen
  the log file will be made upon receiving signal SIGUSR1.

Reviewed-by: swildner, tuxillo, dillon, aly
usr.sbin/daemon/daemon.c