set -e
	if [ -z "$D" ]; then
		if command -v systemd-tmpfiles >/dev/null; then
			systemd-tmpfiles --create /usr/lib/tmpfiles.d/nscd.conf
		elif [ -e /etc/init.d/populate-volatile.sh ]; then
			/etc/init.d/populate-volatile.sh update
		fi
	fi
if type systemctl >/dev/null 2>/dev/null; then
	OPTS=""

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

	if [ "enable" = "enable" ]; then
		for service in nscd.service; do
			systemctl ${OPTS} enable "$service"
		done

		for service in ; do
			systemctl --global ${OPTS} enable "$service"
		done
	fi

	if [ -z "$D" ] && systemctl >/dev/null 2>/dev/null; then
		# Reload only system service manager
		# --global for daemon-reload is not supported: https://github.com/systemd/systemd/issues/19284
		systemctl daemon-reload
		[ -n "nscd.service" ] && \
			systemctl preset nscd.service

		[ -n "" ] && \
			systemctl --global preset 

		if [ "enable" = "enable" ]; then
			# --global flag for restart is not supported by systemd (see above)
			[ -n "nscd.service" ] && \
				systemctl --no-block restart nscd.service
		fi
	fi
fi
