qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r581951 - in /incubator/qpid/trunk/qpid/cpp: Makefile.am docs/man/qpidd.x etc/qpidd.conf qpidc.spec.in src/qpid/Options.cpp src/qpid/Options.h src/qpidd.cpp
Date Thu, 04 Oct 2007 15:32:47 GMT
Author: aconway
Date: Thu Oct  4 08:32:45 2007
New Revision: 581951

URL: http://svn.apache.org/viewvc?rev=581951&view=rev
Log:

	* docs/man/qpidd.x: Explain configuration options.
	* etc/qpidd.conf: Placeholder configuration file.
	* qpidc.spec.in: Install qpidd.conf
	* Makefile.am: Install qpidd.conf
	* src/qpid/Options.cpp, h, src/qpidd.cpp: Option formatting fixes.

Added:
    incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf
Modified:
    incubator/qpid/trunk/qpid/cpp/Makefile.am
    incubator/qpid/trunk/qpid/cpp/docs/man/qpidd.x
    incubator/qpid/trunk/qpid/cpp/qpidc.spec.in
    incubator/qpid/trunk/qpid/cpp/src/qpid/Options.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/Options.h
    incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp

Modified: incubator/qpid/trunk/qpid/cpp/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/Makefile.am?rev=581951&r1=581950&r2=581951&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/Makefile.am Thu Oct  4 08:32:45 2007
@@ -5,10 +5,12 @@
 
 EXTRA_DIST = \
   LICENSE NOTICE README RELEASE_NOTES\
-  etc/qpidd \
+  etc/qpidd etc/qpidd.conf \
   $(SPEC) $(SPEC).in \
   rpm/README.qpidd-devel \
   xml/cluster.xml
+
+sysconf_DATA = etc/qpidd.conf
 
 SUBDIRS = src docs/api docs/man examples 
 

Modified: incubator/qpid/trunk/qpid/cpp/docs/man/qpidd.x
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/docs/man/qpidd.x?rev=581951&r1=581950&r2=581951&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/docs/man/qpidd.x (original)
+++ incubator/qpid/trunk/qpid/cpp/docs/man/qpidd.x Thu Oct  4 08:32:45 2007
@@ -1,16 +1,46 @@
 [NAME]
+
 qpidd \- the Qpid AMQP broker daemon
 
+[SYNOPSIS]
+
+qpidd [options]
+
 [DESCRIPTION]
 
-Start the AMQP broker. The broker options can be specified on the command line (e.g. --worker-threads
10), in an environment variable (e.g. export QPID_WORKER_THREADS=10), or as a line in a configuration
file (e.g. worker-threads=10).
+An AMQP broker daemon that stores, routes and forwards messages via
+the AMQP protocol.
+
+[OPTIONS]
+
+Options may be specified via command line, environment variable or configuration file. See
FILES and ENVIRONMENT below for details.
+
+[FILES]
+.I /etc/qpidd.conf
+.RS
+Default configuration file.
+.RE
 
-Command line options take precedence over environment variables, which
-take precedence over the config file.
+Configuration file settings are over-ridden by command line or environment variable settings.
'--config <file>' or 'export QPID_CONFIG=<file>' specifies an alternate file.
 
+Each line is a name=value pair. Blank lines and lines beginning with # are ignored. For example:
 
+  # My qpidd configuration file.
+  port=6000
+  max-connections=10
+  log.output=stdout
+  log.output=/tmp/qpidd.log
 
+[ENVIRONMENT]
+.I QPID_<option>
+.RS
+There is an environment variable for each option.
+.RE
 
+The environment variable is the option name in uppercase, prefixed with QPID_ and '.' or
'-' are replaced with '_'. Environment settings are over-ridden by command line settings.
For example:
 
+  export QPID_PORT=6000
+  export QPID_MAX_CONNECTIONS=10
+  export QPID_LOG_OUTPUT=/tmp/qpidd.log
 
 

