Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jun 2010 19:10:29 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        =?ISO-8859-1?Q?Olivier_Cochard-Labb=E9?= <olivier@freenas.org>
Cc:        freebsd-ports-mailinglist <freebsd-ports@freebsd.org>
Subject:   Re: Call for testers: www/shellinabox (Shell in a Box)
Message-ID:  <4C241015.1070801@FreeBSD.org>
In-Reply-To: <AANLkTil__Lw0uiFXKMI4o1TMoFBXbtQ3CPS1-yMl4edQ@mail.gmail.com>
References:  <AANLkTil__Lw0uiFXKMI4o1TMoFBXbtQ3CPS1-yMl4edQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



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