ports/102651: [patch] New command-line option for jabberd port start-up (for /usr/ports/net-im/jabberd)
Aaron Gifford
astounding at gmail.com
Tue Aug 29 18:10:18 UTC 2006
>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:
More information about the freebsd-ports-bugs
mailing list