Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Jan 2012 16:16:42 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        Thierry Thomas <thierry@FreeBSD.org>
Cc:        cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/www/tt-rss Makefile ports/www/tt-rss/files ttrssd.in
Message-ID:  <4F0248EA.80304@FreeBSD.org>
In-Reply-To: <201201021255.q02CtYQF013409@repoman.freebsd.org>
References:  <201201021255.q02CtYQF013409@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040600020804060808000403
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

I think you can probably remove most of the script you have. Take a look
at the attached. Most egregious is your abuse of pidfile=. With that
gone, most of the other problems solve themselves. Needs testing of course.


Doug


On 01/02/2012 04:55, Thierry Thomas wrote:
> thierry     2012-01-02 12:55:34 UTC
> 
>   FreeBSD ports repository
> 
>   Modified files:
>     www/tt-rss           Makefile 
>     www/tt-rss/files     ttrssd.in 
>   Log:
>   Fix the stop of the daemon.
>   
>   Revision  Changes    Path
>   1.14      +1 -0      ports/www/tt-rss/Makefile
>   1.2       +2 -2      ports/www/tt-rss/files/ttrssd.in
> 
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/www/tt-rss/Makefile.diff?&r1=1.13&r2=1.14&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/www/tt-rss/files/ttrssd.in.diff?&r1=1.1&r2=1.2&f=h
> 



-- 

	You can observe a lot just by watching.	-- Yogi Berra

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/


--------------040600020804060808000403
Content-Type: text/plain;
 name="ttrssd.in.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="ttrssd.in.diff"

Index: ttrssd.in
===================================================================
RCS file: /home/pcvs/ports/www/tt-rss/files/ttrssd.in,v
retrieving revision 1.2
diff -u -r1.2 ttrssd.in
--- ttrssd.in	2 Jan 2012 12:55:33 -0000	1.2
+++ ttrssd.in	3 Jan 2012 00:15:19 -0000
@@ -1,50 +1,53 @@
 #! /bin/sh
-#
+
 # $FreeBSD: ports/www/tt-rss/files/ttrssd.in,v 1.2 2012/01/02 12:55:33 thierry Exp $
 #
-
 # PROVIDE: ttrssd
 # REQUIRE: LOGIN mysql postgresql
 # KEYWORD: shutdown
-
-# Add the following line to /etc/rc.conf to enable `ttrssd':
 #
-#ttrssd_enable="YES"
+# Add the following line to /etc/rc.conf to enable `ttrssd':
 #
+#	ttrssd_enable="YES"
 
 . /etc/rc.subr
 
 name="ttrssd"
 rcvar=`set_rcvar`
 
-# read settings, set default values
 load_rc_config "${name}"
-: ${ttrssd_enable="NO"}
+
+: ${ttrssd_enable:="NO"}
+: ${ttrssd_chdir:="%%WWWDIR%%"}
+: ${ttrssd_log:="/var/log/${name}.log"}
 
 required_files="%%WWWDIR%%/config.php"
-pidfile="/var/run/${name}.pid"
-phpcli="%%LOCALBASE%%/bin/php"
-command_interpreter=$phpcli
+command_interpreter="%%LOCALBASE%%/bin/php"
 long_name="Tiny Tiny RSS updating feeds daemon."
-phpupd="update_daemon2.php"
-ttrssd_log="/var/log/${name}.log"
-
-start_cmd=${name}_start
-stop_cmd=${name}_stop
+command="update_daemon2.php"
+command_args="> $ttrssd_log &"
 
-ttrssd_start() {
-	[ -x $phpcli ] || (echo "$phpcli not found"; exit 1)
-	[ -f $pidfile ] && (echo "$name already running?"; exit 2)
-	echo "Starting $long_name"
-	(cd %%WWWDIR%% && ./$phpupd > $ttrssd_log &) && \
-	echo $$ > $pidfile
-}
-
-ttrssd_stop() {
-	[ -f $pidfile ] || (echo "$name not running?"; exit 1)
-	echo "Stopping $long_name"
-	kill `ps x | grep $phpupd | grep -v grep | awk '{print $1}'`
-	rm -f $pidfile
-}
+#ttrssd_start() {
+	## If this is necessary at all, it should be a prestart method, and
+	## the right side should be: || err 1 $phpcli not found
+	#[ -x $phpcli ] || (echo "$phpcli not found"; exit 1)
+
+	## These two are almost certainly not necessary
+	#[ -f $pidfile ] && (echo "$name already running?"; exit 2)
+	#echo "Starting $long_name"
+
+	## This should likely be done by ttrssd_chdir instead
+	#(cd %%WWWDIR%%
+
+	#&& ./$phpupd
+
+	## This should probably be done with command_args instead
+	#> $ttrssd_log &) && \
+
+	## This almost certainly does not accomplish what you want.
+	## If the thing itself does not have a pid file, then pidfile=
+	## should not be set.
+	#echo $$ > $pidfile
+#}
 
 run_rc_command "$1"

--------------040600020804060808000403--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F0248EA.80304>