[sles-beta] SLES11-SP3 RC1 aligning postfix configuration when upgrading from SLES11-SP2 not working in postfix.rpm SPEC

urs.frey at post.ch urs.frey at post.ch
Mon Apr 29 09:55:52 MDT 2013


Hi
When upgrading from SLES11SP2 to SLES11-SP3 RC1 I see constantly this message when postfix gets upgraded

Additional rpm output:
warning: /etc/postfix/main.cf created as /etc/postfix/main.cf.rpmnew
warning: /etc/postfix/master.cf created as /etc/postfix/master.cf.rpmnew
Align deprecated postfix configuration files.
Your configuration could not be checked for deprecated postfix parameters.
Please remove program_directory from your /etc/postfix/main.cf if exists.
Please rename fallback_relay to smtp_fallback_relay in your /etc/postfix/main.cf if exists.

So I digged deeper into the RPM SPEC scripts:

postinstall scriptlet (using /bin/sh):
# We never have to run suseconfig for postfix after update
# We only start postfix's own upgrade-configuration
if [ ${1:-0} -gt 1 ]; then
        echo "Align deprecated postfix configuration files."
        TD=/tmp/postfixEZo0gV
        if [ -d ${TD} ]
        then
                DA=2013-04-23-12-01
                sed /^[[:space:]]*program_directory/d                /etc/postfix/main.cf   > ${TD}/main.cf
                diff -q /etc/postfix/main.cf ${TD}/main.cf     || {
                        mv /etc/postfix/main.cf /etc/postfix/main.cf-${DA}
                        mv ${TD}/main.cf /etc/postfix/main.cf
                        echo "  Your main.cf was aligned. Your original file was saved as /etc/postfix/main.cf-${DA}"
                }
                sed 's/-o fallback_relay=/-o smtp_fallback_relay=/g' /etc/postfix/master.cf > ${TD}/master.cf
                diff -q /etc/postfix/master.cf ${TD}/master.cf || {
                        mv /etc/postfix/master.cf /etc/postfix/master.cf-${DA}
                        mv ${TD}/master.cf /etc/postfix/master.cf
                        echo "  Your master.cf was aligned. Your original file was saved as /etc/postfix/master.cf-${DA}"
                }
                rm ${TD}/main.cf ${TD}/master.cf
                rmdir ${TD}
        else
                echo "Your configuration could not be checked for deprecated postfix parameters."
                echo "Please remove program_directory from your /etc/postfix/main.cf if exists."
                echo "Please rename fallback_relay to smtp_fallback_relay in your /etc/postfix/main.cf if exists."
        fi

Question is, why should there be a directory named /tmp/postfixEZo0gV.
I will never have such a directory, as with every reboot the /tmp will be erased completely. SuSEconfig option.
So in the above script I will never make it into the then part, where sed removes the obsolete parameter program_directory etc.
It is correct doing this job only upon upgrades [ $1 -gt 1 ] , but the directory is not there as requested.
A quite simple approach would be grepping for the occurrence of program_directory in main.cf and sed if true.

I consider this as not yet OK and it should be reviewed please.

Thank you very much

Best regards

Urs Frey
Die Schweizerische Post
Services
Informationstechnologie
Webergutstrasse 12
3030 Bern (Zollikofen)
Telefon : ++41 (0)58 338 58 70
FAX     : ++41 (0)58 667 30 07
E-Mail:   urs.frey at post.ch<mailto:urs.frey at post.ch>




More information about the sles-beta mailing list