Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bacula: Fixed 'bconsole' prompt not displaying at all when doing a recover #2173

Merged
merged 1 commit into from Jul 6, 2019

Conversation

rmetrich
Copy link
Contributor

@rmetrich rmetrich commented Jul 4, 2019

Relax-and-Recover (ReaR) Pull Request Template

Please fill in the following items before submitting a new pull request:

Pull Request Details:
  • Type: Bug Fix

  • Impact: Normal

  • Reference to related issue (URL):

  • How was this pull request tested? Tested a recovery with bacula until bconsole is executed

  • Brief description of the changes in this pull request:

With this change, the bconsole output is sent to FD 7, which is stdout. Previously the output was sent to FD 1 which is redirected to the ReaR log.

@rmetrich
Copy link
Contributor Author

rmetrich commented Jul 4, 2019

Expected prompt:

Press ENTER to start bconsole

Connecting to Director XXX:9101
1000 OK: bacula-dir Version: 5.2.13 (19 February 2013)
Enter a period to cancel a command.
*

Without the fix:

Press ENTER to start bconsole

@gdha gdha added this to the ReaR v2.6 milestone Jul 4, 2019
@jsmeix
Copy link
Member

jsmeix commented Jul 4, 2019

@rmetrich
I don't know how bconsole behaves but in general according to
the sections "What to do with stdin, stdout, and stderr"
and "It should be possible to run ReaR unattended" in
https://github.com/rear/rear/wiki/Coding-Style
I would run all commands that (possibly) do user dialogs
(i.e. all [possibly] interactive commands)
with the original stdin, stdout, and stderr file descriptors
when usr/sbin/rear was launched like

COMMAND ... 0<&6 1>&7 2>&8

@gdha
Copy link
Member

gdha commented Jul 4, 2019

@rmetrich I assigned the PR to you as I assume that it is linked to a RH case?

@rmetrich
Copy link
Contributor Author

rmetrich commented Jul 4, 2019

@rmetrich
I don't know how bconsole behaves but in general according to
the sections "What to do with stdin, stdout, and stderr"
and "It should be possible to run ReaR unattended" in
https://github.com/rear/rear/wiki/Coding-Style
I would run all commands that (possibly) do user dialogs
(i.e. all [possibly] interactive commands)
with the original stdin, stdout, and stderr file descriptors
when usr/sbin/rear was launched like

COMMAND ... 0<&6 1>&7 2>&8

Seems even more robust, thanks!

@rmetrich
Copy link
Contributor Author

rmetrich commented Jul 4, 2019

@rmetrich I assigned the PR to you as I assume that it is linked to a RH case?

Yes, this is https://bugzilla.redhat.com/show_bug.cgi?id=1726992

Copy link
Member

@jsmeix jsmeix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I blindly approve it because I trust @rmetrich
(and I cannot know how bconsole behaves
because I do not use third-party backup tools).

@jsmeix
Copy link
Member

jsmeix commented Jul 4, 2019

@rmetrich
as it seems you can run bconsole and see how it actually behaves:
What about adding a Log message to have something about it
in ReaR's log file like

if bconsole 0<&6 1>&7 2>&8 ; then
    Log "bconsole finished with zero exit code"
else
    Log "bconsole finished with non-zero exit code $?"
fi

to make it easier to see what happened when someone
(e.g. we at ReaR upstream) must analyze a ReaR issue
only with what there is in the ReaR log file.

@jsmeix jsmeix added the bug label Jul 4, 2019
…cover

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
@pcahyna
Copy link
Member

pcahyna commented Aug 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants