comparison 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
comparison
equal deleted inserted replaced
8296:4d3b371ed543 8297:03513f5066f3
1196 config["LOGFILE"] = os.path.abspath(config["LOGFILE"]) 1196 config["LOGFILE"] = os.path.abspath(config["LOGFILE"])
1197 # switch logging from stderr/stdout to logfile 1197 # switch logging from stderr/stdout to logfile
1198 config.set_logging() 1198 config.set_logging()
1199 if config["PIDFILE"]: 1199 if config["PIDFILE"]:
1200 config["PIDFILE"] = os.path.abspath(config["PIDFILE"]) 1200 config["PIDFILE"] = os.path.abspath(config["PIDFILE"])
1201 if not (config["LOGFILE"] or config["LOGHTTPVIALOGGER"]):
1202 print(_("If you specify a PID file you must use -l or -L."))
1203 sys.exit(1)
1201 1204
1202 # fork the server from our parent if a pidfile is specified 1205 # fork the server from our parent if a pidfile is specified
1203 if config["PIDFILE"]: 1206 if config["PIDFILE"]:
1204 if not hasattr(os, 'fork'): 1207 if not hasattr(os, 'fork'):
1205 print(_("Sorry, you can't run the server as a daemon" 1208 print(_("Sorry, you can't run the server as a daemon"

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