From owner-freebsd-ports@FreeBSD.ORG Fri May 26 19:35:17 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B66D016A9D0 for ; Fri, 26 May 2006 19:35:17 +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 SMTP id A1B5F43D53 for ; Fri, 26 May 2006 19:35:13 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 2156 invoked by uid 399); 26 May 2006 19:35:11 -0000 Received: from localhost (HELO ?192.168.0.3?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 26 May 2006 19:35:11 -0000 Message-ID: <4477586D.3030803@FreeBSD.org> Date: Fri, 26 May 2006 12:35:09 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5.0.2 (X11/20060507) MIME-Version: 1.0 To: Serge Gagnon References: <0IZV00DDIY8N1Q40@VL-MH-MR002.ip.videotron.ca> In-Reply-To: <0IZV00DDIY8N1Q40@VL-MH-MR002.ip.videotron.ca> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: rc.d question 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, 26 May 2006 19:35:21 -0000 Serge Gagnon wrote: > Hi, > I have a port that can be launch in two way simulaneously like: > webserver -p80 and > webserver -p443 -s > > I would like to know if the better way is to make to different rc.d script > like > webcit and webcit-ssl or to try to handle this in just one with args ? I'm > in favor to make two different one because it's less complicated. It's preferred that the PROVIDE line, $name variable, and the name of the script all match. So, unless the service will be called webcit-ssl if it's launched that way, the answer is that one script is better. If I were you, I'd approach the problem this way (assuming that without SSL is the more common case): #!/bin/sh # PROVIDE: webcit # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # webcit_enable (bool): Set to NO by default. # Set it to YES to enable webcit # webcit_ssl (bool): Set to YES to run SSL version too # . %%RC_SUBR%% name=webcit rcvar=${name}_enable command="%%PREFIX%%/sbin/${name}" command_args="-p80" start_postcmd="${name}_poststart" webcit_poststart() { [ -n "$webcit_ssl" ] && $command -p443 -s } load_rc_config $name : ${webcit_enable="NO"} run_rc_command "$1" hope this helps, Doug -- This .signature sanitized for your protection