Bug 42150

Summary: systemctl stop reports success on nonexistent service
Product: systemd Reporter: random-23526
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: medium    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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.