HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //etc.defaults/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: