# IBM T.J. Watson Research
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
+#
+# Wietse Venema
+# Google, Inc.
+# 111 8th Avenue
+# New York, NY 10011, USA
#--
# Avoid POSIX death due to SIGHUP when some parent process exits.
quick-start)
- $daemon_directory/master -t 2>/dev/null || {
- $FATAL the Postfix mail system is already running
- exit 1
- }
- $daemon_directory/postfix-script quick-check || {
- $FATAL Postfix integrity check failed!
- exit 1
- }
- $INFO starting the Postfix mail system
- $daemon_directory/master &
- ;;
+ $daemon_directory/master -t 2>/dev/null || {
+ $FATAL the Postfix mail system is already running
+ exit 1
+ }
+ $daemon_directory/postfix-script quick-check || {
+ $FATAL Postfix integrity check failed!
+ exit 1
+ }
+ $INFO starting the Postfix mail system
+ $daemon_directory/master &
+ ;;
-start)
+start|start-fg)
$daemon_directory/master -t 2>/dev/null || {
$FATAL the Postfix mail system is already running
$daemon_directory/postfix-script check-warn
fi
$INFO starting the Postfix mail system
- # NOTE: wait in foreground process to get the initialization status.
- $daemon_directory/master -w || {
- $FATAL "mail system startup failed"
- exit 1
- }
+ case $1 in
+ start)
+ # NOTE: wait in foreground process to get the initialization status.
+ $daemon_directory/master -w || {
+ $FATAL "mail system startup failed"
+ exit 1
+ }
+ ;;
+ start-fg)
+ # Foreground start-up is incompatible with multi-instance mode.
+ # We can't use "exec $daemon_directory/master" here: that would
+ # break process group management, and "postfix stop" would kill
+ # too many processes.
+ case $instances in
+ "") $daemon_directory/master
+ ;;
+ *) $FATAL "start-fg does not support multi_instance_directories"
+ exit 1
+ ;;
+ esac
+ ;;
+ esac
;;
drain)
find $todo ! -user root \
-exec $WARN not owned by root: {} \;
- find $todo \( -perm -020 -o -perm -002 \) \
+ # Handle symlinks separately
+ find -L $todo \( -perm -020 -o -perm -002 \) \
-exec $WARN group or other writable: {} \;
+ find $todo -type l | while read f; do \
+ readlink "$f" | grep -q / && $WARN symlink leaves directory: "$f"; \
+ done; \
+
# Check Postfix mail_owner-owned directory tree owner/permissions.
find $data_directory/. ! -user $mail_owner \
;;
*)
- $ERROR "unknown command: '$1'"
- $FATAL "usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)"
+ $FATAL "unknown command: '$1'. Usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)"
exit 1
;;