Aller à : navigation, rechercher

SAMBA - Fichier init.d winbind

Recopier le contenu dans le fichier ci-dessous /etc/init.d/winbind, ensuite lancer les commandes

chmod 755 /etc/init.d/winbind
update-rc.d winbind defaults

Fichier d'exemple de démarrage init.d winbind

#!/bin/sh

### BEGIN INIT INFO
# Provides:          winbind
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Should-Start:      samba
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start Winbind daemon
### END INIT INFO


PATH=/sbin:/bin:/usr/sbin:/usr/bin

DAEMON=/usr/local/samba/sbin/winbindd
PIDDIR=/usr/local/samba/var/run/
WINBINDPID=$PIDDIR/winbindd.pid

# clear conflicting settings from the environment
unset TMPDIR

# See if the daemon is there
test -x $DAEMON || exit 0

. /lib/lsb/init-functions

case "$1" in
	start)
		log_daemon_msg "Starting the Winbind daemon" "winbind"

		start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $WINBINDD_OPTS

		log_end_msg $?
		;;

	stop)
		log_daemon_msg "Stopping the Winbind daemon" "winbind"
		start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
		log_end_msg $?
		;;

	restart|force-reload)
		$0 stop && sleep 2 && $0 start
		;;

	status)
		status_of_proc -p $WINBINDPID $DAEMON winbind && exit 0 || exit $?
		;;
	*)
		echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload|status}"
		exit 1
		;;
esac