Bug 594767 - init script LSB is not compliant
init script LSB is not compliant
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openswan (Show other bugs)
6.0
All Linux
high Severity medium
: rc
: ---
Assigned To: Avesh Agarwal
Aleš Mareček
:
Depends On:
Blocks: 633349
  Show dependency treegraph
 
Reported: 2010-05-21 10:35 EDT by Aleš Mareček
Modified: 2010-11-11 09:52 EST (History)
3 users (show)

See Also:
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 09:52:09 EST
Type: ---
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 Aleš Mareček 2010-05-21 10:35:22 EDT
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 14:08:23 EDT
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 14:20:37 EDT
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 03:35:12 EDT
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 10:29:27 EDT
(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 09:52:09 EST
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.

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