After upgrading to 2.0.8 via pkg upgrade I did all the necesary changes to integrate version 2.x with postfix. changed: sender_canonical_maps -> socketmap:unix:srs:forward and recipient_canonical_maps -> socketmap:unix:srs:reverse and copied the default confing file from /usr/local/share/doc/postsrsd to /usr/local/etc/ When I try to start the service I get: eval: cannot create : No such file or directory postsrsd: WARNING: failed precmd routine for postsrsd To keep my mail server running I had to downgrade to 1.10 and revert main.cf changes.
I've checked rc.d/postsrsd script. I remove (by mistake): : ${postsrsd_secret="/usr/local/etc/postsrsd.secret"} (I've checked it by executing as root: sh -x /usr/local/etc/rc.d/postsrsd onestart ) So you have to define in /etc/rc.conf variable: postsrsd_secret="/usr/local/etc/postsrsd.secret" (or another file - as you have configured now) Yes, I will make simple patch to modify rc script. Greetings,
Created attachment 245015 [details] postsrsd missing files and variables I've made a patch which restores needed startup variable postsrsd_secret. Also this patch "installs" postsrsd.conf.sample (as I was asked). I've tested this patch with poudriere, so logfile is alsa attached
Created attachment 245016 [details] poudriere testport log poudriere testport log
Will commit with slight changes: - INSTALL_DATA instead of CP to install files - PORTVERSION -> DISTVERSION No MFH as 2023Q3 is still on 1.10.
(In reply to Robert Clausecker from comment #4) Thank you for your notes. Do I have to make a new patch?
(In reply to Krzysztof from comment #5) OK, it was stupid question :-))) I did not read carefully.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3e774cb07c9bb3a4fc28ad8d69c009c123fe3714 commit 3e774cb07c9bb3a4fc28ad8d69c009c123fe3714 Author: Krzysztof <ports@bsdserwis.com> AuthorDate: 2023-09-19 17:08:25 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2023-09-22 04:54:46 +0000 mail/postsrsd: add missing files and variables This fixes an issue where postsrsd would fail to start. Reported by: Javier Sturman <sturmanj@gmail.com> PR: 273787 mail/postsrsd/Makefile | 7 ++++++- mail/postsrsd/files/postsrsd.in | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-)
Thank you for your contribution.
I tried using the latest package from today -2023-09-22- 2.0.8,1 and now I'm getting this error: [j@myvps:/var/spool/postfix $]> sudo service postsrsd startStarting postsrsd. postsrsd: error: cannot drop privileges: failed to chdir to chroot: No such file or directory /usr/local/etc/rc.d/postsrsd: WARNING: failed to start postsrsd At first I thought it was an error with the directory I created for the socketmap in /var/spool/postfix/srs manually while testing the original report so I deleted it and forced a pkg install -f postsrd the directory was created with the desired permissions: srw-rw-rw- 1 root wheel 0 Sep 22 15:58 srs
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273787#c9 ?
(In reply to Javier Sturman from comment #10) Did you run: sudo sh -x /usr/local/etc/rc.d/postsrsd onestart It will show full debug and which directory is missing. Maybe it is not problem of startup script but configuration?
(In reply to Krzysztof from comment #11) So I found. Problem is with default configuration settings: # Execute PostSRSd in chroot jail # PostSRSd will jail itself in the given directory, which adds an additional # layer of protection against the exploitation of security bugs in PostSRSd. To # prevent PostSRSd from chrooting, set this to the empty string. # # Example: # chroot-dir = "/usr/local/var/lib/postsrsd" # chroot-dir = "/usr/local/var/lib/postsrsd" I think it is default linux hierarchy :-))) Please close this bug.
So it’s a default configuration issue then ?