Loading ...
Sorry, an error occurred while loading the content.

postfix-install: bin/postconf ignores new settings and re-uses old main.cf

Expand Messages
  • Mark Ashley
    Hi folks, I ran across a problem when installing postfix 2.9.5 on Solaris 10 and 11. If there is a pre-existing main.cf on the system then the make install
    Message 1 of 4 , Feb 3, 2013
    • 0 Attachment
      Hi folks,

      I ran across a problem when installing postfix 2.9.5 on Solaris 10 and
      11. If there is a pre-existing main.cf on the system then the "make
      install" step will re-use this, instead of using the settings
      contained in the new 2.9.5 code tree.

      It makes installing a new version problematic as you don't expect that
      sort of behaviour, old configs polluting new code. It's billed as a
      "transition aid" but it's annoying when you go out of your way to
      configure the postfix source tree to use other settings.

      Thanks,
      Mark.

      postfix-install:
      CONFIG_PARAMS="command_directory daemon_directory data_directory \
      html_directory mail_owner mailq_path manpage_directory newaliases_path \
      queue_directory readme_directory sendmail_path setgid_group"

      # Extract parameter settings from the installed main.cf file.

      test -f $CONFIG_DIRECTORY/main.cf && {
      for name in $CONFIG_PARAMS sample_directory
      do
      eval junk=\$$name
      case "$junk" in
      "") eval unset $name;;
      esac
      eval : \${$name=\`bin/postconf -c $CONFIG_DIRECTORY -h $name\`} ||
      exit 1
      done
      }

      host:/var/tmp/postfix-2.9.5 root# sh -x postfix-install
      + umask 022
      + PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc:/usr/contrib/bin:/usr/gnu/bin:/usr/ucb:/usr/bsd
      + SHELL=/bin/sh
      [...]
      + echo Please specify the final destination directory for installed
      Postfix configuration files.
      Please specify the final destination directory for installed Postfix
      configuration files.
      + eval echo '$n' 'config_directory: [$config_directory]\ $c'
      + echo config_directory: '[/usr/local/etc/postfix] ' '\c'
      config_directory: [/usr/local/etc/postfix] + read ans
      + break
      + install_root=''
      + test -z ''
      + CONFIG_DIRECTORY=/usr/local/etc/postfix
      + grep setgid_group /usr/local/etc/postfix/main.cf
      + 1> /dev/null 2>& 1
      + CONFIG_PARAMS='command_directory daemon_directory data_directory
      html_directory mail_owner mailq_path manpage_directory
      newaliases_path queue_directory readme_directory sendmail_path
      setgid_group'
      + test -f /usr/local/etc/postfix/main.cf
      + eval junk='$command_directory'
      + junk=''
      + eval unset command_directory
      + unset command_directory
      + eval : '${command_directory=`bin/postconf' -c /usr/local/etc/postfix
      -h 'command_directory`}'
      + bin/postconf -c /usr/local/etc/postfix -h command_directory
      + : /usr/local/sbin
      + eval junk='$daemon_directory'
      + junk=''
      + eval unset daemon_directory
      + unset daemon_directory
      + eval : '${daemon_directory=`bin/postconf' -c /usr/local/etc/postfix
      -h 'daemon_directory`}'
      + bin/postconf -c /usr/local/etc/postfix -h daemon_directory
      + : sourced_from_legacy_file
      + eval junk='$data_directory'
      + junk=''
      + eval unset data_directory
      + unset data_directory
      + eval : '${data_directory=`bin/postconf' -c /usr/local/etc/postfix -h
      'data_directory`}'
      + bin/postconf -c /usr/local/etc/postfix -h data_directory
      + : /usr/local/var/postfix
      + eval junk='$html_directory'
      + junk=''
      + eval unset html_directory
      + unset html_directory
      + eval : '${html_directory=`bin/postconf' -c /usr/local/etc/postfix -h
      'html_directory`}'
      + bin/postconf -c /usr/local/etc/postfix -h html_directory
    • Reindl Harald
      ... sorry but what do you expcet? here are running a lot of postfix installs initially setup with postfix 2.4.x and now running on 2.10dev and a update should
      Message 2 of 4 , Feb 4, 2013
      • 0 Attachment
        Am 04.02.2013 02:05, schrieb Mark Ashley:
        > I ran across a problem when installing postfix 2.9.5 on Solaris 10 and
        > 11. If there is a pre-existing main.cf on the system then the "make
        > install" step will re-use this, instead of using the settings
        > contained in the new 2.9.5 code tree.
        >
        > It makes installing a new version problematic as you don't expect that
        > sort of behaviour, old configs polluting new code. It's billed as a
        > "transition aid" but it's annoying when you go out of your way to
        > configure the postfix source tree to use other settings.

        sorry but what do you expcet?

        here are running a lot of postfix installs initially setup with
        postfix 2.4.x and now running on 2.10dev and a update should
        never mangle or replace existing configurations especially
        since postfix is backward compatbile like no other software
      • Viktor Dukhovni
        ... The postfix-install script supports construction of packages that are neither influenced by nor capture the main.cf settings of the build host. Instead
        Message 3 of 4 , Feb 4, 2013
        • 0 Attachment
          On Mon, Feb 04, 2013 at 12:05:09PM +1100, Mark Ashley wrote:

          > I ran across a problem when installing postfix 2.9.5 on Solaris 10 and
          > 11. If there is a pre-existing main.cf on the system then the "make
          > install" step will re-use this, instead of using the settings
          > contained in the new 2.9.5 code tree.
          >
          > It makes installing a new version problematic as you don't expect that
          > sort of behaviour, old configs polluting new code. It's billed as a
          > "transition aid" but it's annoying when you go out of your way to
          > configure the postfix source tree to use other settings.

          The postfix-install script supports construction of "packages" that
          are neither influenced by nor capture the main.cf settings of the
          build host. Instead of doing an "install" or an "upgrade", create
          a package, then install the package on any machine of your choice.

          --
          Viktor.
        • Mark Ashley
          Hey folks, I ve added a substitution line for this problem to my compile recipe and am posting it here for the record. The install script now ignores any
          Message 4 of 4 , Feb 4, 2013
          • 0 Attachment
            Hey folks,

            I've added a substitution line for this problem to my compile recipe
            and am posting it here for the record.
            The install script now ignores any pre-existing configs on the machine
            and runs with the substituted settings
            added at compile time.

            This builds the software on Solaris 10 and 11, putting it wholly into
            the /usr/local tree, preserving the stock OS configs.
            The Solaris package preinstall scripts handle starting up postfix as a
            SMF service and disabling sendmail. The
            packages are now on the archive provided below.

            I'll depart this high volume list now this posting has been made.

            ta,
            Mark.
            http://www.ibiblio.org/pub/packages/solaris/sparc/


            cd /var/tmp
            rm -rf postfix-2.9.5
            untgz /usr/local/src/net/postfix-2.9.5.tar.gz
            cd postfix-2.9.5
            /bin/perl -pe "s%/etc/postfix%/usr/local/etc/postfix%"
            -i src/global/mail_params.h
            /bin/perl -pe "s%/usr/libexec/postfix%/usr/local/libexec/postfix%"
            -i src/global/mail_params.h
            /bin/perl -pe "s%/var/lib/postfix%/usr/local/var/postfix%"
            -i src/global/mail_params.h
            /bin/perl -pe "s%/var/spool/postfix%/usr/local/spool/postfix%"
            -i src/global/mail_params.h
            /bin/perl -pe "s%/usr/sbin%/usr/local/sbin%"
            -i src/global/mail_params.h
            /bin/perl -pe "s%/usr/local/man%/usr/local/man%"
            -i src/global/mail_params.h
            /bin/perl -pe "s%/usr/lib/sendmail%/usr/local/sbin/sendmail%"
            -i src/util/sys_defs.h
            /bin/perl -pe "s%/usr/bin/mailq%/usr/local/bin/mailq%"
            -i src/util/sys_defs.h
            /bin/perl -pe "s%/usr/bin/newaliases%/usr/local/bin/newaliases%"
            -i src/util/sys_defs.h
            /bin/perl -pe "s%/usr/sbin%/usr/local/sbin%"
            -i src/util/sys_defs.h
            /bin/perl -pe "s%/usr/libexec/postfix%/usr/local/libexec/postfix%"
            -i src/util/sys_defs.h
            /bin/perl -pe "s%/var/spool/postfix%/usr/local/spool/postfix%"
            -i conf/main.cf
            /bin/perl -pe "s%/var/lib/postfix%/usr/local/var/postfix%"
            -i conf/main.cf
            /bin/perl -pe "s%/usr/libexec/postfix%/usr/local/libexec/postfix%"
            -i conf/main.cf
            /bin/perl -pe "s%:/etc/postfix%:/usr/local/etc/postfix%"
            -i conf/main.cf
            /bin/perl -pe "s%mailq_path =.*%mailq_path =
            /usr/local/bin/mailq%" -i conf/main.cf
            /bin/perl -pe "s%sendmail_path =.*%sendmail_path =
            /usr/local/sbin/sendmail%" -i conf/main.cf
            /bin/perl -pe "s%newaliases_path =.*%newaliases_path =
            /usr/local/sbin/newaliases%" -i conf/main.cf
            /bin/perl -pe "s%manpage_directory =.*%manpage_directory =
            /usr/local/man%" -i conf/main.cf
            /bin/perl -pe "s%command_directory =.*%command_directory =
            /usr/local/sbin%" -i conf/main.cf

            mv /usr/local/include/ndbm.h /usr/local/include/ndbm.h.not
            make \
            CC="${CC}" \
            makefiles
            opensolaris:
            make \
            CC="${CC}" \
            CCARGS=-DNO_NIS \
            makefiles
            make
            /bin/perl -pe "s%/var/spool/postfix%/usr/local/spool/postfix%"
            -i conf/main.cf.default
            /bin/perl -pe "s%/var/lib/postfix%/usr/local/var/postfix%"
            -i conf/main.cf.default
            /bin/perl -pe "s%/usr/libexec/postfix%/usr/local/libexec/postfix%"
            -i conf/main.cf.default
            /bin/perl -pe "s%:/etc/postfix%:/usr/local/etc/postfix%"
            -i conf/main.cf.default
            /bin/perl -pe "s%mailq_path =.*%mailq_path =
            /usr/local/bin/mailq%" -i conf/main.cf.default
            /bin/perl -pe "s%sendmail_path =.*%sendmail_path =
            /usr/local/sbin/sendmail%" -i conf/main.cf.default
            /bin/perl -pe "s%newaliases_path =.*%newaliases_path =
            /usr/local/sbin/newaliases%" -i conf/main.cf.default
            /bin/perl -pe "s%manpage_directory =.*%manpage_directory =
            /usr/local/man%" -i conf/main.cf.default
            /bin/perl -pe "s%command_directory =.*%command_directory =
            /usr/local/sbin%" -i conf/main.cf.default
            /bin/perl -pe 's%chown \$owner %chown \$USER %'
            -i postfix-install
            /bin/perl -pe 's%\"\$mail_owner\"%\"\$USER\"%'
            -i postfix-install
            /bin/perl -pe 's%-c \$CONFIG_DIRECTORY -h%-c conf -h%'
            -i postfix-install
            make install
            mv /usr/local/include/ndbm.h.not /usr/local/include/ndbm.h


            On Mon, Feb 4, 2013 at 8:12 PM, Reindl Harald <h.reindl@...> wrote:
            >
            >
            > Am 04.02.2013 02:05, schrieb Mark Ashley:
            >> I ran across a problem when installing postfix 2.9.5 on Solaris 10 and
            >> 11. If there is a pre-existing main.cf on the system then the "make
            >> install" step will re-use this, instead of using the settings
            >> contained in the new 2.9.5 code tree.
            >>
            >> It makes installing a new version problematic as you don't expect that
            >> sort of behaviour, old configs polluting new code. It's billed as a
            >> "transition aid" but it's annoying when you go out of your way to
            >> configure the postfix source tree to use other settings.
            >
            > sorry but what do you expcet?
            >
            > here are running a lot of postfix installs initially setup with
            > postfix 2.4.x and now running on 2.10dev and a update should
            > never mangle or replace existing configurations especially
            > since postfix is backward compatbile like no other software
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.