Bug 523227 - initscript collected problems LSB-compilant
Summary: initscript collected problems LSB-compilant
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cyrus-imapd
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: InitScriptsProject
TreeView+ depends on / blocked
 
Reported: 2009-09-14 14:24 UTC by Jan Ščotka
Modified: 2009-09-18 15:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-18 15:58:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jan Ščotka 2009-09-14 14:24:14 UTC
Description of problem:
there are few problems with initscript of service:
based on document:
https://fedoraproject.org/wiki/Packaging/SysVInitScript

* /var/run/cyrus-imapd.pid doesn't exist

* bad return code of status command, when service is killed and lock file still exist
# service amd status; echo $?
now: 1
expected: 2

* there arent implemented LSB compilant functions which are requred:
 try-restart
 usage
 force-reload

* nonexist function should have returncode 3:
# service $SERVICE noexistop; echo $?
now: 1
expected: 3

* bad argunments should have returncode 2:
# service $SERVICE; echo $?
now: 1
expected: 2

* insufficient rights, there should be returncode 4
# su testuserqa -c "service $SERVICE restart"; echo $?
now: 1 
expected: 4

Comment 1 Jan Ščotka 2009-09-15 14:42:39 UTC
added new version od output: 
:: [   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
:: [   FAIL   ] :: File /var/run/cyrus-imapd.pid should exist 
:: [   PASS   ] :: Running 'echo 666666 > /var/run/cyrus-imapd.pid'
:: [   FAIL   ] ::  Existing pid file, but service not started  (Expected 1, got 3)
:: [   LOG    ] :: >>>>>>>>> lock file
:: [   PASS   ] :: File /var/lock/subsys/cyrus-imapd should exist
:: [   PASS   ] :: Running 'touch /var/lock/subsys/cyrus-imapd'
:: [   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 1)
:: [   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, got 1)
:: [   PASS   ] ::  Service have to implement condrestart function 
:: [   FAIL   ] ::  Service have to implement try-restart function  (Expected 0, got 1)
:: [   PASS   ] ::  Service have to implement reload function 
:: [   FAIL   ] ::  Service have to implement force-reload function  (Expected 0, got 1)
:: [   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)

Comment 2 Michal Hlavinka 2009-09-18 15:58:38 UTC
(In reply to comment #1)
> :: [   FAIL   ] :: File /var/run/cyrus-imapd.pid should exist 

cyrus-imapd uses /var/run/cyrus-master.pid

it contains pid of cyrus-master binary

this file is referenced from documentation and even cyrus-imapd sources

-> I'm not going to change this.

> :: [   PASS   ] :: Running 'echo 666666 > /var/run/cyrus-imapd.pid'
> :: [   FAIL   ] ::  Existing pid file, but service not started  (Expected 1,
> got 3)

your test used wrong pid file, if you use correct file
/var/run/cyrus-master.pid , it will return 1 as expected

-> this works

> :: [   FAIL   ] ::  Existing lock file, but service not started  (Expected 2,
> got 3)

-> fixed

> :: [   FAIL   ] :: Insufficient rights, restarting resrvice under nonprivileged
> user must fail (Expected 4, got 1)

-> fixed

> :: [   FAIL   ] ::  Service have to implement try-restart function  (Expected
> 0, got 1)

-> fixed

> :: [   FAIL   ] ::  Service have to implement force-reload function  (Expected
> 0, got 1)

-> fixed

> :: [   FAIL   ] ::  Testing proper return code when nonexisting function
> (Expected 2, got 1)

-> fixed

> :: [   FAIL   ] ::  When no arguments added to service, it must fail with
> proper return code  (Expected 2, got 1)  

-> fixed


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