postfix.init 618 B

1234567891011121314151617181920212223242526272829303132333435
  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. exec sh $0 start
  10. ;;
  11. start)
  12. [ -d /var/spool/postfix ] || mkdir -p /var/spool/postfix
  13. [ -d /var/lib/postfix ] || mkdir -p /var/lib/postfix
  14. chown postfix /var/lib/postfix
  15. mount -o remount,rw /
  16. chgrp postdrop /usr/sbin/postqueue
  17. chgrp postdrop /usr/sbin/postdrop
  18. chmod 2755 /usr/sbin/postqueue /usr/sbin/postdrop
  19. mount -o remount,ro /
  20. postfix start
  21. ;;
  22. stop)
  23. postfix stop
  24. ;;
  25. restart)
  26. sh $0 stop
  27. sh $0 start
  28. ;;
  29. *)
  30. echo "Usage: $0 {start | stop | restart}"
  31. exit 1
  32. ;;
  33. esac
  34. exit $?