Hello community, here is the log from the commit of package postfix for openSUSE:Factory checked in at Mon Jul 19 13:37:14 CEST 2010. -------- --- postfix/postfix.changes 2010-06-10 13:11:13.000000000 +0200 +++ /mounts/work_src_done/STABLE/postfix/postfix.changes 2010-07-06 17:06:58.000000000 +0200 @@ -1,0 +2,14 @@ +Tue Jul 6 15:04:30 UTC 2010 - chris@computersalat.de + +- reworked bnc#606251 stuff (not checked in to Factory) + o used my_print_defaults command for parsing of /etc/my.cnf + o using quotation marks: "$PF_CHROOT" + o added sysconfig option POSTFIX_MYSQL_CONN=(socket,tcp) + +------------------------------------------------------------------- +Wed Jun 16 23:39:09 UTC 2010 - chris@computersalat.de + +- bnc#606251 - postfix chrooted mysql.sock lost on mysql restart + o Now MYSQL_SOCK_DIR is mounted with '-o bind' to postfix CHROOT + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ postfix.spec ++++++ --- /var/tmp/diff_new_pack.smTyvu/_old 2010-07-19 13:35:59.000000000 +0200 +++ /var/tmp/diff_new_pack.smTyvu/_new 2010-07-19 13:35:59.000000000 +0200 @@ -22,7 +22,7 @@ Name: postfix Summary: A fast, secure, and flexible mailer Version: 2.7.1 -Release: 1 +Release: 2 License: IBM Public License .. Group: Productivity/Networking/Email/Servers Url: http://www.postfix.org/ ++++++ postfix-SuSE.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postfix-SuSE/rc.postfix new/postfix-SuSE/rc.postfix --- old/postfix-SuSE/rc.postfix 2010-01-05 23:22:37.000000000 +0100 +++ new/postfix-SuSE/rc.postfix 2010-07-06 17:03:26.000000000 +0200 @@ -11,9 +11,9 @@ ### BEGIN INIT INFO # Provides: smtp sendmail postfix # Required-Start: $network $named $syslog $time $remote_fs -# Should-Start: cyrus ldap ypbind openslp amavisd +# Should-Start: cyrus ldap ypbind openslp amavisd mysql # Required-Stop: $network $named $syslog $time $remote_fs -# Should-Stop: cyrus ldap ypbind openslp amavisd +# Should-Stop: cyrus ldap ypbind openslp amavisd mysql # Default-Start: 3 5 # Default-Stop: # Description: start the Postfix MTA @@ -28,11 +28,20 @@ POSTFIX_BIN=/usr/sbin/postfix POSTCONF=/usr/sbin/postconf OPENSLP_BIN=/usr/bin/slptool +print_defaults=/usr/bin/my_print_defaults test -x $POSTFIX_BIN || exit 5 test -x $MASTER_BIN || exit 5 test -f /etc/sysconfig/postfix && . /etc/sysconfig/postfix +warn_user(){ + tput bold + echo -e "\t*** WARNING ***" + echo -e $1 + echo -e "\t*** WARNING ***" + tput sgr0 +} + cond_slp() { cmd=$1 PIFACES=$($POSTCONF -h inet_interfaces|sed -e 's/\(127.0.0.1\|::1\|[[:space:]]\)//g') @@ -51,6 +60,31 @@ fi } +chk_mysql_sock(){ + PF_CHROOT="/var/spool/postfix" + if [ -n "$($print_defaults mysqld)" ]; then + MYSQL_SOCKET=$($print_defaults mysqld | grep -e '--socket[[:blank:]=]' | awk -F"=" '{print $2}') + MYSQL_SOCKET_DIR=$(dirname $MYSQL_SOCKET) + CHR_MYSQL_SOCKET=${PF_CHROOT}${MYSQL_SOCKET} + CHR_MYSQL_SOCKET_DIR=$(dirname $CHR_MYSQL_SOCKET) + if [ -S $MYSQL_SOCKET ]; then + if [ -d $CHR_MYSQL_SOCKET_DIR ]; then + if grep $CHR_MYSQL_SOCKET_DIR /proc/mounts &> /dev/null; then + RET=0 + else + RET=8 + fi + else + RET=4 + fi + else + RET=2 + fi + else + RET=1 + fi + return $RET +} # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status @@ -84,6 +118,38 @@ case "$1" in start) echo -n "Starting mail service (Postfix)" + if [ "$(echo "$POSTFIX_UPDATE_CHROOT_JAIL" | tr 'A-Z' 'a-z' )" != "no" ]; then + if [ "$(echo "$POSTFIX_MYSQL_CONN" | tr 'A-Z' 'a-z' )" == "socket" -a \ + "$(echo "$POSTFIX_WITH_MYSQL" | tr 'A-Z' 'a-z' )" != "no" ]; then + chk_mysql_sock + case $? in + 1) +warn_user "\t/etc/my.cnf does not exist!!\n\ +\tThis should not happen!\n\ +\tPlease check if postfix-mysql is installed and check for package mysql." + rc_failed 5; rc_status -v; rc_exit; + ;; + 2) +warn_user "\tMySQL not started\n\ +\tPlease check if MySQL is started on boot" + rc_failed 7; rc_status -v; rc_exit; + ;; + 4) +warn_user "\t$CHR_MYSQL_SOCKET_DIR does not exist!!\n\ +\tThis should not happen!\n\ +\tPlease run SuSEconfig." + rc_failed 6; rc_status -v; rc_exit; + ;; + 8) + /bin/mount -o bind $MYSQL_SOCKET_DIR $CHR_MYSQL_SOCKET_DIR &> /dev/null + [ $? -ne 0 ] && { + echo -n " ... can not mount $MYSQL_SOCKET_DIR to $CHR_MYSQL_SOCKET_DIR" + rc_failed 1; rc_status -v; rc_exit; + } + ;; + esac + fi + fi ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postfix-SuSE/SuSEconfig.postfix new/postfix-SuSE/SuSEconfig.postfix --- old/postfix-SuSE/SuSEconfig.postfix 2010-05-20 19:03:54.000000000 +0200 +++ new/postfix-SuSE/SuSEconfig.postfix 2010-07-06 17:01:13.000000000 +0200 @@ -68,40 +68,74 @@ mkchroot(){ - if [ ! -d /var/spool/postfix ]; then - warn_user "\t/var/spool/postfix does not exist!!!\n\ + PF_CHROOT="/var/spool/postfix" + + if [ ! -d "$PF_CHROOT" ]; then + warn_user "\t$PF_CHROOT does not exist!!!\n\ \tThis should not happen!\n\ \tPlease reinstall package postfix or create this directory!" exit 1 fi - cd /var/spool/postfix + cd "$PF_CHROOT" + if [ "$(echo "$POSTFIX_MYSQL_CONN" | tr 'A-Z' 'a-z' )" == "socket" -a \ + "$(echo "$POSTFIX_WITH_MYSQL" | tr 'A-Z' 'a-z' )" != "no" ]; then + if [ -n "$(my_print_defaults mysqld)" ]; then + MYSQL_SOCKET=$(my_print_defaults mysqld | grep -e '--socket[[:blank:]=]' | awk -F"=" '{print $2}') + MYSQL_SOCKET_DIR=$(dirname $MYSQL_SOCKET) + CHR_MYSQL_SOCKET=$(echo $MYSQL_SOCKET | sed -e "s,/,,") + CHR_MYSQL_SOCKET_DIR=$(dirname $CHR_MYSQL_SOCKET) + else + warn_user "\t/etc/my.cnf does not exist!!\n\ +\tThis should not happen!\n\ +\tPlease check if postfix-mysql is installed and check for package mysql." + fi + fi if [ "$(echo "$POSTFIX_CHROOT" | tr 'A-Z' 'a-z' )" != "yes" -a \ "$(echo "$POSTFIX_UPDATE_CHROOT_JAIL" | tr 'A-Z' 'a-z' )" != "no" ]; then if [ -d etc ]; then echo "removing postfix chroot environment..." fi - if grep /var/spool/postfix/proc /proc/mounts &> /dev/null; then - umount /var/spool/postfix/proc + if grep "$PF_CHROOT"/proc /proc/mounts &> /dev/null; then + umount "$PF_CHROOT"/proc + fi + + if [ -n "$CHR_MYSQL_SOCKET_DIR" ]; then + if grep "$PF_CHROOT"/$CHR_MYSQL_SOCKET_DIR /proc/mounts &> /dev/null; then + umount "$PF_CHROOT"/$CHR_MYSQL_SOCKET_DIR + fi fi rm -rvf etc @lib@ usr var proc elif [ "$(echo "$POSTFIX_UPDATE_CHROOT_JAIL" | tr 'A-Z' 'a-z' )" != "no" ]; then echo "checking postfix chroot environment..." - if [ "$(echo "$POSTFIX_WITH_MYSQL" | tr 'A-Z' 'a-z' )" != "no" ]; then - echo "removing mysql.sock" - rm -rvf var/lib/mysql - fi - if [ -e /lib/security/pam_ldap.so ]; then cpifnewer /etc/openldap/ldap.conf etc/openldap fi - mkdir -p /var/spool/postfix/proc - if ! grep /var/spool/postfix/proc /proc/mounts &> /dev/null; then - mount -t proc proc /var/spool/postfix/proc + mkdir -p "$PF_CHROOT"/proc + if ! grep "$PF_CHROOT"/proc /proc/mounts &> /dev/null; then + mount -t proc proc "$PF_CHROOT"/proc + fi + + if [ "$(echo "$POSTFIX_WITH_MYSQL" | tr 'A-Z' 'a-z' )" != "yes" ]; then + if [ -n "$CHR_MYSQL_SOCKET_DIR" ]; then + if grep "$PF_CHROOT"/$CHR_MYSQL_SOCKET_DIR /proc/mounts &> /dev/null; then + umount "$PF_CHROOT"/$CHR_MYSQL_SOCKET_DIR + fi + fi + fi + + if [ "$(echo "$POSTFIX_MYSQL_CONN" | tr 'A-Z' 'a-z' )" == "socket" -a \ + "$(echo "$POSTFIX_WITH_MYSQL" | tr 'A-Z' 'a-z' )" != "no" ]; then + if [ ! -d $CHR_MYSQL_SOCKET_DIR ]; then + mkdir -p $CHR_MYSQL_SOCKET_DIR + fi + if ! grep $CHR_MYSQL_SOCKET_DIR /proc/mounts &> /dev/null; then + mount -o bind $MYSQL_SOCKET_DIR "$PF_CHROOT"/$CHR_MYSQL_SOCKET_DIR + fi fi # smtpd_tls_CApath @@ -182,29 +216,13 @@ cpifnewer /etc/localtime etc fi - chown -R root /var/spool/postfix/{etc,@lib@,usr,var} - - # something for having postfix comunicate with mysql via socket - # when running in chroot jail - if [ "$(echo "$POSTFIX_WITH_MYSQL" | tr 'A-Z' 'a-z' )" != "no" ]; then - HERE="/var/spool/postfix" - MS_DIR="var/lib/mysql" - MYSQL_SOCKET="/var/lib/mysql/mysql.sock" - CHR_MYSQL_SOCKET="var/lib/mysql/mysql.sock" - [ ! -d $MS_DIR ] && { - mkdir -p $MS_DIR - chown mysql: $MS_DIR - } - if [ ! -S $MYSQL_SOCKET ]; then - warn_user "\tMySQL has to be started to have mysql.sock linked\n\ - ++\tinto postfix chroot. Please start mysql and run\n\ - ++\tSuSEconfig again!" - else - [ ! -e $CHR_MYSQL_SOCKET -a ! -S $CHR_MYSQL_SOCKET ] && { - ln $MYSQL_SOCKET $HERE/$CHR_MYSQL_SOCKET - } - fi - fi + # do not chown -R root /var/spool/postfix/var + # this will break ownership for mysql on suse < 1120 + if [ "$(echo "$POSTFIX_WITH_MYSQL" | tr 'A-Z' 'a-z' )" != "no" ]; then + chown -R root "$PF_CHROOT"/{etc,@lib@,usr} + else + chown -R root "$PF_CHROOT"/{etc,@lib@,usr,var} + fi fi } @@ -701,11 +719,11 @@ } else { $line = $1; } - } elsif ( /\#?(relay_domains\s=\s).*/ ) { + } elsif ( /^(relay_domains\s=\s).*/ ) { if ($with_mysql ne "yes") { $line = $1."\$mydestination, hash:/etc/postfix/relay"; } else { - $line = $1."\$mydestination, mysql:/etc/postfix/mysql_relay_domains_maps.cf"; + $line = $1."\$mydestination, hash:/etc/postfix/relay, mysql:/etc/postfix/mysql_relay_domains_maps.cf"; } } else { $line = $_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postfix-SuSE/sysconfig.postfix new/postfix-SuSE/sysconfig.postfix --- old/postfix-SuSE/sysconfig.postfix 2009-12-22 16:10:01.000000000 +0100 +++ new/postfix-SuSE/sysconfig.postfix 2010-07-06 16:57:01.000000000 +0200 @@ -125,11 +125,24 @@ ## Default: no ## Config: postfix # -# Set this to yes, if SuSEconfig should setup 'mysql.sock' inside chroot jail -# Note: You should set this to yes if you did POSTFIX_CHROOT="yes" and +# Set this to yes, if SuSEconfig should activate mysql stuff in main.cf +# and having 'mysql.sock' inside chroot jail +# Note: When POSTFIX_CHROOT="yes" then 'mysql.sock' will be available +# in postfix CHROOT # POSTFIX_WITH_MYSQL="no" +## Type: string(socket,tcp) +## Default: "socket" +## Config: postfix +# +# Set this to "tcp", if your MySQL is not on localhost +# Note: When POSTFIX_CHROOT="yes" then MYSQL_SOCKET will also be available +# in postfix chroot, but you can use "tcp" just as well with MySQL +# on localhost +# +POSTFIX_MYSQL_CONN="socket" + ## Type: yesno ## Default: no ## Config: postfix @@ -178,7 +191,7 @@ # # Example: POSTFIX_RBL_HOSTS="rbl1.example.com, rbl2.example.com" # -#POSTFIX_RBL_HOSTS="zen.spamhaus.org, list.dsbl.org, cbl.abuseat.org, dnsbl.sorbs.net, dnsbl.ahbl.org" +#POSTFIX_RBL_HOSTS="zen.spamhaus.org, cbl.abuseat.org, dnsbl.sorbs.net, dnsbl.ahbl.org" POSTFIX_RBL_HOSTS="" ## Type: yesno ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org