From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Aug 29 18:10:18 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27D8D16A4DA for ; Tue, 29 Aug 2006 18:10:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 696AF43D5D for ; Tue, 29 Aug 2006 18:10:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k7TIAFag094301 for ; Tue, 29 Aug 2006 18:10:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k7TIAFot094300; Tue, 29 Aug 2006 18:10:15 GMT (envelope-from gnats) Resent-Date: Tue, 29 Aug 2006 18:10:15 GMT Resent-Message-Id: <200608291810.k7TIAFot094300@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Aaron Gifford Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC3A116A4DE for ; Tue, 29 Aug 2006 18:03:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E24043D49 for ; Tue, 29 Aug 2006 18:03:45 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k7TI3jBI009984 for ; Tue, 29 Aug 2006 18:03:45 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k7TI3jpZ009982; Tue, 29 Aug 2006 18:03:45 GMT (envelope-from nobody) Message-Id: <200608291803.k7TI3jpZ009982@www.freebsd.org> Date: Tue, 29 Aug 2006 18:03:45 GMT From: Aaron Gifford To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/102651: [patch] New command-line option for jabberd port start-up (for /usr/ports/net-im/jabberd) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Aug 2006 18:10:18 -0000 >Number: 102651 >Category: ports >Synopsis: [patch] New command-line option for jabberd port start-up (for /usr/ports/net-im/jabberd) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Aug 29 18:10:14 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Aaron Gifford >Release: 6.1-STABLE (not really applicable) >Organization: >Environment: Not applicable >Description: While the current jabberd port (jabberd-2.0.11_1 in /usr/ports/net-im/jabberd) supports command-line option -c to specify a configuration file, if one's OTHER configuration files are NOT in the default /usr/local/etc directory, start-up will fail. To fix this, I've added the option -d to specify an alternate configuration directory in which configuration files may reside. This patch is simple, and is quick and easy to apply. Aaron out. >How-To-Repeat: N/A >Fix: --- /usr/local/bin/jabberd.orig Tue Aug 29 01:19:01 2006 +++ /usr/local/bin/jabberd Tue Aug 29 11:57:21 2006 @@ -28,8 +28,7 @@ my $Bin = "/usr/local/bin"; my $VERSION = "2.0s11"; my $config_dir = "/usr/local/etc/jabberd"; -my $config = $config_dir."/jabberd.cfg"; -$config = "internal" unless (-e $config); +my $config = "jabberd.cfg"; my $debug = 0; my $daemon = 0; my $select = IO::Select->new(); @@ -43,13 +42,20 @@ # Process the command line arguments #----------------------------------------------------------------------------- my %opts; -getopts("c:Dhb",\%opts); +getopts("c:d:Dhb",\%opts); &usage if exists($opts{h}); if (exists($opts{c})) { $config = $opts{c} if (defined($opts{c}) && ($opts{c} ne "")); &usage() if (!defined($opts{c}) || ($opts{c} eq "")); } +if (exists($opts{d})) +{ + $config_dir = $opts{d} if (defined($opts{d}) && ($opts{d} ne "")); + &usage() if (!defined($opts{d}) || ($opts{d} eq "")); +} +$config = $config_dir.'/'.$config if ($config !~ /^\.?\//); +$config = "internal" unless (-e $config); $debug = 1 if exists($opts{D}); $daemon = 1 if exists($opts{b}); @@ -123,6 +129,7 @@ &debug("jabberd","stdout","debug on\n"); &debug("jabberd","stdout","version($VERSION)\n"); &debug("jabberd","stdout","config_dir($config_dir)\n"); + &debug("jabberd","stdout","config($config)\n"); } #----------------------------------------------------------------------------- >Release-Note: >Audit-Trail: >Unformatted: