Bug 327651

Summary: improve daemon startup speed
Product: [Fedora] Fedora Reporter: Curtis Doty <curtis>
Component: postfixAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 10CC: triage
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: 2.5.6-1.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-25 16:28:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Curtis Doty 2007-10-11 13:32:58 UTC
This idea improves the system bootup speed slightly; but it does appear
significant. In short, don't rebuild aliases unless needed.

--- /etc/init.d/postfix.orig    2007-08-13 10:05:54.000000000 -0700
+++ /etc/init.d/postfix 2007-10-08 20:40:43.000000000 -0700
@@ -35,7 +35,7 @@
 start() {
        # Start daemons.
        echo -n $"Starting postfix: "
-        /usr/bin/newaliases >/dev/null 2>&1
+       test /etc/aliases.db -nt /etc/aliases || /usr/bin/newaliases >/dev/null 2>&1
        /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure $"$prog
start"
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix

Comment 1 Thomas Woerner 2007-11-06 17:00:31 UTC
The problem with this is that newaliases processes all file(s) specified with
alias_database in main.cf. Therefore checking for /etc/aliases is not sufficient.

Closing as CANTFIX.

Comment 2 Curtis Doty 2007-11-06 17:36:45 UTC
Re-opening for one final gasp with a slightly more complex idea...

I often keep some Makefiles in /etc/postfix that intelligently postconf and then
postmap only when needed. This logic could be easily extended to the initscript
for speedier bootup.

At the cost of slight complexity and a dependency on make.

Any one else agree this is worthwhile?

Comment 3 Thomas Woerner 2007-11-28 16:31:15 UTC
How many makefiles are you using for this?

Comment 4 Curtis Doty 2007-11-28 19:48:09 UTC
Actually, my extra makefiles are for local policy postmaps and other ancillary
stuff. So for only the newaliases logic, we'd need this one minimalist
/etc/postfix/GNUmakefile:

.SUFFIXES:
.PHONY: all
alias_database := $(shell postconf -h alias_database)
adbs := $(patsubst hash:%,%.db, $(alias_database:,=))
all: $(adbs)
$(adbs): %.db: %
	postalias $<

Of course this can be expanded upon too.

Comment 5 Bug Zapper 2008-04-04 14:03:30 UTC
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
rawhide.
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 6 Bug Zapper 2008-11-26 07:57:23 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Curtis Doty 2008-12-07 19:48:16 UTC
Still able to save small but significant bootup time using above /etc/postfix/GNUmakefile and this simple example patch to initscript.

--- /etc/init.d/postfix.orig        2008-09-17 05:25:03.000000000 -0700
+++ /etc/init.d/postfix     2008-12-07 11:20:33.000000000 -0800
@@ -49,7 +49,10 @@
        conf_check
        # Start daemons.
        echo -n $"Starting postfix: "
-        /usr/bin/newaliases >/dev/null 2>&1
+       if [ -r /etc/postfix/GNUmakefile -a -x /usr/bin/make ]
+       then    /usr/bin/make -s -C /etc/postfix 2>/dev/null
+       else    /usr/bin/newaliases >/dev/null 2>&1
+       fi
        /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure $"$prog start"
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix

Comment 8 Miroslav Lichvar 2008-12-12 15:00:20 UTC
Dependency on make can be avoided by using test -nt or similar commands instead of a makefile.

But the file won't be rebuilt when alternatives' mta is switched to postfix from another mta. Any suggestions how to avoid that?

Comment 9 Fedora Update System 2009-01-24 02:35:46 UTC
postfix-2.5.6-1.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update postfix'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-0892

Comment 10 Fedora Update System 2009-01-24 02:40:47 UTC
postfix-2.5.6-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update postfix'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2009-0926

Comment 11 Fedora Update System 2009-02-25 16:27:44 UTC
postfix-2.5.6-1.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2009-02-25 16:28:24 UTC
postfix-2.5.6-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.