Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

postsrsd.rh_init.in 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #! /bin/sh
  2. #
  3. # @PROJECT_NAME@
  4. # start/stop the @PROJECT_NAME@ daemon for Postfix
  5. #
  6. # chkconfig: 2345 75 35
  7. # description: Sender Rewriting Scheme (SRS) for Postfix.
  8. # processname: @POSTSRSD@
  9. # pidfile: /var/run/@PROJECT_NAME@.pid
  10. # config: /etc/default/@PROJECT_NAME@
  11. set -e
  12. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  13. DAEMON=@CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@
  14. prog=@PROJECT_NAME@
  15. DESC="Postfix Sender Rewriting Scheme daemon"
  16. PIDFILE=/var/run/$prog.pid
  17. SCRIPTNAME=/etc/init.d/$prog
  18. # Gracefully exit if the package has been removed.
  19. test -x $DAEMON || exit 0
  20. . /etc/init.d/functions
  21. # Default configuration
  22. SRS_DOMAIN=`postconf -h mydomain || true`
  23. SRS_FORWARD_PORT=10001
  24. SRS_REVERSE_PORT=10002
  25. SRS_SECRET=/etc/@PROJECT_NAME@.secret
  26. RUN_AS=nobody
  27. CHROOT=@CHROOT_DIR@
  28. # Read config file if it is present.
  29. if [ -r /etc/default/$prog ]
  30. then
  31. . /etc/default/$prog
  32. fi
  33. test -r "$SRS_SECRET" -a -n "$SRS_DOMAIN" || exit 0
  34. do_start()
  35. {
  36. echo -n "Starting $DESC: "
  37. daemon $prog -4 -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" \
  38. -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
  39. RETVAL=$?
  40. echo
  41. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
  42. return $RETVAL
  43. }
  44. do_stop()
  45. {
  46. echo -n "Stopping $DESC: "
  47. killproc $prog
  48. RETVAL=$?
  49. echo
  50. [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
  51. return $RETVAL
  52. }
  53. case "$1" in
  54. start)
  55. do_start
  56. ;;
  57. stop)
  58. do_stop
  59. ;;
  60. status)
  61. status $prog
  62. ;;
  63. restart|force-reload)
  64. do_stop
  65. do_start
  66. ;;
  67. reload)
  68. ;;
  69. condrestart|try-restart)
  70. if [ -f /var/lock/subsys/$prog ]; then
  71. do_stop
  72. do_start
  73. fi
  74. ;;
  75. *)
  76. echo "Usage: $prog {start|stop|restart|condrestart|try-restart|reload|force-reload|status|usage}"
  77. [ "$1" = "usage" ] && exit 0
  78. exit 2
  79. ;;
  80. esac
  81. exit $?