cvs commit: ports/net/freeswitch-core Makefile pkg-plist
ports/net/freeswitch-core/files freeswitch.in
Doug Barton
dougb at FreeBSD.org
Wed Aug 11 01:54:44 UTC 2010
In addition to the plist issues you also made a change to the rc.d file,
but you didn't go far enough. :) There are numerous issues with the
existing file:
1. It's generally preferred that ports rc.d files use REQUIRE: LOGIN
unless there is a good reason not to. However this service runs as an
unprivileged user, which makes that a requirement.
2. The default variable assignments have to come after load_rc_config to
be effective.
3. _flags should not be reproduced in command_args
4. The start and restart methods seem superfluous to me, most if not all
of what you're going for can likely be accomplished by using
wait_for_pids in the _stop method.
The attached patch should accomplish these fixes, but it should be
tested of course ...
Doug
On 08/10/2010 18:39, Josh Paetzel wrote:
> jpaetzel 2010-08-11 01:39:18 UTC
>
> FreeBSD ports repository
>
> Modified files:
> net/freeswitch-core Makefile pkg-plist
> net/freeswitch-core/files freeswitch.in
> Log:
> Fix issues with plist caused by previous commit.
> Remove BROKEN
>
> PR: ports/149119 http://www.FreeBSD.org/cgi/query-pr.cgi?pr=149119
> Submitted by: Richard Neese <r.neese at gmail.com>
>
> Revision Changes Path
> 1.8 +43 -36 ports/net/freeswitch-core/Makefile
> 1.3 +2 -2 ports/net/freeswitch-core/files/freeswitch.in
> 1.3 +202 -200 ports/net/freeswitch-core/pkg-plist
>
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/freeswitch-core/Makefile.diff?&r1=1.7&r2=1.8&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/freeswitch-core/files/freeswitch.in.diff?&r1=1.2&r2=1.3&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/freeswitch-core/pkg-plist.diff?&r1=1.2&r2=1.3&f=h
>
--
Improve the effectiveness of your Internet presence with
a domain name makeover! http://SupersetSolutions.com/
Computers are useless. They can only give you answers.
-- Pablo Picasso
-------------- next part --------------
Index: freeswitch.in
===================================================================
RCS file: /home/pcvs/ports/net/freeswitch-core/files/freeswitch.in,v
retrieving revision 1.3
diff -u -r1.3 freeswitch.in
--- freeswitch.in 11 Aug 2010 01:39:17 -0000 1.3
+++ freeswitch.in 11 Aug 2010 01:51:48 -0000
@@ -1,8 +1,7 @@
#!/bin/sh
# PROVIDE: freeswitch
-# REQUIRE: DAEMON
-# BEFORE: LOGIN
+# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable freeswitch:
@@ -15,56 +14,27 @@
. /etc/rc.subr
+name=freeswitch
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
freeswitch_enable=${freeswitch_enable:-"NO"}
freeswitch_user=${freeswitch_user:-"freeswitch"}
freeswitch_group=${freeswitch_group:-"freeswitch"}
freeswitch_flags=${freeswitch_flags:-"-nc -waste"}
-name=freeswitch
-rcvar=`set_rcvar`
-
command=%%PREFIX%%/bin/freeswitch
-command_args="${freeswitch_flags} -u ${freeswitch_user} -g ${freeswitch_group}"
+command_args="-u ${freeswitch_user} -g ${freeswitch_group}"
pidfile=${freeswitch_pidfile:-"/var/run/freeswitch/freeswitch.pid"}
-start_cmd="freeswitch_start"
stop_precmd="freeswitch_stop"
-restart_cmd="freeswitch_restart"
-
-sig_stop=KILL
-
-load_rc_config $name
freeswitch_stop () {
echo "Stopping FreeSWITCH."
%%PREFIX%%/bin/freeswitch -stop
- sleep 1
- return 0
+ wait_for_pids `cat $pidfile`
}
-freeswitch_start () {
- echo "Starting FreeSWITCH."
- $command $command_args
- sleep 1
- return
-}
-
-freeswitch_restart () {
- echo "Restarting FreeSwitch."
- freeswitch_stop
- if [ $? -eq 0 ];
- then
- status=$?
- freeswitch_start
- sleep 1
- return 0
- else
- echo "Problem stoping FreeSWITCH: $status"
- sleep 1
- return 1
- fi
-}
-
run_rc_command "$1"
-
More information about the cvs-ports
mailing list