Bug 42150 - systemctl stop reports success on nonexistent service
Summary: systemctl stop reports success on nonexistent service
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium minor
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-24 01:32 UTC by random-23526
Modified: 2012-07-20 14:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description random-23526 2011-10-24 01:32:18 UTC
If the name part of the service to stop is misspelled, systemctl outputs no error message and exits with code 0, just as everything would be Ok.

bash-4.2# systemctl stop nosuchthing.service
bash-4.2# echo $?
0

Note that other commands like start or status do output an error message and set a non-zero exit code. The stop command also output an error message and set non-zero exit code if the extension part of the service name is misspelled. Would be nice to get the same behavior also when name part of the service name is misspelled.
Comment 1 Lennart Poettering 2012-07-20 14:10:18 UTC
This is fixed in recent systemd versions, please test!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.