Hint for OpenVPN and monit users


Just noticed that my /var/log/openvpn.log had a size of 188 MB. This is caused by my OpenVPN monitoring (every 3 minutes) with monit:

check host openvpn with address
  start program = "/etc/init.d/openvpn start" with timeout 20 seconds
  stop  program = "/etc/init.d/openvpn stop"
  if failed port 443 type tcp with timeout 5 seconds for 2 cycles then restart
  if 4 restarts within 5 cycles then unmonitor

This leads to many

Thu Apr 19 21:41:45 2018 TCP connection established with [AF_INET]
Thu Apr 19 21:41:45 2018 Connection reset, restarting [0]
Thu Apr 19 21:41:45 2018 SIGUSR1[soft,connection-reset] received, client-instance restarting

messages in /var/log/openvpn.log, every 3 minutes.

By default OpenVPN has no logrotate - but we should enable it:

$ sudo nano /etc/logrotate.d/openvpn

/var/log/openvpn.log {
	rotate 2
	create 600 root root


Thanks for that, had 1 gb log file lol