From owner-freebsd-ports@FreeBSD.ORG Fri Jun 25 02:10:31 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89073106564A for ; Fri, 25 Jun 2010 02:10:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0C88FC13 for ; Fri, 25 Jun 2010 02:10:30 +0000 (UTC) Received: (qmail 2108 invoked by uid 399); 25 Jun 2010 02:10:30 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 25 Jun 2010 02:10:30 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C241015.1070801@FreeBSD.org> Date: Thu, 24 Jun 2010 19:10:29 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100621 Thunderbird/3.0.5 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Olivier_Cochard-Labb=E9?= References: In-Reply-To: X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------030000060302000204070100" Cc: freebsd-ports-mailinglist Subject: Re: Call for testers: www/shellinabox (Shell in a Box) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 02:10:31 -0000 This is a multi-part message in MIME format. --------------030000060302000204070100 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit On 06/24/10 15:51, Olivier Cochard-Labbé wrote: > Hi all, > > I've just finished my port of Shell in a Box: It's a secure web server > that provide ajax terminal emulator. > More information on the official website: http://code.google.com/p/shellinabox/ > > Before to submit it, Can someone test it ? > You can found the port here: http://gugus69.free.fr/tools/shellinabox.tgz I didn't test the port, but attached is a diff to your rc.d script. For more information take a look at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html Some notes: 1. We like to have a $FreeBSD id line in rc.d scripts 2. We support case sensitivity for arguments like your _fib option, so case is a better choice here. 3. You need a default for _enable. To see why, comment out the entry you have in /etc/rc.conf[.local] and then try running the script. 4. There is no need for a custom start_cmd here, and it's better to take advantage of the rc.d infrastructure (that includes fixing your typo for pidfile). 5. I added the required_dirs since it seems like that's mandatory. 6. By convention the argument for backgrounding the daemon is the last one listed, but that's just a style nit. hth, Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ --------------030000060302000204070100 Content-Type: text/plain; name="shellinaboxd-rcd.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="shellinaboxd-rcd.diff" --- shellinaboxd.in.orig 2010-06-24 15:44:16.000000000 -0700 +++ shellinaboxd.in 2010-06-24 19:02:03.000000000 -0700 @@ -1,4 +1,6 @@ #!/bin/sh + +# $FreeBSD$ # # Shell in a Box Daemon startup script # @@ -20,11 +22,14 @@ shellinaboxd_setfib() { sysctl net.fibs >/dev/null 2>&1 || return 0 - if [ "x${shellinaboxd_fib}" != "xNONE" ]; then + + case "$shellinaboxd_fib" in + [Nn][Oo][Nn][Ee]) + ;; + *) command="setfib -F ${shellinaboxd_fib} ${command}" - else - return 0 - fi + ;; + esac } . /etc/rc.subr @@ -36,13 +41,16 @@ start_precmd="shellinaboxd_setfib" load_rc_config $name + +shellinaboxd_enable=${shellinaboxd_enable:-"NO"} shellinaboxd_fib=${shellinaboxd_fib:-"NONE"} -shellinaboxd_pidfile=${shellinaboxd_pidfile:-"/var/run/shellinaboxd.pid"} shellinaboxd_port=${shellinaboxd_port:-"4200"} shellinaboxd_certdir=${shellinaboxd_certdir:-"%%PREFIX%%/etc/shellinabox"} -start_cmd="$command --port=${shellinaboxd_port} --background=${shellinaboxd_pidfile} --cert=${shellinaboxd_certdir}" +pidfile=${shellinaboxd_pidfile:-"/var/run/shellinaboxd.pid"} + +required_dirs="${shellinaboxd_certdir}" -pid_file=${shellinaboxd_pidfile} +command_args="--port=${shellinaboxd_port} --cert=${shellinaboxd_certdir} --background=${pidfile}" run_rc_command "$1" --------------030000060302000204070100--