/var/log/merlin/*log {
	create 644 naemon naemon
	weekly
	rotate 4
	sharedscripts
	missingok
	postrotate
		if command -v systemctl &>/dev/null; then
			systemctl try-restart merlind > /dev/null 2>&1
			systemctl try-restart naemon > /dev/null 2>&1
		else
			service naemon status
			mon_running=$?
			service merlind status
			merlin_running=$?
			service naemon stop
			service merlind stop
			sleep 1
			test $merlin_running -eq 0 && nice -n 0 service merlind start || :
			test $mon_running -eq 0 && nice -n 0 service naemon start || :
		fi
	endscript
}
