Bug 157173 - audio/musicpd: wait --kill to finish (FreeBSD-only)
Summary: audio/musicpd: wait --kill to finish (FreeBSD-only)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-19 09:10 UTC by lichray
Modified: 2011-06-17 15:10 UTC (History)
0 users

See Also:


Attachments
musicpd_2-pwait.patch (1.71 KB, patch)
2011-05-19 09:10 UTC, lichray
no flags Details | Diff
patch.txt (1.08 KB, text/plain; charset=US-ASCII)
2011-05-21 08:43 UTC, Chris Rees
no flags Details
patch.txt (1.55 KB, text/plain; charset=US-ASCII)
2011-05-21 10:57 UTC, Chris Rees
no flags Details
musicpd.diff (1.79 KB, patch)
2011-05-21 19:17 UTC, Doug Barton
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lichray 2011-05-19 09:10:10 UTC
	
	mpd does not report its pid/pidfile, while it offers a --kill option. But this option only sends the signal, which makes the `rc.d/musicpd restart` always fails (well... may not be always).

Fix: I wrote a function to use kevent to wait for the pid. I just make it FreeBSD-specific since I don't want to spend time on autotools.

	The idea is borrowed from src/bin/pwait.c
Comment 1 Edwin Groothuis freebsd_committer 2011-05-19 09:10:26 UTC
Maintainer of audio/musicpd,

Please note that PR ports/157173 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157173

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer 2011-05-19 09:10:28 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Chris Rees 2011-05-19 09:24:17 UTC
Thanks for this. However, I think that I'll rewrite the stop part of the rc
script -- that'd be much more standard than using the kill option.

I'll get on that tonight.

I'll pass your work upstream though!

Chris
Comment 4 Chris Rees 2011-05-21 08:43:44 UTC
OK, patch attached:

I've taken advice from freebsd-rc and used the get_pidfile_from_conf
function, with a default of whatever is default in %%MPDCONF%%. I've
also removed the $FreeBSD$ line from musicpd.in -- it's no longer
necessary or desirable according to dougb.

Many thanks to dougb@ for the advice.

- Fix stop function in rc script

PR: ports/157173
Noticed by: Zhihao Yuan <lichray@gmail.com>

Chris
Comment 5 Chris Rees 2011-05-21 10:57:21 UTC
Er, perhaps bump PORTREVISION too.




- Fix stop function in rc script

PR: ports/157173
Noticed by: Zhihao Yuan <lichray@gmail.com>
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2011-05-21 13:37:22 UTC
State Changed
From-To: feedback->open

Maintainer has responded with updated patch.
Comment 7 Doug Barton freebsd_committer 2011-05-21 19:17:48 UTC
On 05/21/2011 00:43, Chris Rees wrote:
> OK, patch attached:
>
> I've taken advice from freebsd-rc and used the get_pidfile_from_conf
> function, with a default of whatever is default in %%MPDCONF%%. I've
> also removed the $FreeBSD$ line from musicpd.in -- it's no longer
> necessary or desirable according to dougb.

Umm, I never said that. :)  In fact I've said the opposite. What you may 
be thinking of is my dislike for default-empty variable assignments.

I took a look at the script and the patch looks fine. I made one 
micro-optimization in the attached patch. Since there is no 
user-variable for the conf file there is no point in having it as a 
variable in the script.

> Many thanks to dougb@ for the advice.

My pleasure. :)


Doug


> - Fix stop function in rc script
>
> PR: ports/157173
> Noticed by: Zhihao Yuan<lichray@gmail.com>
>
> Chris



-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/
Comment 8 Chris Rees 2011-05-21 20:15:34 UTC
On 21 May 2011 19:17, Doug Barton <dougb@freebsd.org> wrote:
> On 05/21/2011 00:43, Chris Rees wrote:
>>
>> OK, patch attached:
>>
>> I've taken advice from freebsd-rc and used the get_pidfile_from_conf
>> function, with a default of whatever is default in %%MPDCONF%%. I've
>> also removed the $FreeBSD$ line from musicpd.in -- it's no longer
>> necessary or desirable according to dougb.
>
> Umm, I never said that. :) =A0In fact I've said the opposite. What you ma=
y be
> thinking of is my dislike for default-empty variable assignments.
>

Thanks for the fixes...

I was originally thinking of your email to me on monitorix:

1. The FreeBSD KEYWORD is no longer necessary or desirable.

I now realise that you were talking about the KEYWORD: part of rcorder.... =
d'oh!

Chris
Comment 9 Doug Barton freebsd_committer 2011-05-21 20:17:37 UTC
On 05/21/2011 12:15, Chris Rees wrote:
> On 21 May 2011 19:17, Doug Barton<dougb@freebsd.org>  wrote:
>> On 05/21/2011 00:43, Chris Rees wrote:
>>>
>>> OK, patch attached:
>>>
>>> I've taken advice from freebsd-rc and used the get_pidfile_from_conf
>>> function, with a default of whatever is default in %%MPDCONF%%. I've
>>> also removed the $FreeBSD$ line from musicpd.in -- it's no longer
>>> necessary or desirable according to dougb.
>>
>> Umm, I never said that. :)  In fact I've said the opposite. What you may be
>> thinking of is my dislike for default-empty variable assignments.
>>
>
> Thanks for the fixes...
>
> I was originally thinking of your email to me on monitorix:
>
> 1. The FreeBSD KEYWORD is no longer necessary or desirable.
>
> I now realise that you were talking about the KEYWORD: part of rcorder.... d'oh!

Voila!


-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/
Comment 10 Chris Rees freebsd_committer 2011-06-12 09:45:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

I'll take it
Comment 11 Chris Rees freebsd_committer 2011-06-17 15:00:09 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!
Comment 12 dfilter service freebsd_committer 2011-06-17 15:00:23 UTC
crees       2011-06-17 13:59:53 UTC

  FreeBSD ports repository

  Modified files:
    audio/musicpd        Makefile 
    audio/musicpd/files  musicpd.in 
  Log:
  - Fix stop function in rc script
  
  PR:             ports/157173
  Submitted by:   Zhihao Yuan <lichray@gmail.com>
  Reviewed by:    dougb
  Approved by:    tabthorpe (co-mentor)
  
  Revision  Changes    Path
  1.65      +1 -1      ports/audio/musicpd/Makefile
  1.8       +14 -11    ports/audio/musicpd/files/musicpd.in
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"