Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/taskjuggler/daemon/Daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def start

# We no longer have a controlling terminal, so these are useless.
$stdin.reopen('/dev/null')
$stdout.reopen(StringIO.new)
$stdout.reopen('/dev/null', 'a')
$stderr.reopen($stdout)

info('daemon_pid',
Expand Down
9 changes: 7 additions & 2 deletions lib/taskjuggler/daemon/ReportServlet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,13 @@ def generateReport(projectId, reportId, attributes)
# text from the report server. This buffer will contain the generated
# report as HTML encoded text. They will be send via DRb, so we have to
# extend them with DRbUndumped.
stdOut = StringIO.new('')
#
# Note: In Ruby 4.0+, StringIO.new('') unexpectedly creates a read-only
# buffer in the web server context. Using StringIO.new without arguments
# avoids this issue. Root cause not yet identified.
stdOut = StringIO.new
stdOut.extend(DRbUndumped)
stdErr = StringIO.new('')
stdErr = StringIO.new
stdErr.extend(DRbUndumped)

begin
Expand All @@ -119,6 +123,7 @@ def generateReport(projectId, reportId, attributes)
end

error('rs_io_connect_failed', "Can't connect IO: #{$!}")
return
end

# Ask the ReportServer to generate the reports with the provided ID.
Expand Down