Bug 1378092 - Do not change /etc/motd
Summary: Do not change /etc/motd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-node
Classification: oVirt
Component: General
Version: 4.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.1.0-beta
: 4.1
Assignee: Ryan Barry
QA Contact: Huijuan Zhao
URL:
Whiteboard:
Depends On:
Blocks: 1379143
TreeView+ depends on / blocked
 
Reported: 2016-09-21 13:17 UTC by Jiri Belka
Modified: 2017-02-01 14:34 UTC (History)
2 users (show)

Fixed In Version: ovirt-node-ng-4.1.0-0.20161220.0.el7
Clone Of:
Environment:
Last Closed: 2017-02-01 14:34:44 UTC
oVirt Team: Node
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
fdeutsch: devel_ack+
ycui: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1379143 0 unspecified CLOSED When logging into node "IMGBASE OK" is displayed, but not explained. 2021-02-22 00:41:40 UTC
oVirt gerrit 65213 0 master ABANDONED motd: move updating to profile.d. Use nodectl 2016-12-13 18:36:00 UTC
oVirt gerrit 68388 0 master MERGED nodectl: move updating to profile.d. Use nodectl 2016-12-19 16:20:18 UTC
oVirt gerrit 68564 0 master MERGED motd: remove imgbase-motd.service 2016-12-19 16:52:04 UTC
oVirt gerrit 68830 0 ovirt-4.1-pre MERGED nodectl: move updating to profile.d. Use nodectl 2016-12-20 15:27:04 UTC
oVirt gerrit 68840 0 ovirt-4.1 MERGED motd: remove imgbase-motd.service 2016-12-20 15:31:21 UTC

Internal Links: 1379143

Description Jiri Belka 2016-09-21 13:17:43 UTC
Description of problem:

IIUC /etc/motd is not dynamically changed on EL, thus keep it this way and do not change it.

Bogus action is here:

# cat /usr/lib/systemd/system/imgbase-motd.service
[Unit]
Description=Build motd based on imgbase analysis

[Service]
ExecStart=/usr/sbin/imgbase motd --update
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

/etc/motd is sysadmin ownership, if you want to have any "info" after login, just put something into /etc/profile.d/ as this can be "customized" by sysadmin to disable "your info" if it would be conceived as annoying, as...:

# sed -n '/^for.*profile.d/,/done$/p' /etc/profile
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then 
            . "$i"
        else
            . "$i" >/dev/null
        fi
    fi
done

Thus with this solution a sysadmin could remove read bit and get rid of imgbase info.

(At least Debian offers /etc/motd.tail but IIUC there's nothing on EL.)

Version-Release number of selected component (if applicable):
redhat-virtualization-host-image-update-4.0-20160906.0.el7_2.noarch

How reproducible:
100%

Steps to Reproduce:
1. edit /etc/motd
2. update redhat-virtualization-host-image-update
3. see what is in /etc/motd

Actual results:
redhat-virtualization-host-image-update messes with /etc/motd which is traditionally not dynamically updated on EL and thus "steals" a sysadmin's responsibility of /etc/motd content

Expected results:
/etc/motd should be either empty as it is on EL by default or /etc/motd should always have content edited by responsible admin (ie. never dynamically changed by any rpm)

Additional info:
ngn is here because legacy node was detracting too far from EL standards and user experience, thus conform to this goal, thx.

Comment 1 Fabian Deutsch 2016-09-21 15:28:03 UTC
Putting a script into /etc/profile.d/ sounds like a good improvement!

The sysadmin can get already rid of it by disabling the imgbased-motd.service.

Comment 2 Jiri Belka 2016-09-22 09:35:06 UTC
(In reply to Fabian Deutsch from comment #1)
> Putting a script into /etc/profile.d/ sounds like a good improvement!
> 
> The sysadmin can get already rid of it by disabling the
> imgbased-motd.service.

Just take care this should not slow down every shell opening (if something would go wrong). Thx.

Comment 3 Ryan Barry 2016-10-06 12:34:12 UTC
I'll grab this as part of rhbz#1379154

Comment 4 Huijuan Zhao 2017-01-17 06:05:04 UTC
Test version:
1. Before upgrade:
redhat-virtualization-host-4.1-0.20170112.1
imgbased-0.9.4-0.1.el7ev.noarch
kernel-3.10.0-514.2.2.el7.x86_64
redhat-virtualization-host-image-update-placeholder-4.1-0.5.el7.noarch
2. After upgrade:
redhat-virtualization-host-4.1-0.20170116.0
imgbased-0.9.4-0.1.el7ev.noarch
kernel-3.10.0-514.2.2.el7.x86_64
redhat-virtualization-host-image-update-4.1-20170116.0.el7_3.noarch

Test steps:
1. Install redhat-virtualization-host-4.1-0.20170112.1
2. Reboot and login RHVH, edit /etc/motd
3. Setup local repos and update RHVH to redhat-virtualization-host-4.1-0.20170116.0
   # yum update
4. Reboot and login new RHVH-4.1-0.20170116.0, see what is in /etc/motd

Test results:
After step4, /etc/motd has same content edited in step2

So this bug is fixed in redhat-virtualization-host-4.1-0.20170116.0, change the status to VERIFIED


Note You need to log in before you can comment on or make changes to this bug.