Bug 280019 - mail/postfix: post-install script not found when installed with 'pkg -r <rootdir>'
Summary: mail/postfix: post-install script not found when installed with 'pkg -r <root...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Juraj Lutter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-27 16:39 UTC by Siva Mahadevan
Modified: 2024-11-18 16:43 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (otis)


Attachments
[PATCH] mail/postfix: fix pkg -r installation (7.19 KB, patch)
2024-06-28 21:37 UTC, Siva Mahadevan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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?