Red Hat Bugzilla – Bug 718793
Provide native systemd unit file
Last modified: 2011-11-08 11:27:17 EST
Description of problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Created attachment 511560 [details]
Native systemd service file postfix
Note that you will need to put the "make_aliasesdb" section in to seperated helper script which you call from the native systemd service file and it's probably best to look at create a seperated postfix-chroot.service ( see http://0pointer.de/blog/projects/changing-roots.html )
*** Bug 714429 has been marked as a duplicate of this bug. ***
Created attachment 512846 [details]
Probably it should look something like this then we call that script from what ever is the final install path for the script in the ExecStartPre=/usr/libexec/aliasesdb allthou I'm not so sure if libexec is the right path to place the script snippets used in unit files
Created attachment 512847 [details]
postfix chroot unit
Created attachment 512852 [details]
Updated postfix unit.
Added the path to point to aliasedb scrip
Added Conflicts=sendmail.service to the unit which will stop sendmail.service before starting postfix.service.
An counterpart should be added to the sendmail.service unit as in Conflicts=postfix.service to take down postfix if started if it was not added already
Created attachment 512853 [details]
Updated postfix-chroot unit
Added Conflicts with sendmail.service
Created attachment 512866 [details]
Adding postfix-chroot and exim.service to conflicts
Created attachment 512867 [details]
Adding postfix.service and exim.service to conflicts
Created attachment 513228 [details]
Spec file patch
I think I have it right..
Jóhann thanks for your help. I will give it some testing.
Created attachment 515287 [details]
Removed 'postfix check', because it is run as part of start command (from the postfix man).
Chroot is handled conditionally in postfix.service, IMHO we do not need the chroot service.
Created attachment 515290 [details]
Spec file patch
Added disable action to preun.
Fixed triggerun to be run for postfix < 2.8.4-2.
alternatives --initscript only commented-out, not removed.
Added aliasesdb to spec file.
With my admin hat on I would personally prefer chroot service be separated
services as in if I would start chroot-$foo.service or $foo-chroot.service
which would be configured for chroot run service from the get go anyway did you test if chrooting works as advertised?
btw I should mentioned that the alternative should be fixed
"* Tue Jul 19 2011 Bill Nottingham <email@example.com> 1.3.54-1 - alternatives: fix --initscript systemd support (#714830) - revert forwarding of 'chkconfig --del' to 'systemctl disable'"