Skip to content

Commit

Permalink
fix: issue2551238 - roundup-server should exit with error ...
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rouilj committed Jan 20, 2025
1 parent f70e7e3 commit cac1477
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ Fixed:
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:

Expand Down
14 changes: 14 additions & 0 deletions doc/admin_guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@ Additional notes for each keyword:
``-----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
Expand Down
3 changes: 3 additions & 0 deletions roundup/scripts/roundup_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,9 @@ def run(port=undefined, success_message=None):
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"]:
Expand Down

0 comments on commit cac1477

Please sign in to comment.