diff options
author | Chris Rees <crees@FreeBSD.org> | 2011-06-17 13:59:53 +0000 |
---|---|---|
committer | Chris Rees <crees@FreeBSD.org> | 2011-06-17 13:59:53 +0000 |
commit | 4cb1f429201420c457fba8e10449662081270f89 (patch) | |
tree | a7af6dc6b06e2b9a95a8d83d68edf67df294caba /audio | |
parent | f7179d7a6ea154972487a1a52c677477feaaeabe (diff) | |
download | ports-4cb1f429201420c457fba8e10449662081270f89.tar.gz ports-4cb1f429201420c457fba8e10449662081270f89.zip |
Notes
Diffstat (limited to 'audio')
-rw-r--r-- | audio/musicpd/Makefile | 2 | ||||
-rw-r--r-- | audio/musicpd/files/musicpd.in | 23 |
2 files changed, 14 insertions, 11 deletions
diff --git a/audio/musicpd/Makefile b/audio/musicpd/Makefile index 3c76efec227d..19b488052cf5 100644 --- a/audio/musicpd/Makefile +++ b/audio/musicpd/Makefile @@ -7,7 +7,7 @@ PORTNAME= musicpd PORTVERSION= 0.16.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= audio ipv6 MASTER_SITES= SF/${PORTNAME}/mpd/${PORTVERSION} DISTNAME= mpd-${PORTVERSION} diff --git a/audio/musicpd/files/musicpd.in b/audio/musicpd/files/musicpd.in index 4ffce5240987..dfdcb8532446 100644 --- a/audio/musicpd/files/musicpd.in +++ b/audio/musicpd/files/musicpd.in @@ -1,5 +1,5 @@ #!/bin/sh -# + # $FreeBSD$ # # PROVIDE: musicpd @@ -8,28 +8,31 @@ # Add the following line to /etc/rc.conf to enable mpd: # -#musicpd_enable="YES" +# musicpd_enable="YES" . /etc/rc.subr name=musicpd rcvar=`set_rcvar` -stop_cmd="${name}_stop" +start_precmd="${name}_getpidfile" +stop_precmd="${name}_getpidfile" -config=%%PREFIX%%/etc/%%MPDCONF%% command=%%PREFIX%%/bin/musicpd -required_files=$config +command_args=%%PREFIX%%/etc/%%MPDCONF%% +required_files=%%PREFIX%%/etc/%%MPDCONF%% -musicpd_stop() +musicpd_getpidfile() { - echo -n "Stopping musicpd: "; - ${command} --kill ${config} && echo "stopped."; + if type get_pidfile_from_conf >/dev/null 2>&1 && + get_pidfile_from_conf pid_file %%PREFIX%%/etc/%%MPDCONF%% ; then + pidfile="$_pidfile_from_conf" + else + pidfile="%%MPDDIR%%/.mpd/pid" + fi } load_rc_config $name : ${musicpd_enable="NO"} -command_args="$config" - run_rc_command "$1" |