Bug 1133929 - [etc cleanup] move motd to /usr
Summary: [etc cleanup] move motd to /usr
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Ludwig Nussel
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 1165830
  Show dependency treegraph
 
Reported: 2019-05-02 09:33 UTC by Ludwig Nussel
Modified: 2023-07-04 07:13 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludwig Nussel 2019-05-02 09:33:09 UTC
login has built in defaults for finding motd in /etc/motd and /usr/share/misc/motd so remove the explicit setting from /etc/login.defs and move the file to /usr
Comment 1 Ludwig Nussel 2019-05-02 09:38:18 UTC
login from util-linux has that fallback. login from shadow doesn't and pam_motd neither. Both are not used by default in our distro so doesn't matter.
Comment 2 Ludwig Nussel 2019-05-02 09:39:50 UTC
pam_motd has even more options:
/etc/motd
/run/motd
/usr/lib/motd
/etc/motd.d/
/run/motd.d/
/usr/lib/motd.d/
Comment 3 Michael Vetter 2019-05-02 10:06:54 UTC
Regarding SR#700054:
Are you aware of the current discussion and changes at https://bugzilla.suse.com/show_bug.cgi?id=1121197 ?
I think they plan to update shadow-login_defs.patch soon too.
Comment 4 Ludwig Nussel 2019-05-02 11:18:21 UTC
no. I ran into motd coincidentally
Comment 5 Thorsten Kukuk 2019-05-06 11:49:29 UTC
I like this, as it fits perfectly well with 
https://github.com/thkukuk/atomic-updates_and_etc/blob/master/README.md

It should be no problem to enhance pam_motd to use /usr/share/misc/motd, too, and we should do that: else ssh e.g. could not display the file.
Comment 6 Stanislav Brabec 2019-07-20 00:32:03 UTC
I am now working on an update that involves login.defs change. Do you want to backport this change to SLE15 *, SLE12 *?
Comment 10 Ludwig Nussel 2021-03-01 09:33:17 UTC
/usr/lib/modprobe.d/
Comment 11 Felix Miata 2021-07-21 07:25:57 UTC
openSUSE-release is currently (20210718) removing /etc/motd created by sysadmin, not nice, even though saved as motd.rpmsave.
Comment 12 Thorsten Kukuk 2021-07-21 07:44:03 UTC
(In reply to Felix Miata from comment #11)
> openSUSE-release is currently (20210718) removing /etc/motd created by
> sysadmin, not nice, even though saved as motd.rpmsave.

This is how RPM works, and this is why you have to check after every update for *.rpmsave and *.rpmnew files and merge your changes and the distribution changes manually. With the default RPM behavior, there is no way to avoid that.
So with every change to the motd file you had to merge your changes again.

To avoid this and make the update in the future easier, we split the distribution changes from the admin made changes. So last time for you to check for this files and merge manually.
Comment 13 Stanislav Brabec 2021-07-26 13:09:36 UTC
Thorsten Kukuk: Yes, it is how rpm works.

But if /etc/motd.rpmsave is created by rpm, then the motd was modified by sysadmin. (Otherwise it would be silently deleted.)

As in this particular case, there is nothing to merge manually, and "Have a lot of fun..." did not change for a long time, I propose to add to the release spec file:

%posttrans
# /etc/motd was modified by sysadmin. Keep it as it is.
if test -f /etc/motd.rpmsave ; then
	mv /etc/motd.rpmsave /etc/motd
fi