post_install() {
	if ! getent group ulogd &>/dev/null; then
		groupadd -r ulogd >/dev/null
	fi
	if ! getent passwd ulogd &>/dev/null; then
		useradd -r -g ulogd -d /dev/null -s /bin/nologin ulogd >/dev/null
	fi
	chown root:ulogd etc/ulogd.conf
	ulogd_shell=$(getent passwd ulogd | cut -d: -f7)
	if [ "$ulogd_shell" != '/bin/nologin' ]; then
		chsh -s /bin/nologin ulogd &>/dev/null
	fi
}

post_upgrade() {
	post_install
}

post_remove() {
	if getent passwd ulogd &>/dev/null; then
		userdel ulogd >/dev/null
	fi
	if getent group ulogd &>/dev/null; then
		groupdel ulogd >/dev/null
	fi
}
