Bug 536826 - initscript collected problems LSB-compilant dcbd
initscript collected problems LSB-compilant dcbd
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lldpad (Show other bugs)
6.1
All Linux
high Severity medium
: rc
: ---
Assigned To: Jan Zeleny
Yulia Kopkova
:
Depends On:
Blocks: 633349
  Show dependency treegraph
 
Reported: 2009-11-11 09:34 EST by Jan Ščotka
Modified: 2010-11-10 16:06 EST (History)
2 users (show)

See Also:
Fixed In Version: lldpad-0.9.38-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 16:06:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jan Ščotka 2009-11-11 09:34:02 EST
I found 2 problems, with LSB compilant of initscript of arpwatch.
It should be based on 
https://fedoraproject.org/wiki/Packaging/SysVInitScript definition
test srcipt is situated on wiki pages:
https://wiki.test.redhat.com/BaseOs/Projects/InitScripts#testscript

see failing message in LOG:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test                                                         
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   LOG    ] :: >>>>>>>>> service start
:: [   PASS   ] ::  Service must start without problem
:: [   PASS   ] ::  Then Status command               
:: [   PASS   ] ::  Already started service           
:: [   PASS   ] ::  Again status command              
:: [   LOG    ] :: >>>>>>>>> service restart          
:: [   PASS   ] ::  Restarting of service             
:: [   PASS   ] ::  Status command                    
:: [   LOG    ] :: >>>>>>>>> service stop             
:: [   PASS   ] ::  Stopping service                  
:: [   PASS   ] ::  Status of stopped service         
:: [   PASS   ] ::  Stopping service again            
:: [   PASS   ] ::  Status of stopped service         
:: [   LOG    ] :: >>>>>>>>> pid file                 
:: [   PASS   ] :: File /var/run/dcbd.pid should exist
:: [   PASS   ] :: Running 'echo 666666 > /var/run/dcbd.pid'
:: [   PASS   ] ::  Existing pid file, but service not started 
:: [   LOG    ] :: >>>>>>>>> lock file                         
:: [   PASS   ] :: File /var/lock/subsys/dcbd should exist     
:: [   PASS   ] :: Running 'touch /var/lock/subsys/dcbd'       
:: [   FAIL   ] ::  Existing lock file, but service not started  (Expected 2, got 3)
:: [   LOG    ] :: >>>>>>>>> insufficient rights                                    
:: [   PASS   ] ::  Starting service for restarting under nonpriv user              
:: [   FAIL   ] :: Insufficient rights, restarting resrvice under nonprivileged user must fail (Expected 4, got 143)                                                                                
:: [   LOG    ] :: >>>>>>>>> operations
:: [   PASS   ] ::  Service have to implement start function
:: [   PASS   ] ::  Service have to implement restart function
:: [   PASS   ] ::  Service have to implement status function
:: [   FAIL   ] ::  Service have to implement usage function  (Expected 0,3,2, got 1)
:: [   PASS   ] ::  Service have to implement condrestart function
:: [   PASS   ] ::  Service have to implement try-restart function
:: [   PASS   ] ::  Service have to implement reload function
:: [   PASS   ] ::  Service have to implement force-reload function
:: [   LOG    ] :: >>>>>>>>> nonexist operations
:: [   FAIL   ] ::  Testing proper return code when nonexisting function (Expected 2, got 1)
:: [   LOG    ] :: >>>>>>>>> invalid arguments
:: [   FAIL   ] ::  When no arguments added to service, it must fail with proper return code  (Expected 2, got 1)
:: [   LOG    ] :: Duration: 50s
:: [   LOG    ] :: Assertions: 23 good, 5 bad

There are two bugs:
1. Existing lock file, but service not started  (Expected 2, got 3)
2. Insufficient rights, restarting resrvice under nonprivileged user must fail (Expected 4, got 143)
3. Service have to implement usage function  (Expected 0,3,2, got 1) [should be impelented or returned 2, or 3 value]
Comment 1 Jan Ščotka 2009-11-11 09:39:46 EST
And also I forgot to comment next two states, in case that is used nonexisting function or without parameter, it should return code 2
Comment 3 RHEL Product and Program Management 2009-11-11 09:56:02 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 4 Jan Zeleny 2009-11-13 05:57:56 EST
Patch has been uploaded, changing status to MODIFIED
Comment 6 releng-rhel@redhat.com 2009-12-16 16:49:55 EST
Fixed in 'dcbd-0.9.15-6'. 'dcbd-0.9.19-2.el6' included in compose 'RHEL6.0-20091216.nightly'.
Moving to ON_QA.
Comment 16 Yulia Kopkova 2010-06-25 05:11:02 EDT
Tested with lldpad-0.9.32-2.el6

Status action should return code "2" if program is dead and /var/lock lock file exists [1]

# service lldpad start ;echo $?
0tarting lldpad: [  OK  ]
# kill -9 `pidof lldpad`
# service lldpad status ;echo $?
Checking for service lldpad: lldpad dead but pid file exists
1FAILED]
# rm -f /var/run/lldpad.pid 
# service lldpad status ;echo $?
Checking for service lldpad: lldpad dead but subsys locked
0  OK  ]

now: 0
expected: 2

---
[1] https://fedoraproject.org/wiki/Packaging/SysVInitScript#Exit_Codes_for_the_Status_Action
Comment 17 Jan Zeleny 2010-06-25 05:27:53 EDT
Please retest with latest lldpad (0.9.38), which I've built recently. Its behavior has been checked by jscotka.
Comment 21 releng-rhel@redhat.com 2010-11-10 16:06:11 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.