SHARE
TWEET

winbind

a guest May 7th, 2014 175 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. # Should-Start:      samba
  8. # Default-Start:     2 3 4 5
  9. # Default-Stop:      0 1 6
  10. # Short-Description: start Winbind daemon
  11. ### END INIT INFO
  12.  
  13.  
  14. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  15.  
  16. [ -r /etc/default/winbind ] && . /etc/default/winbind
  17.  
  18. DAEMON=/usr/sbin/winbindd
  19. PIDDIR=/var/run/samba
  20. WINBINDPID=$PIDDIR/winbindd.pid
  21.  
  22. # clear conflicting settings from the environment
  23. unset TMPDIR
  24.  
  25. # See if the daemon is there
  26. test -x $DAEMON || exit 0
  27.  
  28. SERVER_ROLE=`samba-tool testparm --parameter-name="server role"  2>/dev/null | tail -1`
  29. if [ "$SERVER_ROLE" = "active directory domain controller" ]; then
  30.     exit 0
  31. fi
  32.  
  33. . /lib/lsb/init-functions
  34.  
  35. case "$1" in
  36.         start)
  37.                 if init_is_upstart; then
  38.                         exit 1
  39.                 fi
  40.                                 log_daemon_msg "Starting the Winbind daemon" "winbind"
  41.  
  42.                                
  43.                 mkdir -p /var/run/samba/winbindd_privileged || return 1
  44.                 chgrp proxy $PIDDIR/winbindd_privileged/ || return 1
  45.                 chmod 0750 $PIDDIR/winbindd_privileged/ || return 1
  46.                 start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $WINBINDD_OPTS
  47.  
  48.                 log_end_msg $?
  49.                 ;;
  50.  
  51.         stop)
  52.                 if init_is_upstart; then
  53.                         exit 0
  54.                 fi
  55.                 log_daemon_msg "Stopping the Winbind daemon" "winbind"
  56.                 start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
  57.                 log_end_msg $?
  58.                 ;;
  59.  
  60.         restart|force-reload)
  61.                 if init_is_upstart; then
  62.                         exit 1
  63.                 fi
  64.                 $0 stop && sleep 2 && $0 start
  65.                 ;;
  66.  
  67.         status)
  68.                 status_of_proc -p $WINBINDPID $DAEMON winbind && exit 0 || exit $?
  69.                 ;;
  70.         *)
  71.                 echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload|status}"
  72.                 exit 1
  73.                 ;;
  74. esac
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top