Skip to content

Commit cac1477

Browse files
committed
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.
1 parent f70e7e3 commit cac1477

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ Fixed:
8787
supplied the fix. John Rouillard committed)
8888
- issue1895197 - translated help texts in admin.py not displayed
8989
correctly. (Initial patch tobias-herp, John Rouillard)
90+
- issue2551238 - roundup-server should exit with error if -d
91+
<pidfile> is used without -l <logfile>. Added code to report
92+
the issue. Added issue with relative paths for log file whn
93+
using -L and -d with roundup-server. (John Rouillard)
9094

9195
Features:
9296

doc/admin_guide.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,20 @@ Additional notes for each keyword:
223223
``-----END CERTIFICATE-----``.
224224
If not specified, roundup will generate a temporary, self-signed certificate
225225
for use.
226+
**loghttpvialogger** section
227+
If you:
228+
229+
* have **loghttpvialogger** enabled
230+
* use **pidfile**
231+
* use a logging config file in the tracker's config.ini
232+
233+
it is essential to specify absolute paths for log files in the
234+
tracker's logging.config file. The use of pidfile causes the
235+
server to switch to the root directory ('/'). As a result
236+
relative paths in the logging ini configuration file (as
237+
opposed to the tracker's config.ini) will be written to the
238+
system's root directory. The access error will cause the server
239+
to exit.
226240
**trackers** section
227241
Each line denotes a mapping from a URL component to a tracker home.
228242
Make sure the name part doesn't include any url-unsafe characters like

roundup/scripts/roundup_server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,9 @@ def run(port=undefined, success_message=None):
11981198
config.set_logging()
11991199
if config["PIDFILE"]:
12001200
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)
12011204

12021205
# fork the server from our parent if a pidfile is specified
12031206
if config["PIDFILE"]:

0 commit comments

Comments
 (0)