/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. ### BEGIN INIT INFO
  3. # Provides: winbind
  4. # Required-Start: $network $remote_fs $syslog
  5. # Required-Stop: $network $remote_fs $syslog
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: start Winbind daemon
  9. ### END INIT INFO
  10. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  11. [ -r /etc/default/winbind ] && . /etc/default/winbind
  12. DAEMON=/usr/sbin/winbindd
  13. PIDDIR=/var/run/samba
  14. WINBINDPID=$PIDDIR/winbindd.pid
  15. # clear conflicting settings from the environment
  16. unset TMPDIR
  17. # See if the daemon is there
  18. test -x $DAEMON || exit 0
  19. . /lib/lsb/init-functions
  20. case "$1" in
  21. start)
  22. log_daemon_msg "Starting the Winbind daemon" "winbind"
  23. mkdir -p /var/run/samba/winbindd_privileged || return 1
  24. chgrp winbindd_priv $PIDDIR/winbindd_privileged/ || return 1
  25. chmod 0750 $PIDDIR/winbindd_privileged/ || return 1
  26. start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $WINBINDD_OPTS
  27. log_end_msg $?
  28. ;;
  29. stop)
  30. log_daemon_msg "Stopping the Winbind daemon" "winbind"
  31. start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
  32. log_end_msg $?
  33. ;;
  34. restart|force-reload)
  35. $0 stop && sleep 2 && $0 start
  36. ;;
  37. status)
  38. status_of_proc -p $WINBINDPID $DAEMON winbind && exit 0 || exit $?
  39. ;;
  40. *)
  41. echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload|status}"
  42. exit 1
  43. ;;
  44. esac