Bug 594767

Summary: init script LSB is not compliant
Product: Red Hat Enterprise Linux 6 Reporter: Aleš Mareček <amarecek>
Component: openswanAssignee: Avesh Agarwal <avagarwa>
Status: CLOSED CURRENTRELEASE QA Contact: Aleš Mareček <amarecek>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: dkovalsk, jrieden, sgrubb
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openswan-2_6_24-4_el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-11 14:52:09 UTC Type: ---
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: 633349    

Description Aleš Mareček 2010-05-21 14:35:22 UTC
Description of problem:
According to https://fedoraproject.org/wiki/Packaging/SysVInitScript is init script of openswan not compliant. After killing started daemon status returns 2. Value: 1 is expected.

:: [   PASS   ] :: Running 'service ipsec start'
:: [   PASS   ] :: Running 'kill -n 9 8508'
:: [   FAIL   ] :: Running 'service ipsec status' (Expected 1, got 2)
:: [   LOG    ] :: Duration: 1s


Version-Release number of selected component (if applicable):
openswan-2.6.24-3.el6

How reproducible:
always

Steps to Reproduce:
1. service ipsec start
2. killall pluto
3. service ipsec status; echo $?
  
Actual results:
Exit code of status is 2

Expected results:
Exit code of status should be 1

Additional info:

Comment 1 Avesh Agarwal 2010-06-07 18:08:23 UTC
According to https://fedoraproject.org/wiki/Packaging/SysVInitScript, some of the "status" outputs are:


0:	program is running or service is OK
1:	program is dead and /var/run pid file exists
2:	program is dead and /var/lock lock file exists
3:	program is not running

That means if "program is dead and /var/lock lock file exists", status should be "2" . That is what I get when we do "killall pluto", and "service ipsec status; echo $?", so wondering what is wrong?

Comment 2 Avesh Agarwal 2010-06-07 18:20:37 UTC
Specifically, here is the output I get, If I give following commands:

1. service ipsec start
2. killall pluto
3. service ipsec status; echo $?


Output is:

IPsec stopped
but...
has subsystem lock (/var/lock/subsys/ipsec)!
2

Comment 3 Aleš Mareček 2010-06-08 07:35:12 UTC
Sure, but as we are going to clean all init scripts, we should have them all with same behaviour.
When you kill pluto pidfile and lockfile exist. Now you have two choices to return (after status): 1 and 2 because both files exist. Correct behaviour is: at first you should check if pidfile exists, then lockfile.
From point of functionality view are both values correct but from point of correct initscript view thats a bug.

Comment 4 Avesh Agarwal 2010-06-08 14:29:27 UTC
(In reply to comment #3)
> Sure, but as we are going to clean all init scripts, we should have them all
> with same behaviour.
> When you kill pluto pidfile and lockfile exist. Now you have two choices to
> return (after status): 1 and 2 because both files exist. 

Exactly, I had the same doubt in mind.

Correct behaviour is:
> at first you should check if pidfile exists, then lockfile.
> From point of functionality view are both values correct but from point of
> correct initscript view thats a bug.

If that is the right thing to be LSB compliant, I will fix it in next release.

Thanks
Avesh

Comment 6 releng-rhel@redhat.com 2010-11-11 14:52:09 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.