description "starting syslogd"
author "Riku Voipio"

start on stopped rcS

pre-start script

	SYSLOG_SIZE_MB_THRESHOLD=5
	SYSLOG_SIZE_MB=`du -sm /var/log/syslog | cut -f1`

	# only move syslog if it's size is greater or equals to specified threshold
	if [ $SYSLOG_SIZE_MB -ge $SYSLOG_SIZE_MB_THRESHOLD ]; then
		mv /var/log/syslog /var/log/syslog.old || true
	fi

end script

console none
service
exec /sbin/syslogd -n
