Bug 884438 - MSG: Non-actionable error message: The unit files have no [Install] section. They are not meant to be enabled using systemctl.
Summary: MSG: Non-actionable error message: The unit files have no [Install] section. ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 18
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: 2012-12-06 09:07 UTC by Richard W.M. Jones
Modified: 2013-01-20 03:32 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-20 03:32:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2012-12-06 09:07:23 UTC
Description of problem:

# systemctl enable rc-local.service
The unit files have no [Install] section. They are not meant to be enabled using systemctl.

This error message is meaningless, and should be changed
to indicate what the user should (or in this case, should not)
do.  Something like:

  "You do not need to enable this service.  It will
  run automatically when the files or conditions needed
  for it to run are present."

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

systemd-195-8.fc18.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See above.

Additional info:

Other examples of people not understanding this error:
https://bugzilla.redhat.com/show_bug.cgi?id=840116
https://bugzilla.redhat.com/show_bug.cgi?id=848491

Comment 1 Michal Schmidt 2012-12-06 13:24:40 UTC
And the current message is already an improvement over the original one. Remember bug 817033?

It's not easy for systemctl in this case to give a suggestion that's both concise and accurate.

Considering the bugs that you referenced:
 bug 840116 - This was an actual bug. The [Install] section was meant to be present in the unit file.
 bug 817033 - Here the unit wasn't meant to be controlled manually, because it was a subsidiary unit to be pulled in via a "Requires=..." dependency from a main unit.

Other possible reasons for a missing [Install] section:
 - The unit may be pulled in via a symlink from another unit's *.{requires,wants}/ directory.
 - The unit may count on being started as needed via some kind of activation (socket, DBus, SYSTEMD_WANTS from udev, or explicit "systemctl start ..." scripted somewhere).

Ideally systemctl would be able to distinguish some of these cases automatically. Currently it operates quite simply without needing to know about the dependency graph. This would have to change.

Comment 2 Richard W.M. Jones 2012-12-06 13:51:20 UTC
(In reply to comment #1)
> And the current message is already an improvement over the original one.
> Remember bug 817033?

Right, I vaguely remembered hitting this before.  But the error
message is obviously still not right since 3 people have
filed bugs explicitly saying they don't know what it means :-(

> It's not easy for systemctl in this case to give a suggestion that's both
> concise and accurate.

Could it give one which is not concise, yet accurate?  In libguestfs
we print out multi-line error messages if something needs to be
explained in detail.  I also analyze web server log files and Google
results to find errors that people frequently encounter, then I beef
up those error messages with plenty more information.

> Considering the bugs that you referenced:
>  bug 840116 - This was an actual bug. The [Install] section was meant to be
> present in the unit file.
>  bug 817033 - Here the unit wasn't meant to be controlled manually, because
> it was a subsidiary unit to be pulled in via a "Requires=..." dependency
> from a main unit.
> 
> Other possible reasons for a missing [Install] section:
>  - The unit may be pulled in via a symlink from another unit's
> *.{requires,wants}/ directory.
>  - The unit may count on being started as needed via some kind of activation
> (socket, DBus, SYSTEMD_WANTS from udev, or explicit "systemctl start ..."
> scripted somewhere).
> 
> Ideally systemctl would be able to distinguish some of these cases
> automatically. Currently it operates quite simply without needing to know
> about the dependency graph. This would have to change.

I think as a first step it should explain these possible reasons,
or it could even return a URL pointing to your comment here.

Comment 3 Michal Schmidt 2012-12-06 15:42:52 UTC
Made it more verbose in upstream:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=4b9d3dc9748ec3f52a71b06f851f4398462a1c60

Comment 4 Richard W.M. Jones 2012-12-06 15:45:17 UTC
Thanks, a great improvement.

Comment 5 Fedora Update System 2013-01-14 14:09:15 UTC
systemd-197-1.fc18.1 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2013-0655/systemd-197-1.fc18.1

Comment 6 Fedora Update System 2013-01-20 03:32:47 UTC
systemd-197-1.fc18.1 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


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