Bug 812799

Summary: systemd kill and isactive commands
Product: [Fedora] Fedora Reporter: Martin Cermak <mcermak>
Component: arptables_jfAssignee: Jiri Popelka <jpopelka>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: jpopelka
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-17 15:30:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 816135    

Description Martin Cermak 2012-04-16 09:27:42 UTC
Description of problem:

After killing the service with "systemctl kill arptables_jf.service" the service is still active according to "systemctl status arptables_jf.service" and "systemctl is-active arptables_jf.service".

I think the kill command should either stop the service or report some non zero exitcode to indicate unsuccessful kill.

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

# rpm -q arptables_jf systemd
arptables_jf-0.0.8-24.fc17.x86_64
systemd-44-4.fc17.x86_64

How reproducible:

always


Steps to Reproduce:
1. systemctl start arptables_jf.service
2. systemctl kill arptables_jf.service
3. systemctl status arptables_jf.service
4. systemctl is-active arptables_jf.service
  
Actual results:

Kill exits with zero exitcode, but does nothing. After that status says the serice is active, but is-active says it is inactive.


Expected results:

1) both
     systemctl status arptables_jf.service
   and 
     systemctl is-active arptables_jf.service
   should report the same

2) kill should either 
     kill or stop the service and return zero exitcode
   or
     fail and return non-zero exitcode.

Comment 1 Jiri Popelka 2012-05-17 15:30:34 UTC
arptables_jf in rawhide now (bug #754423) provides native systemd unit file so I'll comment how that works.

(In reply to comment #0)
> Expected results:
> 1) both
>      systemctl status arptables_jf.service
>    and 
>      systemctl is-active arptables_jf.service
>    should report the same

This seems to be fixed with the rawhide version, i.e both command show that the service is active.
arptables.service contains RemainAfterExit=yes which means that the 
service shall be considered active even when all its processes exited.

> 2) kill should either 
>      kill or stop the service and return zero exitcode
>    or
>      fail and return non-zero exitcode.

According to systemctl(1) 'kill' sends a signal to one or more processes of the unit. But in case of "one-shot" service like arptables there's no process to send signal to. I'd say that returning zero exit-code is ok in this case, but that's question for systemd guys.

Anyway, I'm closing this BZ because (1) seems to be fixed in rawhide and (2) is ok in my opinion.