Bug 600430

Summary: Correct avahi-daemon and avahi-dnsconfd use of PIDFILE
Product: [Fedora] Fedora Reporter: James Laska <jlaska>
Component: avahiAssignee: Lennart Poettering <lpoetter>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: jturner, lpoetter, msusta, ykopkova
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-25 01:27:17 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:
Attachments:
Description Flags
/etc/init.d/avahi-daemon.patch
none
/etc/init.d/avahi-dnsconfd.patch
none
/etc/init.d/avahi-daemon.patch none

Description James Laska 2010-06-04 17:11:18 UTC
Created attachment 421300 [details]
/etc/init.d/avahi-daemon.patch

Description of problem:

According to the Fedora SysVinitscript documentation [1], avahi-daemon and avahi-dnsconfd do not return the expected exit codes for certain operations. 

I have attached a patches that correct the behavior by making use of the built-in killproc and daemon functions.

[1] https://fedoraproject.org/wiki/PackagingSysVInitScript#Exit_Codes_for_the_Status_Action

Version-Release number of selected component (if applicable):
 * avahi-0.6.25-6.fc13.x86_64

How reproducible:
 * 100%

Steps to Reproduce:
1. Run the AutoQA beakerlib-based avahi initscript test (see instructions at
https://fedorahosted.org/autoqa/wiki/initscripts)

Actual Results (same for avahi-daemon and avahi-dnsconfd):

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - start
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] ::  Service must start without problem
:: [   PASS   ] ::  Then Status command 
:: [   FAIL   ] ::  Already started service  (Expected 0, got 255)
:: [   PASS   ] ::  Again status command 
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 3 good, 1 bad
:: [   FAIL   ] :: RESULT: avahi-daemon - start

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - stop
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] ::  Stopping service 
:: [   FAIL   ] ::  Status of stopped service  (Expected 3, got 1)
:: [   FAIL   ] ::  Stopping service again  (Expected 0, got 255)
:: [   FAIL   ] ::  Status of stopped service  (Expected 3, got 1)
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 1 good, 3 bad
:: [   FAIL   ] :: RESULT: avahi-daemon - stop

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - pid
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'touch /var/run/avahi-daemon/pid'
:: [   FAIL   ] ::  Existing pid file, but service not started  (Expected 1, got 0)
:: [   PASS   ] :: Remove .pid file
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 2 good, 1 bad
:: [   FAIL   ] :: RESULT: avahi-daemon - pid

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - lock
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'touch /var/lock/subsys/avahi-daemon'
:: [   FAIL   ] ::  Existing lock file, but service not started  (Expected 2, got 1)
:: [   PASS   ] :: Remove lock file
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 2 good, 1 bad
:: [   FAIL   ] :: RESULT: avahi-daemon - lock


Expected Results:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - start
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] ::  Service must start without problem
:: [   PASS   ] ::  Then Status command 
:: [   PASS   ] ::  Already started service 
:: [   PASS   ] ::  Again status command 
:: [   LOG    ] :: Duration: 2s
:: [   LOG    ] :: Assertions: 4 good, 0 bad
:: [   PASS   ] :: RESULT: avahi-daemon - start

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - stop
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] ::  Stopping service 
:: [   PASS   ] ::  Status of stopped service 
:: [   PASS   ] ::  Stopping service again 
:: [   PASS   ] ::  Status of stopped service 
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 4 good, 0 bad
:: [   PASS   ] :: RESULT: avahi-daemon - stop

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - pid
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'touch /var/run/avahi-daemon/pid'
:: [   PASS   ] ::  Existing pid file, but service not started 
:: [   PASS   ] :: Remove .pid file
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 3 good, 0 bad
:: [   PASS   ] :: RESULT: avahi-daemon - pid

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: avahi-daemon - lock
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'touch /var/lock/subsys/avahi-daemon'
:: [   PASS   ] ::  Existing lock file, but service not started 
:: [   PASS   ] :: Remove lock file
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 3 good, 0 bad
:: [   PASS   ] :: RESULT: avahi-daemon - lock

Comment 1 James Laska 2010-06-04 17:11:36 UTC
Created attachment 421301 [details]
/etc/init.d/avahi-dnsconfd.patch

Comment 2 James Laska 2010-06-09 11:36:50 UTC
Created attachment 422508 [details]
/etc/init.d/avahi-daemon.patch

Oops, I attached reversed patches.  Reattaching correct patches.

Comment 3 Lennart Poettering 2010-06-25 01:27:17 UTC
Merged upstream now. Will soon upload a new version to rawhide.

Comment 4 Lennart Poettering 2010-06-25 01:42:55 UTC
*** Bug 527674 has been marked as a duplicate of this bug. ***

Comment 5 Lennart Poettering 2010-06-25 01:45:03 UTC
*** Bug 522078 has been marked as a duplicate of this bug. ***