Bug 280019

Summary: mail/postfix: post-install script not found when installed with 'pkg -r <rootdir>'
Product: Ports & Packages Reporter: Siva Mahadevan <me>
Component: Individual Port(s)Assignee: Juraj Lutter <otis>
Status: In Progress ---    
Severity: Affects Only Me CC: me
Priority: --- Flags: bugzilla: maintainer-feedback? (otis)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
[PATCH] mail/postfix: fix pkg -r installation none

Description Siva Mahadevan 2024-06-27 16:39:54 UTC
When installing postfix with 'pkg -r <rootdir> install', at the extraction phase, I get the following error:

[1/1] Extracting postfix-3.9.0_1,1: 100%
/bin/sh: cannot open /usr/local/libexec/postfix/post-install: No such file or directory

Presumably, this is because files/pkg-install.in takes the DAEMONDIR from SUB_LIST and isn't dynamic to the chroot installation DESTDIR.

This is a problem because the post-install script fixes permissions, so without this, the RC script fails to run because the /var/spool/postfix directory is installed with the wrong permissions.
Comment 1 Juraj Lutter freebsd_committer freebsd_triage 2024-06-27 18:05:15 UTC
Thanks for the report. I will need to test this scenario and come up with a fix.
Comment 2 Siva Mahadevan 2024-06-27 19:08:21 UTC
(In reply to Juraj Lutter from comment #1)

A very quick way to reproduce this is:

1) bsdinstall jail testjail
2) pkg -r $PWD/testjail install postfix

Observe the above error message and the permissions of the /var/spool/postfix folder inside the jail directory
Comment 3 Siva Mahadevan 2024-06-28 21:37:11 UTC
Created attachment 251751 [details]
[PATCH] mail/postfix: fix pkg -r installation

This fixes the issue and other related dormant issues/style fixups. This patch follows the upstream post-install guidelines found here https://www.postfix.org/PACKAGE_README.html (see section "Installing a pre-built Postfix package").
Comment 4 Siva Mahadevan 2024-11-18 16:43:19 UTC
Any updates on reviewing my patch?