From owner-cvs-ports@FreeBSD.ORG Tue Jan 3 00:16:44 2012 Return-Path: Delivered-To: cvs-ports@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 9EAE0106566B; Tue, 3 Jan 2012 00:16:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 362A1152274; Tue, 3 Jan 2012 00:16:43 +0000 (UTC) Message-ID: <4F0248EA.80304@FreeBSD.org> Date: Mon, 02 Jan 2012 16:16:42 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Thierry Thomas References: <201201021255.q02CtYQF013409@repoman.freebsd.org> In-Reply-To: <201201021255.q02CtYQF013409@repoman.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------040600020804060808000403" 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 X-BeenThere: cvs-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 00:16:44 -0000 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--