The patch to config.h of logrotate specifies "/usr/bin/mailx -s" as the mail command, but since logrotate does an exec of that it fails. The code actually adds -s to the argument list, so the correct definition is: #define DEFAULT_MAIL_COMMAND "/usr/bin/mailx" I've included an updated patch-config.h file for the port. How-To-Repeat: Try to enable the "mail" option to logrotate. Fix: diff --git a/config.h b/config.h index ae7f308..7c0a2b3 100644 --- a/config.h +++ b/config.h @@ -16,6 +16,13 @@ #define STATEFILE "/var/log/logrotate.status" #endif +#ifdef __FreeBSD__ + #define DEFAULT_MAIL_COMMAND "/usr/bin/mailx" + #define COMPRESS_COMMAND "/usr/bin/gzip" + #define UNCOMPRESS_COMMAND "/usr/bin/gunzip" + #define STATEFILE "/var/run/logrotate.status" +#endif + /* * Default settings for Linux - leave these last. */
Created attachment 151390 [details] fix and update
A commit references this bug: Author: pi Date: Tue Jan 6 10:25:14 UTC 2015 New revision: 376419 URL: https://svnweb.freebsd.org/changeset/ports/376419 Log: sysutils/logrotate: 3.8.7 -> 3.8.8, fix mail sending - Add support for building using autotools/automake. Using "./autogen.sh", "./configure" and "make" is now preferred way how to build logrotate. Old Makefile remains available, but it is deprecated and will be removed in the future. Please report any problem related to new build system. - Add support for systems which do not support fork (use vfork instead) and madvise. - Fix bug when wrong log file has been removed in case of dateext and dateformat %d-%m-%Y. - Do not expect that the name of root account is 'root'. - Do not stop rotation with an error when olddir and log file are on different devices and copy or copytruncate is used. - Return an error code when parent directory of log does not exist, "su" directive is not used, logrotate is running as root and missingok is not specified. [vcizek] - Prepend error printed by compression program with the log name even when the compression program exits with zero exit code. PR: 195184 Submitted by: rand@meridian-enviro.com Approved by: maintainer (timeout) Changes: head/sysutils/logrotate/Makefile head/sysutils/logrotate/distinfo head/sysutils/logrotate/files/patch-config.h
Committed, thanks.