postfix.init 695 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. #PKG postfix
  3. #INIT 80
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${postfix:-NO}" = x"NO" && exit 0
  9. test x"$postfix" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  10. exec sh $0 start
  11. ;;
  12. start)
  13. [ -d /var/spool/postfix ] || mkdir -p /var/spool/postfix
  14. [ -d /var/lib/postfix ] || mkdir -p /var/lib/postfix
  15. chown postfix /var/lib/postfix
  16. mount -o remount,rw /
  17. chgrp postdrop /usr/sbin/postqueue
  18. chgrp postdrop /usr/sbin/postdrop
  19. chmod 2755 /usr/sbin/postqueue /usr/sbin/postdrop
  20. mount -o remount,ro /
  21. postfix start
  22. ;;
  23. stop)
  24. postfix stop
  25. ;;
  26. restart)
  27. sh $0 stop
  28. sh $0 start
  29. ;;
  30. *)
  31. echo "Usage: $0 {start | stop | restart}"
  32. exit 1
  33. ;;
  34. esac
  35. exit $?