X-Git-Url: https://dehnerts.com/gitweb/?a=blobdiff_plain;f=post-install;h=25ef7e691f10ff34a0dcdfec5b345652ab09183a;hb=bb916e6a42be882901b8240c9666bb26d5874dbf;hp=7e79c92cd14b1cb3507934f087d77d98d6204a7d;hpb=3fdd52784aa682e75ec7407c38c4aed30136355a;p=sysconfig%2Fpostfix.git diff --git a/post-install b/post-install index 7e79c92..25ef7e6 100755 --- a/post-install +++ b/post-install @@ -40,8 +40,8 @@ # Arguments # .IP create-missing # Create missing queue directories with ownerships and permissions -# according to the contents of $daemon_directory/postfix-files -# and optionally in $daemon_directory/postfix-files.d/*, using +# according to the contents of $meta_directory/postfix-files +# and optionally in $meta_directory/postfix-files.d/*, using # the mail_owner and setgid_group parameter settings from the # command line, process environment or from the installed # main.cf file. @@ -49,8 +49,8 @@ # This is required at Postfix start-up time. # .IP set-permissions # Set all file/directory ownerships and permissions according to the -# contents of $daemon_directory/postfix-files and optionally -# in $daemon_directory/postfix-files.d/*, using the mail_owner +# contents of $meta_directory/postfix-files and optionally +# in $meta_directory/postfix-files.d/*, using the mail_owner # and setgid_group parameter settings from the command line, # process environment or from the installed main.cf file. # Implies create-missing. @@ -60,8 +60,8 @@ # settings after Postfix is already installed. # .IP upgrade-permissions # Update ownership and permission of existing files/directories as -# specified in $daemon_directory/postfix-files and optionally -# in $daemon_directory/postfix-files.d/*, using the mail_owner +# specified in $meta_directory/postfix-files and optionally +# in $meta_directory/postfix-files.d/*, using the mail_owner # and setgid_group parameter settings from the command line, # process environment or from the installed main.cf file. # Implies create-missing. @@ -175,12 +175,21 @@ # This feature is obsolete as of Postfix 2.1. # .IP readme_directory # The directory for the Postfix README files. +# .IP shlib_directory +# The directory for the Postfix shared-library files, and for +# the Postfix dabatase plugin files with a relative pathname +# in the file dynamicmaps.cf. +# .IP meta_directory +# The directory for non-executable files that are shared +# among multiple Postfix instances, such as postfix-files, +# dynamicmaps.cf, as well as the multi-instance template files +# main.cf.proto and master.cf.proto. # SEE ALSO # postfix-install(1) Postfix primary installation script. # FILES # $config_directory/main.cf, Postfix installation parameters. -# $daemon_directory/postfix-files, installation control file. -# $daemon_directory/postfix-files.d/*, optional control files. +# $meta_directory/postfix-files, installation control file. +# $meta_directory/postfix-files.d/*, optional control files. # $config_directory/install.cf, obsolete configuration file. # LICENSE # .ad @@ -191,6 +200,11 @@ # 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 #-- umask 022 @@ -205,7 +219,7 @@ debug=: MOST_PARAMETERS="command_directory daemon_directory data_directory html_directory mail_owner mailq_path manpage_directory newaliases_path queue_directory readme_directory sample_directory - sendmail_path setgid_group" + sendmail_path setgid_group shlib_directory meta_directory" NON_SHARED="config_directory queue_directory data_directory" USAGE="Usage: $0 [name=value] command @@ -225,6 +239,8 @@ obsolete=; keep_list=; for arg do case $arg in + *[" "]*) echo $0: "Error: argument contains whitespace: '$arg'" + exit 1;; *=*) IFS= eval $arg; IFS="$BACKUP_IFS";; create-missing) create=1;; set-perm*) create=1; set_perms=1;; @@ -287,8 +303,8 @@ do esac done -test -f $daemon_directory/postfix-files || { - echo $0: Error: $daemon_directory/postfix-files is not a file. 1>&2 +test -f $meta_directory/postfix-files || { + echo $0: Error: $meta_directory/postfix-files is not a file. 1>&2 exit 1 } @@ -361,7 +377,8 @@ case $setgid_group in esac for path in "$daemon_directory" "$command_directory" "$queue_directory" \ - "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory" + "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory" \ + "$meta_directory" do case "$path" in /*) ;; @@ -369,7 +386,7 @@ do esac done -for path in "$html_directory" "$readme_directory" +for path in "$html_directory" "$readme_directory" "$shlib_directory" do case "$path" in /*) ;; @@ -414,10 +431,37 @@ POSTCONF="$command_directory/postconf" # Save settings, allowing command line/environment override. +# Undo MAIL_VERSION expansion at the end of a parameter value. If +# someone really wants the expanded mail version in main.cf, then +# we're sorry. + +# Confine side effects from mail_version unexpansion within a subshell. + +(case "$mail_version" in +"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1 +esac + +for name in $MOST_PARAMETERS +do + eval junk=\$$name + case "$junk" in + *"$mail_version"*) + case "$pattern" in + "") pattern=`echo "$mail_version" | sed 's/\./\\\\./g'` || exit 1 + esac + val=`echo "$junk" | sed "s/$pattern"'$/${mail_version}/g'` || exit 1 + eval ${name}='"$val"' + esac +done + +# XXX Maybe update main.cf only with first install, upgrade, set +# permissions, and what else? Should there be a warning otherwise? + override= for name in $MOST_PARAMETERS do - eval test \"\$$name\" = \"`$POSTCONF -c $config_directory -h $name`\" || { + eval junk=\"\$$name\" + test "$junk" = "`$POSTCONF -c $config_directory -h $name`" || { override=1 break } @@ -438,14 +482,16 @@ test -n "$override" && { "manpage_directory = $manpage_directory" \ "sample_directory = $sample_directory" \ "readme_directory = $readme_directory" \ + "shlib_directory = $shlib_directory" \ + "meta_directory = $meta_directory" \ || exit 1 -} +} || exit 0) || exit 1 -# Use file/directory status information in $daemon_directory/postfix-files. +# Use file/directory status information in $meta_directory/postfix-files. test -n "$create" && { - postfix_files_d=$daemon_directory/postfix-files.d - for postfix_file in $daemon_directory/postfix-files \ + postfix_files_d=$meta_directory/postfix-files.d + for postfix_file in $meta_directory/postfix-files \ `test -d $postfix_files_d && { find $postfix_files_d -type f | sort; }` do exec <$postfix_file || exit 1