--background neither closes nor redirects stdin/stdout/stderr

Bug #750658 reported by Kostja Osipov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tarantool
Fix Released
High
Kostja Osipov

Bug Description

if --daemonize option is given, and the standard output and error point to a terminal, they are neither closed, nor checked for write to succeed.

If there is no 'logger' option, and stdin/stdout are not redirected, this silently drops all logging messages into the void.

Suggestion: if --daemonize option is given, at least check that stderr/stdout are not a tty, and if they are, check that 'logger' option is given in the configuration file. If neither is the case, do not daemonize, because such daemon configuration is broken.

Since stdin is left open, you can't start the daemon remotely using ssh or telnet.
For example, this command simply hangs:

ssh host /bin/tarantool_box --config=/etc/tarantool.cfg --background

since the forked child keeps its stdin open and pointing to the terminal.

This is how this problem affects scripting.

Kostja Osipov (kostja)
Changed in tarantool:
assignee: nobody → Yuriy Vostrikov (vostrikov)
milestone: none → 1.3.6
importance: Undecided → Low
status: New → Confirmed
Kostja Osipov (kostja)
Changed in tarantool:
assignee: Yuriy Vostrikov (vostrikov) → Kostja Osipov (kostja)
importance: Low → High
milestone: none → 1.4.3
summary: - --daemonize neither closes nor redirects stdin/stdout/stderr
+ --background neither closes nor redirects stdin/stdout/stderr
description: updated
Kostja Osipov (kostja)
Changed in tarantool:
status: Confirmed → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.