Bug 1001607 - RFE: provide better error when attempting to enable/disable generated units
Summary: RFE: provide better error when attempting to enable/disable generated units
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-27 11:41 UTC by Zdenek Kabelac
Modified: 2019-08-05 20:34 UTC (History)
7 users (show)

Fixed In Version: systemd-230
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-05 20:34:00 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1184960 0 unspecified CLOSED "systemctl enable messagebus.service" fails 2021-02-22 00:41:40 UTC

Internal Links: 1184960

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


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