changeset 8297:03513f5066f3

fix: issue2551238 - roundup-server should exit with error ... if -d <pidfile> is used without -l <logfile>. Now exits with error if -l or -L are not specified with -d. This exposed a problem with relative paths when using a logging config file. -d enables deamon mode by default. This changes the current direcory to /. So relative paths in a logging config file are opened in / and fail. Added documentation to dmin guide noting the problem.
author John Rouillard <rouilj@ieee.org>
date Mon, 20 Jan 2025 15:51:53 -0500
parents 4d3b371ed543
children cfa7d43a3658
files CHANGES.txt doc/admin_guide.txt roundup/scripts/roundup_server.py
diffstat 3 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Mon Jan 20 15:21:56 2025 -0500
+++ b/CHANGES.txt	Mon Jan 20 15:51:53 2025 -0500
@@ -87,6 +87,10 @@
   supplied the fix. John Rouillard committed)
 - issue1895197 - translated help texts in admin.py not displayed
   correctly. (Initial patch tobias-herp, John Rouillard)
+- issue2551238 - roundup-server should exit with error if -d
+  <pidfile> is used without -l <logfile>. Added code to report
+  the issue. Added issue with relative paths for log file whn
+  using -L and -d with roundup-server. (John Rouillard)
 
 Features:
 
--- a/doc/admin_guide.txt	Mon Jan 20 15:21:56 2025 -0500
+++ b/doc/admin_guide.txt	Mon Jan 20 15:51:53 2025 -0500
@@ -223,6 +223,20 @@
   ``-----END CERTIFICATE-----``.
   If not specified, roundup will generate a temporary, self-signed certificate
   for use.
+**loghttpvialogger** section
+  If you:
+
+    * have **loghttpvialogger** enabled
+    * use **pidfile**
+    * use a logging config file in the tracker's config.ini
+
+  it is essential to specify absolute paths for log files in the
+  tracker's logging.config file.  The use of pidfile causes the
+  server to switch to the root directory ('/'). As a result
+  relative paths in the logging ini configuration file (as
+  opposed to the tracker's config.ini) will be written to the
+  system's root directory. The access error will cause the server
+  to exit.
 **trackers** section
   Each line denotes a mapping from a URL component to a tracker home.
   Make sure the name part doesn't include any url-unsafe characters like
--- a/roundup/scripts/roundup_server.py	Mon Jan 20 15:21:56 2025 -0500
+++ b/roundup/scripts/roundup_server.py	Mon Jan 20 15:51:53 2025 -0500
@@ -1198,6 +1198,9 @@
         config.set_logging()
     if config["PIDFILE"]:
         config["PIDFILE"] = os.path.abspath(config["PIDFILE"])
+        if not (config["LOGFILE"] or config["LOGHTTPVIALOGGER"]):
+            print(_("If you specify a PID file you must use -l or -L."))
+            sys.exit(1)
 
     # fork the server from our parent if a pidfile is specified
     if config["PIDFILE"]:

Roundup Issue Tracker: http://roundup-tracker.org/