Bug 536826

Summary: initscript collected problems LSB-compilant dcbd
Product: Red Hat Enterprise Linux 6 Reporter: Jan Ščotka <jscotka>
Component: lldpadAssignee: Jan Zeleny <jzeleny>
Status: CLOSED CURRENTRELEASE QA Contact: Yulia Kopkova <ykopkova>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1CC: dkovalsk, ykopkova
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 21:06:11 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 Jan Ščotka 2009-11-11 14:34:02 UTC
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 14:39:46 UTC
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 Program Management 2009-11-11 14:56:02 UTC
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 10:57:56 UTC
Patch has been uploaded, changing status to MODIFIED

Comment 6 releng-rhel@redhat.com 2009-12-16 21:49:55 UTC
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 09:11:02 UTC
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 09:27:53 UTC
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 21:06:11 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.