issue/motd
mechanism for Fedora-based distributions and possibly others
sudo su
# curl --remote-name-all https://kojipkgs.fedoraproject.org//work/tasks/3368/30013368/fedora-user-messages-0.1-1.fc28.noarch.rpm https://kojipkgs.fedoraproject.org//work/tasks/3368/30013368/fedora-user-messages-issuegen-0.1-1.fc28.noarch.rpm https://kojipkgs.fedoraproject.org//work/tasks/3368/30013368/fedora-user-messages-motdgen-0.1-1.fc28.noarch.rpm https://kojipkgs.fedoraproject.org//work/tasks/3368/30013368/fedora-user-messages-profile-0.1-1.fc28.noarch.rpm # rpm-ostree install fedora-user-messages-* # systemctl reboot
SSH back in
Configure PAM (version >= 1.3.1) to look in /etc/motd.d
:
Edit /etc/pam.d/sshd
to have line session optional pam_motd.so
(if it does not already have it). It should look like the following:
/etc/pam.d/sshd
#%PAM-1.0 auth substack password-auth auth include postlogin account required pam_sepermit.so account required pam_nologin.so account include password-auth password include password-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session required pam_loginuid.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open env_params session required pam_namespace.so session optional pam_keyinit.so force revoke session optional pam_motd.so session include password-auth session include postlogin
Enable the units and restart.
# systemctl enable motdgen.service motdgen.path issuegen.service issuegen.path # systemctl reboot
problem with motd: appears the symlink created in /etc/motd.d
is not being followed by PAM on startup. Need to check if cockpit did anything to make it work on their end.
Let x
denote {motd,issue}
.
/etc/x.d/fedora-user-messages.x
to /run/fedora-user-messages.x
are set by systemd-tmpfiles
.issuegen
and motdgen
generate /run/fedora-user-messages.x
, from files in /run/fedora-user-messages/x.d
, /lib/usr/coreos/x.d
.issue
s or motd
s by placing files in /etc/x.d/
, which is a feature already provided by Fedora 29./etc/fedora-user-messages/x.d
to have the issuegen/motdgen services append their files to the generated x
./etc/fedora-user-messages/x.d/
%files
as part of the coreos-ux package. The symlinks /etc/motd -> /etc/run
and /etc/issue -> /run/issue
do not get created if they exist./etc/x
symlinks - have a symlink to the generated file in /etc/x.d/fedora-user-messages.x
. Cockpit currently places cockpit.issue
in /etc/issue.d/
(see "Files" in https://rpmfind.net/linux/RPM/fedora/devel/rawhide/x86_64/c/cockpit-ws-178-1.fc30.x86_64.html) This is because /etc/x
is owned by fedora-release, and we should not change this.%post
? WantedBy
a .target
required? Or is this done by preset config? Done by WantedBy user.target (the default target for Fedora).rpm-build.sh
more tmpfiles named pkg-fedora-user-messages-*.conf
are
created, which include lines to create directories in run; /run/fedora-user-messages
, /run/fedora-user-messages/issue.d
, /run/fedora-user-messages/motd.d
. This clutters up tmpfiles.d (given that this package contains 3 tmpfiles already). May want to consider another something like CL's baselayout rather than have several tmpfiles.dnf
and rpm-ostree
when getting data about updates