#!/bin/sh
[ "$1" != "upgrade" ] || exit 0
# remove syslog
	if test "x$D" = "x"; then
		if test "$1" = "upgrade" -o "$1" = "remove"; then
			/etc/init.d/syslog stop
		fi
	fi
	update-alternatives --remove  syslog-conf /etc/syslog.conf.busybox
	update-alternatives --remove  syslog-init /etc/init.d/syslog.busybox
	update-alternatives --remove  syslog-startup-conf /etc/syslog-startup.conf.busybox
if [ -n "$D" -o ! -d /run/systemd/system ] && [ -z "$D" -a ! -d /run/systemd/system ]; then
	/etc/init.d/syslog stop
fi
OPTS=""

if [ -n "$D" ]; then
    OPTS="--root=$D"
fi

if type systemctl >/dev/null 2>/dev/null; then
	if [ -z "$D" ]; then
		systemctl stop busybox-syslog.service
	fi

	systemctl $OPTS disable busybox-syslog.service
fi
