Bug 1395391

Summary: rhel-dmesg.service listed as disabled but still runs
Product: Red Hat Enterprise Linux 7 Reporter: Stuart Auchterlonie <sauchter>
Component: initscriptsAssignee: David Kaspar // Dee'Kej <deekej>
Status: CLOSED ERRATA QA Contact: Daniel Rusek <drusek>
Severity: medium Docs Contact: Petr Bokoc <pbokoc>
Priority: high    
Version: 7.2CC: deekej, drusek, masanari.iida, sauchter
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: initscripts-9.49.40-2.el7 Doc Type: Bug Fix
Doc Text:
The `rhel-dmesg` service can now be disabled correctly Previously, even if the `rhel-dmesg.service` was explicitly disabled using "systemd", it continued to run anyway. This bug has been fixed, and the service can now be disabled correctly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:24:45 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:
Embargoed:
Bug Depends On: 1493545    
Bug Blocks: 1357648, 1400961, 1420851, 1465901, 1466365, 1472751, 1473733    

Description Stuart Auchterlonie 2016-11-15 21:42:52 UTC
Description of problem:

The rhel-dmesg.service does not appear to be properly setup as a
systemd service. As you can see from the below output, it is marked
as disabled, and vendor preset: disable, yet the service has quite
clearly still run.

# systemctl status rhel-dmesg
● rhel-dmesg.service - Dump dmesg to /var/log/dmesg
   Loaded: loaded (/usr/lib/systemd/system/rhel-dmesg.service; disabled; vendor preset: disabled)
   Active: active (exited) since Wed 2016-10-26 10:38:06 BST; 2 weeks 6 days ago
 Main PID: 785 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/rhel-dmesg.service

The rhel-dmesg.service should be properly setup within systemd such that
it is actually enabled when it is desired to be run, and can be disabled
if that behaviour is desired.

Version-Release number of selected component (if applicable):

initscripts-9.49.30-1.el7_2.3.x86_64 (also RHEL-7.3)

How reproducible:

100%

Steps to Reproduce:
1. Boot System
2. Run `systemctl status rhel-dmesg`
3.

Actual results:

Observe that despite being disabled, the service has run

Expected results:

Service should be enabled if it's expected to run, and not
run if it is disabled.

Additional info:

Comment 1 Stuart Auchterlonie 2016-11-15 21:44:41 UTC
 === In Red Hat Customer Portal Case 01728677 ===
--- Comment by Auchterlonie, Stuart on 15/11/2016 21:44 ---

Customer noted the following:

----
If I delete the symlink I mentioned it doesn't run at startup:

 /usr/lib/systemd/system/basic.target.wants/rhel-dmesg.service -> ../rhel-dmesg.service

It seems there are various services that are "hard coded" by these  symlinks in  /usr/lib/systemd/system/*.target.wants/ that run on startup without them being enabled by an equivalent symlink in /etc/systemd/system/*.target.wants/  ... which functionally makes sense as that's the same model as unit files, but doesn't make much sense to me in terms of systemctl reporting the services as disabled even when they are effectively enabled?
----

Comment 7 David Kaspar // Dee'Kej 2017-08-23 15:07:46 UTC
Making this BZ report public, so people outside Red Hat can see it as well.

Comment 8 David Kaspar // Dee'Kej 2017-08-23 15:10:16 UTC
*** Bug 1478335 has been marked as a duplicate of this bug. ***

Comment 10 David Kaspar // Dee'Kej 2017-09-20 13:26:56 UTC
Pull-request submitted for review:
https://github.com/fedora-sysv/initscripts/pull/128

Before merging these changes, the blocking BZ #1493545 needs to be resolved.

Comment 16 errata-xmlrpc 2018-04-10 18:24:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0983