Created attachment 237362 [details] Patch submission dynamic_motd is a drop-in replacement for generating messages of the day on FreeBSD 13.0 or later. During system startup, the file /var/run/motd is replaced with a fifo whose content is generated by a user-configurable shell script that is executed on each login. All other aspects of motd(5) are preserved. WWW: https://github.com/sstallion/dynamic_motd
Created attachment 239405 [details] Patch #2 Updated patch posted.
Ping!
The reason your patch wasn't looked at is that it doesn't have the "maintainer-approved" flag set. I'll set this flag for you, which may speed up the process.
This fails to build under poudriere: ``` =>> Recording filesystem state for prestage... done =======================<phase: stage >============================ ===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=nobody UID=65534 GID=65534 ===> Staging for dynamic_motd-1.2 ===> Generating temporary packing list installing DIRS CONFETCDIR install -d -m 0755 -o root -g wheel /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc install: chown 0:0 /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc: Operation not permitted installing DIRS CONFRCDDIR install -d -m 0755 -o root -g wheel /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc/rc.d install: chown 0:0 /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc/rc.d: Operation not permitted installing DIRS DOCSDIR install -d -m 0755 -o root -g wheel /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/doc/dynamic_motd install: chown 0:0 /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/doc/dynamic_motd: Operation not permitted installing DIRS EXAMPLESDIR install -d -m 0755 -o root -g wheel /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/examples/dynamic_motd install: chown 0:0 /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/examples/dynamic_motd: Operation not permitted installing DIRS SCRIPTSDIR install -d -m 0755 -o root -g wheel /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec install: chown 0:0 /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec: Operation not permitted install -o root -g wheel -m 555 dynamic_motd /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec/dynamic_motd install: /wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec/dynamic_motd: chown/chgrp: Operation not permitted *** Error code 71 Stop. make[1]: stopped in /wrkdirs/usr/ports/sysutils/dynamic_motd/work/dynamic_motd-1.2 *** Error code 1 Stop. make: stopped in /usr/ports/sysutils/dynamic_motd ``` You're requiring root-level access to install the files into staging. That is a definite no-no -- package building must be possible as a non-root user. Instead of including bsd.prog.mk in the Makefile in your github sources, you'ld be better off just writing an explicit install target which takes account of the ${STAGEDIR} setting from the ports infrastructure. Just install the files into staging using the current user's UID and GID.
(In reply to Matthew Seaman from comment #4) You need to reference ${DESTDIR} which the ports infra will set as part of the do-install target. Prepend that to all the locations you want to install files.
(In reply to Matthew Seaman from comment #5) See: https://github.com/sstallion/dynamic_motd/pull/2
Thanks all! I really appreciate the PR - it looks like it is failing CI due to a missing dependency in the Makefile. I'll take a look this afternoon, but this looks much better than what I had before. For what it's worth, I'm more than happy to maintain this port.
(In reply to Matthew Seaman from comment #4) That's what USES=uidfix is for.
Created attachment 241547 [details] Patch #3 Updated patch attached based on Matthew's changes
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b5613f6f4f42d9fe4b28704055698b9038b93e81 commit b5613f6f4f42d9fe4b28704055698b9038b93e81 Author: Matthew Seaman <matthew@FreeBSD.org> AuthorDate: 2023-04-18 06:36:55 +0000 Commit: Matthew Seaman <matthew@FreeBSD.org> CommitDate: 2023-04-18 06:38:58 +0000 sysutils/dynamic_motd: -- new port dynamic_motd is a drop-in replacement for generating messages of the day on FreeBSD 13.0 or later. During system startup, the file /var/run/motd is replaced with a fifo whose content is generated by a user-configurable shell script that is executed on each login. All other aspects of motd(5) are preserved. PR: 267107 Reported by: Steven Stallion sysutils/Makefile | 1 + sysutils/dynamic_motd/Makefile (new) | 19 +++++++++++++++++++ sysutils/dynamic_motd/distinfo (new) | 3 +++ sysutils/dynamic_motd/pkg-descr (new) | 5 +++++ sysutils/dynamic_motd/pkg-message (new) | 23 +++++++++++++++++++++++ sysutils/dynamic_motd/pkg-plist (new) | 7 +++++++ 6 files changed, 58 insertions(+)
Committed, thanks! Although I can't see why you've limited this to just FreeBSD 13 or above? There's nothing in the port I can see which means it wouldn't work on FreeBSD 12.
(In reply to Matthew Seaman from comment #11) Thanks Matthew! With respect to requiring 13.0, this was due to /etc/motd moving to /var/run/motd in that release. This could certainly be adapted to use /etc/motd, but given some reactions folks had to /etc/motd changing to begin with, I didn't want to muddy the waters.