Bug 600430 - Correct avahi-daemon and avahi-dnsconfd use of PIDFILE
Summary: Correct avahi-daemon and avahi-dnsconfd use of PIDFILE
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: avahi
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 522078 527674 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-04 17:11 UTC by James Laska
Modified: 2013-09-02 06:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-25 01:27:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
/etc/init.d/avahi-daemon.patch (1.79 KB, patch)
2010-06-04 17:11 UTC, James Laska
no flags Details | Diff
/etc/init.d/avahi-dnsconfd.patch (1.91 KB, patch)
2010-06-04 17:11 UTC, James Laska
no flags Details | Diff
/etc/init.d/avahi-daemon.patch (1.79 KB, patch)
2010-06-09 11:36 UTC, James Laska
no flags Details | Diff

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. ***


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