PageRenderTime 36ms CodeModel.GetById 33ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/init.d/winbind

http://github.com/brinkman83/bashrc
Shell | 58 lines | 33 code | 14 blank | 11 comment | 9 complexity | 543843080ab6192d8b31cf81d9637322 MD5 | raw file
 1#!/bin/sh
 2
 3### BEGIN INIT INFO
 4# Provides:          winbind
 5# Required-Start:    $network $remote_fs $syslog
 6# Required-Stop:     $network $remote_fs $syslog
 7# Default-Start:     2 3 4 5
 8# Default-Stop:      0 1 6
 9# Short-Description: start Winbind daemon
10### END INIT INFO
11
12
13PATH=/sbin:/bin:/usr/sbin:/usr/bin
14
15[ -r /etc/default/winbind ] && . /etc/default/winbind
16
17DAEMON=/usr/sbin/winbindd
18PIDDIR=/var/run/samba
19WINBINDPID=$PIDDIR/winbindd.pid
20
21# clear conflicting settings from the environment
22unset TMPDIR
23
24# See if the daemon is there
25test -x $DAEMON || exit 0
26
27. /lib/lsb/init-functions
28
29case "$1" in
30	start)
31		log_daemon_msg "Starting the Winbind daemon" "winbind"
32
33		mkdir -p /var/run/samba/winbindd_privileged || return 1
34		chgrp winbindd_priv $PIDDIR/winbindd_privileged/ || return 1
35		chmod 0750 $PIDDIR/winbindd_privileged/ || return 1
36		start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $WINBINDD_OPTS
37
38		log_end_msg $?
39		;;
40
41	stop)
42		log_daemon_msg "Stopping the Winbind daemon" "winbind"
43		start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
44		log_end_msg $?
45		;;
46
47	restart|force-reload)
48		$0 stop && sleep 2 && $0 start
49		;;
50
51	status)
52		status_of_proc -p $WINBINDPID $DAEMON winbind && exit 0 || exit $?
53		;;
54	*)
55		echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload|status}"
56		exit 1
57		;;
58esac