Added: incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf?rev=581951&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf (added)
+++ incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf Thu Oct  4 08:32:45 2007
@@ -0,0 +1,2 @@
+# Configuration file for qpidd.
+# Using default settings, qpidd --help to see defaults.

Modified: incubator/qpid/trunk/qpid/cpp/qpidc.spec.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/qpidc.spec.in?rev=581951&r1=581950&r2=581951&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/qpidc.spec.in (original)
+++ incubator/qpid/trunk/qpid/cpp/qpidc.spec.in Thu Oct  4 08:32:45 2007
@@ -5,7 +5,7 @@
 
 Name:           @PACKAGE@
 Version:        @VERSION@
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        Libraries for Qpid C++ client applications
 Group:          System Environment/Libraries
 License:        Apache Software License
@@ -95,6 +95,7 @@
 %_libdir/libqpidcommon.so.0.1.0
 %_libdir/libqpidclient.so.0
 %_libdir/libqpidclient.so.0.1.0
+%_sysconfdir/qpidd.conf
 
 %files devel
 %defattr(-,root,root,-)
@@ -148,6 +149,10 @@
 /sbin/ldconfig
 
 %changelog
+
+* Thu Oct 4 2007 Alan Conway <aconway@redhat.com> - 0.2-8
+- Added qpidd.conf configuration file.
+- Updated man page to detail configuration options.
 
 * Thu Sep 20 2007 Alan Conway <aconway@redhat.com> - 0.2-7
 - Removed apr dependency.

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/Options.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/Options.cpp?rev=581951&r1=581950&r2=581951&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/Options.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/Options.cpp Thu Oct  4 08:32:45 2007
@@ -59,13 +59,14 @@
 
 }
 std::string prettyArg(const std::string& name, const std::string& value) {
-    return value.empty() ? name : name+" (="+value+")";
+    return value.empty() ? name+" " : name+" (="+value+") ";
 }
 
 Options::Options(const string& name) : po::options_description(name) {}
 
 void Options::parse(int argc, char** argv, const std::string& configFile)
 {
+    string defaultConfigFile = configFile; // May be changed by env/cmdline
     string parsing;
     try {
         po::variables_map vm;
@@ -78,9 +79,14 @@
         if (!configFile.empty()) {
             parsing="configuration file "+configFile;
             ifstream conf(configFile.c_str());
-            if (conf.good()) {
-                conf.exceptions(ifstream::failbit|ifstream::badbit);
+            if (conf.good())
                 po::store(po::parse_config_file(conf, *this), vm);
+            else {
+                // No error if default configfile is missing/unreadable
+                // but complain for non-default config file.
+                if (configFile != defaultConfigFile)
+                    throw Exception("cannot read configuration file "
+                                    +configFile);
             }
         }
         po::notify(vm);
@@ -94,7 +100,9 @@
     }
 }
 
-CommonOptions::CommonOptions(const string& name) : Options(name) {
+CommonOptions::CommonOptions(const string& name, const string& configfile)
+    : Options(name), config(configfile)
+{
     addOptions()
         ("help,h", optValue(help), "Print help message.")
         ("version,v", optValue(version), "Print version information.")

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/Options.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/Options.h?rev=581951&r1=581950&r2=581951&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/Options.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/Options.h Thu Oct  4 08:32:45 2007
@@ -137,7 +137,8 @@
  * Standard options for configuration
  */
 struct CommonOptions : public Options {
-    CommonOptions(const std::string& name=std::string());
+    CommonOptions(const std::string& name=std::string(),
+                  const std::string& configfile=std::string());
     bool help;
     bool version;
     std::string config;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp?rev=581951&r1=581950&r2=581951&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpidd.cpp Thu Oct  4 08:32:45 2007
@@ -61,8 +61,7 @@
     DaemonOptions daemon;
     qpid::log::Options log;
     
-    QpiddOptions() : qpid::Options("Options") {
-        common.config = "/etc/qpidd.conf";
+    QpiddOptions() : qpid::Options("Options"), common("", "/etc/qpidd.conf") {
         add(common);
         add(broker);
         add(daemon);



Mime
View raw message