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

Be safe against empty docker_root_dir (issue 1989) #2021

Merged

Conversation

jsmeix
Copy link
Member

@jsmeix jsmeix commented Jan 21, 2019

  • Type: Bug Fix

  • Impact: High
    High impact only when docker is used.

  • Reference to related issue (URL):
    Ubuntu 14.04 mkbackup does not backup anything #1989 (comment)

  • How was this pull request tested?
    I do not use docker and I get exactly the same
    var/lib/rear/layout/disklayout.conf as before
    so I assume there are no regressions.

  • Brief description of the changes in this pull request:
    In usr/share/rear/layout/save/GNU/Linux/230_filesystem_layout.sh
    ensure docker_root_dir is not empty because otherwise any
    mountpoint string matches "^" which would skip all mountpoints

@jsmeix jsmeix added the bug The code does not do what it is meant to do label Jan 21, 2019
@jsmeix jsmeix added this to the ReaR v2.5 milestone Jan 21, 2019
@jsmeix jsmeix self-assigned this Jan 21, 2019
@jsmeix jsmeix requested a review from gdha January 21, 2019 13:19
Copy link
Member

@gdha gdha left a comment

Choose a reason for hiding this comment

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

@jsmeix do me a favor and replace docker info with timeout 5s docker info - why? I have seen too many cripple docker installation the last couple of months.

@jsmeix
Copy link
Member Author

jsmeix commented Jan 21, 2019

@gdha
I did even more:
Now it kills 'docker info' with SIGTERM after 5 seconds
plus with SIGKILL after additional 2 seconds.
I can change it as you like.

…ot_dir only once) and show possible errors to the user in any case (not only in verbode mode)
@jsmeix jsmeix merged commit b4148ae into rear:master Jan 22, 2019
@jsmeix jsmeix deleted the be_safe_against_empty_docker_root_dir_issue_1989 branch January 22, 2019 12:20
@jsmeix
Copy link
Member Author

jsmeix commented Jan 22, 2019

@gdha
only FYI:

On my old SLES10 system there is no timeout command
(at least not by default) and it is not in the 'coreutils' RPM on SLES10.

Since SLES11 there is by default a timeout command that is
provided by the 'coreutils' RPM which is installed by default.

Accordingly since this pull request the command in the line

docker_root_dir=$( timeout -k 2s 5s docker info | grep 'Docker Root Dir' | awk '{print $4}' )

will fail so that docker_root_dir gets empty but I assume that
nobody uses Docker on SLES10 so that in practice this should
not add another regression on SLES10 because the above line
is only run

if service docker status

and that even works on SLES10:

# service docker status && echo Y || echo N
service: no such service docker
N

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do cleanup fixed / solved / done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants