Bug 856975 - Obscure systemctl error: failed to issue method call: Invalid argument
Summary: Obscure systemctl error: failed to issue method call: Invalid argument
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Václav Pavlín
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-13 09:22 UTC by Richard W.M. Jones
Modified: 2012-10-12 16:47 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-10-07 22:42:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Appends .service when enable/disable... called (2.20 KB, patch)
2012-09-13 14:07 UTC, Václav Pavlín
no flags Details | Diff
Appends .service when enable/disable... called (1.88 KB, patch)
2012-09-13 17:46 UTC, Václav Pavlín
no flags Details | Diff
Appends .service when enable/disable... called (2.30 KB, patch)
2012-09-13 20:03 UTC, Václav Pavlín
no flags Details | Diff

Description Richard W.M. Jones 2012-09-13 09:22:15 UTC
Description of problem:

If you try to enable/disable a service, but you forget to
put ".service" at the end, you get a very obscure error
which doesn't explain what's going on at all:

$ sudo systemctl disable libvirtd
Failed to issue method call: Invalid argument

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

systemd-188-3.fc18.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See command above.

Expected results:

It should explain that the service "libvirtd" is not known.
For extra points it could suggest adding .service to the end
of the name (or .socket etc).

Comment 1 Václav Pavlín 2012-09-13 14:07:03 UTC
Created attachment 612463 [details]
Appends .service when enable/disable... called

Same thing works for start/stop/... - if you call 'start libvirtd', systemctl will append .service to it. This patch provides the same behaviour for enable/disable/...

Comment 2 Richard W.M. Jones 2012-09-13 14:12:56 UTC
One hunk in that patch adds a blank line, with no
functional change.

The approach seems OK - making it work more like
start/stop.

Comment 3 Václav Pavlín 2012-09-13 17:46:19 UTC
Created attachment 612531 [details]
Appends .service when enable/disable... called

Sorry, I missed that hunk completely. Should by ok now

Comment 4 Lennart Poettering 2012-09-13 18:42:59 UTC
I'd prefer if we'd move that loop into its own function. Also, use strv_free() to free the array afterwards. And you need to check for OOM (this is run from PID 1!). Otherwise looks good.

Comment 5 Václav Pavlín 2012-09-13 20:03:26 UTC
Created attachment 612613 [details]
Appends .service when enable/disable... called

Lennart, thanks for your comment. Changed with respect to it.

Comment 6 Lennart Poettering 2012-09-13 20:42:46 UTC
Applied with minor coding style fixes.

Comment 7 Fedora Update System 2012-09-20 19:54:09 UTC
systemd-190-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/systemd-190-1.fc18

Comment 8 Fedora Update System 2012-09-22 06:35:21 UTC
Package systemd-191-2.fc18, rtkit-0.11-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-191-2.fc18 rtkit-0.11-3.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/rtkit-0.11-3.fc18,systemd-191-2.fc18
then log in and leave karma (feedback).

Comment 9 Steve Grubb 2012-09-24 15:33:18 UTC
This didn't fix the problem, I see this:
#systemctl disable atd.service
Failed to issue method call: Argument 0 is specified to be of type "string", but is really type "array".

Comment 10 Lennart Poettering 2012-09-24 23:42:08 UTC
Steve, that's an unrelated bug, in the SELinux code:

https://bugzilla.redhat.com/show_bug.cgi?id=859614

Comment 11 Fedora Update System 2012-09-28 00:15:47 UTC
Package glibc-2.16-17.fc18, systemd-192-1.fc18, selinux-policy-3.11.1-23.fc18, rtkit-0.11-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.16-17.fc18 systemd-192-1.fc18 selinux-policy-3.11.1-23.fc18 rtkit-0.11-3.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/selinux-policy-3.11.1-23.fc18,rtkit-0.11-3.fc18,systemd-192-1.fc18,glibc-2.16-17.fc18
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2012-10-01 20:07:17 UTC
Package glibc-2.16-17.fc18, rtkit-0.11-3.fc18, systemd-193-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.16-17.fc18 rtkit-0.11-3.fc18 systemd-193-1.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/rtkit-0.11-3.fc18,systemd-193-1.fc18,glibc-2.16-17.fc18
then log in and leave karma (feedback).

Comment 13 Judy Wathen 2012-10-03 18:23:16 UTC
It looks like the same error message is issued for "sytemctl is-enabled foo" (as opposed to "systemctl is-enabled foo.service".
In additon the error message occors for many instances of 
"chroot /chroot_mnt systemctl enable foo"
"chroot /chroot_mnt systemctl disble foo", etc.

I have a fix for these cases.  Can I submit it to this bugzilla, or do I need to raise a new one?
Thanks,
Judy

Comment 14 Lennart Poettering 2012-10-07 22:42:18 UTC
Judy, please file a new bug for this!

Comment 15 Fedora Update System 2012-10-12 16:47:05 UTC
systemd-44-20.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/systemd-44-20.fc17


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