File: //etc/init/winbindd.conf
description "Winbind"
author "Network Infrastructure Team"
start on syno.share.ready and syno.network.ready
stop on all-legacy-service-down
console log
respawn
respawn limit 5 10
pre-start script
SERVER_ROLE=$(synogetkeyvalue /etc/samba/smb.conf "server role")
SECURITY=`synogetkeyvalue /etc/samba/smb.conf security`
if [ "$SERVER_ROLE" != "active directory domain controller" -a \
"$SECURITY" != "ads" -a "$SECURITY" != "domain" ]; then
echo "not enable domain"
return false
fi
IFCONFIG=`/usr/sbin/ifconfig`
if [ "x$IFCONFIG" = "x" ]; then
date; echo "no interface"
stop; exit 1
fi
/usr/syno/etc/rc.sysv/S80samba.sh prestart_winbindd || true
end script
env TDB_NO_FSYNC=1
script
SERVER_ROLE=$(synogetkeyvalue /etc/samba/smb.conf "server role")
if [ -f "/run/samba/synoadserver" ]; then
exec /usr/bin/winbindd -D -F \
--configfile="/etc/samba/synoadserver.conf" \
--option="server role check:inhibit=yes" \
;
elif [ "active directory domain controller" = "${SERVER_ROLE,,}" ]; then
exec /usr/bin/winbindd -D -F --option="server role check:inhibit=yes"
else
exec /usr/bin/winbindd -F
fi
end script
post-start script
/usr/syno/etc/rc.sysv/S80samba.sh poststart_winbindd || true
end script
post-stop script
/usr/syno/etc/rc.sysv/S80samba.sh poststop_winbindd || true
end script
# vim: set ft=upstart noet: