diff roundup/scripts/roundup_server.py @ 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 341841a9edc5
children a2c376d0f110
line wrap: on
line diff
--- 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/