Bug 1001607

Summary: RFE: provide better error when attempting to enable/disable generated units
Product: [Fedora] Fedora Reporter: Zdenek Kabelac <zkabelac>
Component: systemdAssignee: systemd-maint
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: johannbg, lnykryn, msekleta, plautrba, systemd-maint, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-230 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-05 20:34:00 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:

Description Zdenek Kabelac 2013-08-27 11:41:35 UTC
Description of problem:

As a systemd user I'm pretty much confused from the functionality of the command: 'systemctl disable'

When I see service 'lvm2-activation.service' and I run 'disable' on this service it's still being loaded and executed upon next restart of the system.

I think it's a bug in systemd - since there is not any distinguish between normal and generator service and I also believe it's a regular user request to disable even generator (knowing it's something special).

If I install lvm2 on a system, which doesn't need LVs for booting and it's using LV only seldomly, there is no reason to have vgchange executed on system startup.

There seem to be a way to disable it via  'systemctl mask'.

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

systemd-206-6.fc21.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:

after  'systemctl disable' and reboot:

lvm2-activation.service - Activation of LVM2 logical volumes
   Loaded: loaded (/etc/lvm/lvm.conf)
   Active: inactive (dead) since Ne 2013-08-25 11:36:14 CEST; 2 days ago
     Docs: man:lvm(8)
           man:vgchange(8)
  Process: 221 ExecStart=/usr/sbin/lvm vgchange -aay --sysinit (code=exited, status=0/SUCCESS)
 Main PID: 221 (code=exited, status=0/SUCCESS)


Expected results:

vgchange is not executed when the service is disabled
or  systemctl reports a user error possibly suggesting to use  'mask' ?

Additional info:

Comment 1 Zbigniew Jędrzejewski-Szmek 2014-06-23 04:56:13 UTC
It doesn't make much sense to enable or disable generated units. But we should provide a better error message. We could load the unit, and if the path matches one of the generator directories, issue a nice hint.

Comment 2 Zbigniew Jędrzejewski-Szmek 2019-08-05 20:34:00 UTC
We now say:
Failed to enable unit: Unit /run/systemd/generator/foo.service is transient or generated.
https://github.com/systemd/systemd/commit/8e20adcaa0