Bug 812815 - kill command reports success even if it killed nothing
kill command reports success even if it killed nothing
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
rawhide
Unspecified Linux
medium Severity medium
: ---
: ---
Assigned To: Jan Synacek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-16 06:15 EDT by Martin Cermak
Modified: 2015-09-21 09:19 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-21 09:19:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Cermak 2012-04-16 06:15:39 EDT
Description of problem:

  In some cases, the systemd kill command returns zero exitcode although
  it has no real effect. This happens usually with services that are not
  typical daemons. Example services: ebtables, iptables, arptables_jf.

  In fact there is nothing to kill in these cases. But I think the kill command
  should either stop given service and return zero exitcode in case of success, 
  or should do nothing and return some non-zero exitcode. 

  It would be also nice if the kill command provided at least some feedback
  about what it did.

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

  systemd-44-4.fc17.x86_64
Comment 1 Michal Schmidt 2012-04-16 07:16:47 EDT
Hm, yes, it seems reasonable to report "No process found" or similar when there's nothing to kill.
Comment 2 Martin Cermak 2013-08-02 08:55:27 EDT
Reproduced with systemd-204-8.fc19.x86_64. Moving to Rawhide.
Comment 3 Jan Synacek 2015-05-12 08:50:02 EDT
What exactly is your reproducer?
Comment 4 Martin Cermak 2015-05-13 08:10:22 EDT
(In reply to Jan Synacek from comment #3)
> What exactly is your reproducer?

Example:

fc20 x86_64 # systemctl status ebtables.service
ebtables.service - Ethernet Bridge Filtering tables
   Loaded: loaded (/usr/lib/systemd/system/ebtables.service; disabled)
   Active: inactive (dead)

May 13 14:07:45 dhcp-24-165.brq.redhat.com systemd[1]: Stopped Ethernet Bridge Filtering tables.
fc20 x86_64 # systemctl kill ebtables.service
fc20 x86_64 # # here I'd expect message like "nothing was killed in fact, dude".
Comment 5 Jan Kurik 2015-07-15 11:10:02 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
Comment 6 Jan Synacek 2015-09-21 09:19:28 EDT
Implemented in https://github.com/systemd/systemd/pull/1311.

It is now possible to use 'systemctl --fail kill ...' to get an error when there was nothing to kill.

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