Bug 1478335 - rhel-dmesg service always enabled even after systemctl disable rhel-dmesg.service
rhel-dmesg service always enabled even after systemctl disable rhel-dmesg.ser...
Status: CLOSED DUPLICATE of bug 1395391
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: initscripts (Show other bugs)
7.4
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: David Kaspar [Dee'Kej]
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-04 06:54 EDT by masanari iida
Modified: 2017-08-23 11:10 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-23 11:10:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description masanari iida 2017-08-04 06:54:39 EDT
Description of problem:
rhel-dmesg service always enabled even after systemctl disable 
rhel-dmesg.service

[root@kc0005 basic.target.wants]# systemctl status rhel-dmesg.service
* rhel-dmesg.service - Dump dmesg to /var/log/dmesg
   Loaded: loaded (/usr/lib/systemd/system/rhel-dmesg.service; disabled; vendor preset: disabled) <== disabled status
   Active: active (exited) since Thu 2017-08-03 10:33:01 JST; 1 day 9h ago
  Process: 1034 ExecStart=/usr/lib/systemd/rhel-dmesg (code=exited, status=0/SUCCESS)
 Main PID: 1034 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/rhel-dmesg.service

Version-Release number of selected component (if applicable):
initscripts-9.49.37-1.el7_3.1.x86_64

How reproducible:
Always

Steps to Reproduce:
1. systemctl disable rhel-dmesg.service 
2. Reboot the system

Actual results:
rhel-dmesg.service always started. And generate dmesg log under /var/log.

Expected result.
One can enable/disable rhel-dmesg.service using systemctl.

Additional info:
My understanding is that this symptom happen because
the initscripts RPM install symlink when the RPM install files.
But it is not the way how to "enable" the unit by default with systemd.

man systemd.preset

DESCRIPTION
       Preset files may be used to encode policy which units shall be enabled
       by default and which ones shall be disabled. 

I think the initscript packager should make use of this method.

Workaround:
Remove symlink under /usr/lib/systemd/system/basic.target.wants
And systemctl enable rhel-dmesg, then the system writes dmesg in /var/log.
And systemctl disable rhel-dmesg, then the system stop output dmesg in /var/log.

Background:
One customer asked HPE that why rhel-dmesg output the logs even it
has "disabled" status.
The I troubleshoot and found the reason.

I know that current method (provide the symlink by initscript RPM) 
does the job.
But I think it doesn't follow the rule under systemd.
That's why the customer could not stop the service.

Severity: low
Comment 2 David Kaspar [Dee'Kej] 2017-08-23 11:10:16 EDT
Hello Masanari,

I'm closing this as a duplicate. If needed, please follow up in the former BZ.

Best regards,

David

*** This bug has been marked as a duplicate of bug 1395391 ***

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