Bug 832742

Summary: missing /etc/postfix/chroot-update
Product: [Fedora] Fedora Reporter: Julian C. Dunn <jdunn>
Component: postfixAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 17CC: fedora, jskarvad, mlichvar, mstevens, nicolas.mailhot, nphilipp, redhat_bugzilla, samuel-rhbugs, thomas, vg.aetera
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-17 23:03:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Julian C. Dunn 2012-06-17 02:47:15 UTC
Description of problem:

systemd script for postfix references /etc/postfix/chroot-update but this is not shipped with Postfix.


Version-Release number of selected component (if applicable):

postfix-2.9.2-2.fc17.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Install postfix and start it
2. Examine /usr/lib/systemd/system/postfix.service, it contains a line like

ExecStartPre=-/etc/postfix/chroot-update

but no such file exists.
  
Actual results:

Jun 16 22:28:20 demeter systemd[5568]: Failed at step EXEC spawning /etc/postfix/chroot-update: No such file or directory

Expected results:

No such errors.

Additional info:

Comment 1 Morten Stevens 2012-07-16 11:12:50 UTC
Removing ExecStartPre=-/etc/postfix/chroot-update from systemd unit file should fix it.

/usr/lib/systemd/system/postfix.service

[Unit]
Description=Postfix Mail Transport Agent
After=syslog.target network.target
Conflicts=sendmail.service exim.service

[Service]
Type=forking
PIDFile=/var/spool/postfix/pid/master.pid
EnvironmentFile=-/etc/sysconfig/network
ExecStartPre=-/usr/libexec/postfix/aliasesdb
ExecStart=/usr/sbin/postfix start
ExecReload=/usr/sbin/postfix reload
ExecStop=/usr/sbin/postfix stop

[Install]
WantedBy=multi-user.target

Comment 2 Nils Philippsen 2012-08-27 16:04:27 UTC
Hi Jaroslav. Can you explain this line? No package seems to provide this script(?), so what's the point of referencing it and let these warnings clutter up the logs?

Comment 3 Jaroslav Škarvada 2012-08-28 08:15:02 UTC
(In reply to comment #2)
> Hi Jaroslav. Can you explain this line? No package seems to provide this
> script(?), so what's the point of referencing it and let these warnings
> clutter up the logs?

Hi, this is result of sysvinit -> systemd conversion. There is an option for user to use its own script for chroot preset, example is provided in /usr/share/doc/postfix*/examples/chroot-setup, thus the '-' in systemd unit file, because this script is loaded optionally. Systemd emmits warning if this file is not present (I am not sure if it behaved this way in the past). I agree it is annoying. As a workaround we could provide empty file with comment of purpose of this file and the warning should gone.

Comment 4 Nils Philippsen 2012-09-03 14:19:22 UTC
Hm, not sure what the best course of action is -- is this file only meant to be run once? Then it could simply be made an empty (comment-only), executable file and people could fill it, then restart the service to apply the changes. No need to mark it %config then, as its contents don't need to be preserved (should be mentioned in the comments then).

Comment 5 Jaroslav Škarvada 2012-09-06 10:25:50 UTC
I am going to use the following approach:

ExecStartPre=-/usr/libexec/postfix/chroot-update

$ cat /usr/libexec/postfix/chroot-update
#!/bin/bash

[ -x /etc/postfix/chroot-update ] && /etc/postfix/chroot-update

Comment 6 Fedora Update System 2012-09-06 13:46:19 UTC
postfix-2.9.4-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/postfix-2.9.4-3.fc18

Comment 7 Fedora Update System 2012-09-07 19:37:24 UTC
Package postfix-2.9.4-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing postfix-2.9.4-3.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-13552/postfix-2.9.4-3.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-09-17 23:03:45 UTC
postfix-2.9.4-3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Vladislav Grigoryev 2012-11-22 09:54:50 UTC
> # rpm -q postfix
> postfix-2.9.4-3.fc17.x86_64
> 
> # ls /etc/postfix/chroot-update
> ls: cannot access /etc/postfix/chroot-update: No such file or directory
> 
> # /usr/libexec/postfix/chroot-update ; echo $?
> 1

Is this OK to exit with status 1?
As a result ExecStartPre reports FAILURE.

> # systemctl status postfix.service 
> ...
> Process: 17728 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=1/FAILURE)

Comment 10 Jaroslav Škarvada 2012-11-22 11:25:01 UTC
(In reply to comment #9)
> > # rpm -q postfix
> > postfix-2.9.4-3.fc17.x86_64
> > 
> > # ls /etc/postfix/chroot-update
> > ls: cannot access /etc/postfix/chroot-update: No such file or directory
> > 
> > # /usr/libexec/postfix/chroot-update ; echo $?
> > 1
> 
> Is this OK to exit with status 1?
> As a result ExecStartPre reports FAILURE.
> 
> > # systemctl status postfix.service 
> > ...
> > Process: 17728 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=1/FAILURE)

AFAIK the original problem was that the failure pollutes system log. Now it should be only reported by sytemctl status. The failure is only there if user doesn't have setup for chroot.