Bug 1806156
| Summary: | [Insights/Client(RHEL8) Motd message handling needs improvement. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Amar Huchchanavar <ahuchcha> |
| Component: | insights-client | Assignee: | Link Dupont <link> |
| Status: | CLOSED ERRATA | QA Contact: | Pavol Kotvan <pakotvan> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.2 | CC: | achadha, andy.speagle, dajohnso, davdunc, fstavela, jerome.meyer, joerg.kastning, kdixon, klape, link, lphiri, mpitt, mvanderw, peter.vreman, rkarimpa, sbrown, shivagup, stefw |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.3 | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-01-08 19:50:38 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | 3.1.1 |
| Embargoed: | |||
Really, the logic of determining when to create or remove the /etc/motd.d/insights-client file belongs in the client, not in the spec file. There is definitely room to improve this. Bug fixes for We have identified a solution to this bug and will be releasing a fix for it in the next client RPM release. That's good news. Looking forward to testing it soon. Good morning. When we first set up our RHEL8 server, the 'motd' was saying that our server needed to be registered with insights even though it already was. Red Hat Support recommended editing /etc/insights-client/insights-client.motd to remove the message, which I did. This morning I performed a large update with yum. This included an update to insights-client which apparently overwrote the motd file with: == This system is not registered to Red Hat Insights. See https://cloud.redhat.com/ To register this system, run: insights-client --register == I ran the registration command which just told me that the server was already registered. The .motd file was not updated to reflect this, so now I must edit the .motd file again. == ~ $ sudo insights-client --register This host has already been registered. Automatic scheduling for Insights has been enabled. Starting to collect Insights data for... Uploading Insights data. Successfully uploaded report from... == Hi Steve, Removing or editing the contents of /etc/insights-client/insights-client.motd is not going to be a permanent solution for you. That file is tracked as part of the RPM, so when you ran your update, the file was rewritten by the RPM upgrade process. The right way to remove the message from appearing as part of the login motd is to remove the symlink file /etc/motd.d/insights-client (if you look at the file that symlink points to, it should be /etc/insights-client/insights-client.motd). The update you installed should include a fix for this bug, assuming you leave the contents of /etc/insights-client/insights-client.motd unmodified. The pam_motd module reads files from /etc/motd.d, so removing the symlink should effectively mute the motd message from appearing. Thanks for the feedback! Let me know if removing the symlink works for you. We removed the /etc/motd.d/insights-client already when the system was built but every time there's a new update to insights-client, it always puts the symlink back, putting the messages back in our MOTD. We don't use insights-client and don't want it showing this message in the MOTD, as we have our own MOTD we use with information for our users. Why does the symlink always come back? Any way to not use insights-client and not have this symlink keep getting re-created? This is a serious annoyance and really bad for RH to try to force this on us. (In reply to Link Dupont from comment #7) > Hi Steve, > > Removing or editing the contents of > /etc/insights-client/insights-client.motd is not going to be a permanent > solution for you. That file is tracked as part of the RPM, so when you ran > your update, the file was rewritten by the RPM upgrade process. The right > way to remove the message from appearing as part of the login motd is to > remove the symlink file /etc/motd.d/insights-client (if you look at the file > that symlink points to, it should be > /etc/insights-client/insights-client.motd). The update you installed should > include a fix for this bug, assuming you leave the contents of > /etc/insights-client/insights-client.motd unmodified. The pam_motd module > reads files from /etc/motd.d, so removing the symlink should effectively > mute the motd message from appearing. > > Thanks for the feedback! Let me know if removing the symlink works for you. Good morning, Link. I've had a three-day weekend since I last logged in to our RHEL8 server. This morning, although I haven't done anything, the insights-client no longer appears when I log in. The symlink, dated 11/6/2020 -- a day that I did not work -- now points to 'dev/null'. Perhaps some cron job running at around 1 AM took care of it? Anyway, thank you for your help. Steve (In reply to Matt from comment #8) > We removed the /etc/motd.d/insights-client already when the system was built > but every time there's a new update to insights-client, it always puts the > symlink back, putting the messages back in our MOTD. We don't use > insights-client and don't want it showing this message in the MOTD, as we > have our own MOTD we use with information for our users. Why does the > symlink always come back? Any way to not use insights-client and not have > this symlink keep getting re-created? This is a serious annoyance and really > bad for RH to try to force this on us. Rather than removing the symlink, point it to /dev/null. That will mute the message and prevent the symlink from being recreated upon RPM update. *** Bug 1898775 has been marked as a duplicate of this bug. *** This was resolved in RHEL 8.3 on Dec 15, 2020 in the 3.1.1 Insights-client RPM. I have the same issue with /etc/motd.d/cockpit. It said I needed to run systemctl enable --now cockpit.socket, even though it's already been enabled. Running Red Hat Enterprise Linux release 8.3 (Ootpa) @(In reply to Steve Brown from comment #13) > I have the same issue with /etc/motd.d/cockpit. It said I needed to run > systemctl enable --now cockpit.socket, even though it's already been enabled. > > Running Red Hat Enterprise Linux release 8.3 (Ootpa) While insights-client and cockpit both make use of the PAM motd.d module, this bug fixed an error in the way insights-client was managing its entry in /etc/motd.d. If you're seeing a problem with cockpit, you should file a bug against cockpit. They have different logic for controlling the entry in /etc/mot.d, so any code that fixed it for insights-client won't fix it for cockpit. OK, Link -- I will file a separate bug against cockpit, per your suggestion. |
Description of problem: insights-client pkg re-installation does not consider the real status of the client. A reproducer can be: - Install insights client - Run insights client - Remove /var/lib/insights/newest* - Remove /etc/motd.d/insights-client - Re-install insights-client rpm (to force the execution of the rpm %post) Now the file /etc/motd.d/insights-client shall not be created again What for me is still unclear is who and when the /etc/motd.d/insights-client is going to be removed if the insights-client is being running/registered again. Is the insights-client egg doing that removal? if the egg is removing files in /etc/... outside of /etc/insights-client is a violation of the trust of insights-client that it should not modify the system (and motd is part of the system) except for its own state files. Version-Release number of selected component (if applicable): # insights-client --version Client: 3.0.8-2 Core: 3.0.121-1 How reproducible: Always Actual results: pkg re-installation does not verify the system registration. Additional info: Customer Comments: Chanign to Insighst client as i found the handling to be included in the insights-client rpm And that is relying on the downloda of newest.egg which is not a mandatory file for insights-client to work From the .spec ------ #Link motd into place. Only do so if motd file doesn't exist and insights hasn't been used if [ ! -e /etc/motd.d/insights-client -a ! -L /etc/motd.d/insights-client ]; then mkdir -p /etc/motd.d if [ -e /var/lib/insights/newest.egg ]; then ln -sn /dev/null /etc/motd.d/insights-client else ln -sn /etc/insights-client/insights-client.motd /etc/motd.d/insights-client fi fi --------- My insights-client has auto_update disabled and is puppet managed and installs only the last_stable.egg. I am really surprised that there is re-invent-of-the-wheel to look for newest.egg and that not the real status file like /etc/insights-client/.registered is not used.