# ::do_not_edit::
# ::maintainer::
#
# patched to check if ldap subsystem has started properly, if not
#	smbd doesn't work at all!!
#
description "SMB/CIFS File Server"
author      "Steve Langasek <steve.langasek@ubuntu.com>"

start on (local-filesystems
	and ldap-checked
	and net-device-up)

stop on runlevel [!2345]

respawn

pre-start script
	RUN_MODE="daemons"

	[ -r /etc/default/samba ] && . /etc/default/samba

	[ "$RUN_MODE" = inetd ] && { stop; exit 0; }

	install -o root -g root -m 755 -d /var/run/samba
end script

exec smbd -F
