saslauthd 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin saslauthd
  4. #
  5. # Description : Cyrus SASL Boot Script
  6. #
  7. # Authors : Armin K. <krejzi@email.com>
  8. #
  9. # Version : BLFS SVN
  10. #
  11. # Notes : Not enabled by default.
  12. #
  13. ########################################################################
  14. ### BEGIN INIT INFO
  15. # Provides: saslauthd
  16. # Required-Start: $local_fs
  17. # Required-Stop: $local_fs
  18. # Default-Start: 2 3 4 5
  19. # Default-Stop: 0 1 6
  20. # Short-Description: saslauthd startup script
  21. # Description: This script starts the saslauthd daemon. It is
  22. # configured using the file /etc/sysconfig/saslauthd.
  23. # X-LFS-Provided-By: BLFS
  24. ### END INIT INFO
  25. . /lib/lsb/init-functions
  26. START="no"
  27. AUTHMECH=""
  28. OPTIONS=""
  29. if [ -f "/etc/sysconfig/saslauthd" ]; then
  30. . /etc/sysconfig/saslauthd
  31. fi
  32. case "${1}" in
  33. start)
  34. if [ "$START" != "yes" ]; then
  35. MSG="Configure saslauthd in /etc/sysconfig/saslauthd"
  36. log_warning_msg "$MSG and set START to yes"
  37. exit 0
  38. fi
  39. if [ -z "$AUTHMECH" ]; then
  40. MSG="You need to select auth mechanism in"
  41. log_warning_msg "$MSG /etc/sysconfig/saslauthd"
  42. exit 0
  43. fi
  44. if [ ! -d /var/run/saslauthd ]; then
  45. install -d -o root -g root -m 711 /var/run/saslauthd
  46. fi
  47. log_info_msg "Starting SASL Authentication Daemon saslauthd"
  48. start_daemon /usr/sbin/saslauthd -a $AUTHMECH $OPTIONS
  49. evaluate_retval
  50. ;;
  51. stop)
  52. log_info_msg "Stopping SASL Authentication Daemon saslauthd"
  53. killproc /usr/sbin/saslauthd
  54. evaluate_retval
  55. ;;
  56. restart)
  57. ${0} stop
  58. sleep 1
  59. ${0} start
  60. ;;
  61. status)
  62. statusproc /usr/sbin/saslauthd
  63. ;;
  64. *)
  65. echo "Usage: ${0} {start|stop|restart|status}"
  66. exit 1
  67. ;;
  68. esac
  69. exit 0
  70. # End saslauthd