
| Current Path : /var/lib/dpkg/info/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/lib/dpkg/info/winbind.postinst |
#!/bin/sh
set -e
mask_services() {
local reason="$1"
shift
local masked_count=0
mkdir -p /etc/systemd/system
echo "${reason}: Masking $*"
echo "Please ignore the following error about deb-systemd-helper not finding those services."
while true; do
local service_name="$1"
if [ -z "$service_name" ]; then
break
fi
shift
if [ ! -e "/etc/systemd/system/${service_name}" ]; then
ln -s /dev/null "/etc/systemd/system/${service_name}"
echo "(${service_name} masked)"
masked_count=$((masked_count+1))
elif [ -h "/etc/systemd/system/${service_name}" ] \
&& [ "$(realpath /etc/systemd/system/${service_name})" = /dev/null ] \
; then
echo "(${service_name} already masked)"
else
echo "WARNING ${service_name} should be masked. The install may fail."
fi
done
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ "${masked_count}" -ge 1 -a -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
}
getent group winbindd_priv >/dev/null 2>&1 ||
addgroup --system --force-badname --quiet winbindd_priv
winbindd_privileged_socket_directory='/var/lib/samba/winbindd_privileged'
mkdir -pv "$winbindd_privileged_socket_directory"
chgrp -c winbindd_priv "$winbindd_privileged_socket_directory"
chmod -c 0750 "$winbindd_privileged_socket_directory"
SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1`
if [ "$SERVER_ROLE" = "active directory domain controller" ]; then
mask_services "Samba is being run as an AD Domain Controller" winbind.service
fi
# Automatically added by dh_installdeb/12.10ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init/winbind.conf 2:4.6.5\+dfsg-5\~ -- "$@"
# End automatically added section
# Automatically added by dh_installinit/12.10ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/winbind" ]; then
update-rc.d winbind defaults >/dev/null
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
invoke-rc.d --skip-systemd-native winbind $_dh_action || exit 1
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/12.10ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'winbind.service' >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'winbind.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'winbind.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'winbind.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/12.10ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
deb-systemd-invoke $_dh_action 'winbind.service' >/dev/null || true
fi
fi
# End automatically added section