Motivation

When automating tasks often the requirement comes up to retry commands, for example when network connections are involved and commands do not return successfully immediately or if resources are temporarily not available. Sometimes a simple for-loop in bash is sufficient. Sometimes it is necessary to use additional waiting between retries, sometimes timeouts are desired. Getting all those combinations right can be tedious and error-prone so a generic "retry" command should be available in usual environments so we should provide a retry command to openSUSE distributions.

Goals

  • G1: A "retry" command is submitted to openSUSE:Factory as part of a package

Execution

  • Research existing approaches and distributions
  • Package existing solution or develop alternative on your own
  • Submit package to a devel repository and then openSUSE:Factory and work on feedback

Results

Further details

There are some "best practices" like https://stackoverflow.com/questions/7449772/how-to-retry-a-command-in-bash and https://unix.stackexchange.com/questions/82598/how-do-i-write-a-retry-logic-in-script-to-keep-retrying-to-run-it-upto-5-times . There are also existing commands, like https://github.com/minfrin/retry but it seems to unmaintained and even fails to build so maybe https://github.com/okurz/scripts/blob/master/retry is a better start.

Looking for hackers with the skills:

linux retry bash github coreutils packaging

This project is part of:

Hack Week 21

Activity

  • almost 2 years ago: cdywan liked this project.
  • almost 2 years ago: fbonazzi liked this project.
  • almost 2 years ago: maritawerner liked this project.
  • about 2 years ago: ph03nix liked this project.
  • about 2 years ago: okurz added keyword "bash" to this project.
  • about 2 years ago: okurz added keyword "github" to this project.
  • about 2 years ago: okurz added keyword "coreutils" to this project.
  • about 2 years ago: okurz added keyword "packaging" to this project.
  • about 2 years ago: okurz added keyword "linux" to this project.
  • about 2 years ago: okurz added keyword "retry" to this project.
  • about 2 years ago: okurz started this project.
  • about 2 years ago: okurz originated this project.

  • Comments

    • okurz
      about 2 years ago by okurz | Reply

      Couldn't wait until hackweek so made it a small weekend project :D Based on what I had in https://github.com/okurz/scripts/tree/master/retry I created https://github.com/okurz/retry including proper README, license, tests, CI, spec file for a package. An according package in OBS https://build.opensuse.org/package/show/home:okurz:retry/retry setup to be triggered from github following https://linuxkamarada.com/en/2019/03/19/integrating-the-open-build-service-with-github/

    • minfrin
      over 1 year ago by minfrin | Reply

      While alternative implementations are great, please be careful with naming. The “retry” tool is already out the box in Debian, Ubuntu, and Nix, and in the queue for EPEL. It is currently available for Suse via copr. If you create a different tool with the same name but different command line options into opensuse it creates chaos for everyone.

      • okurz
        over 1 year ago by okurz | Reply

        Thanks for the comment. I researched earlier if I could find existing solutions in various distributions and I had not found the applications you mentioned at that time. Regarding copr, do you mean https://software.opensuse.org/package/python-copr ?

    Similar Projects

    Linux incarnation of the Party Parrot by rsimai

    Project Description

    Lesser on the coding s...


    Avahi Integration and Network Connection by vojha

    Avahi Integration and Network Connection

    ...


    Extract generic testing framework from Linux Test Project code base by acervesato

    Project Description

    The Linux Test Projec...


    Generic text file preprocessor using custom syntax for define include ifdef by mdati

    Project Description

    Scope of this project...


    Authenticated hashes for BTRFS by dsterba

    Project Description

    Implement a checksum ...


    Test Results for openQA on GitHub by livdywan

    Project Description

    Jobs in openQA are us...


    Collect flaky test cases identified by the team in a GitHub board and highlight them in the Test report by oscar-barrios

    Project Description

    Flaky tests: Th...


    Deep clean-up of the Uyuni documentation files by omaric

    Project Description

    This project is plann...


    Avahi Integration and Network Connection by vojha

    Avahi Integration and Network Connection

    ...


    Update Haskell ecosystem in Tumbleweed to GHC-9.6.x by psimons

    [comment]: # (Please use the project descriptio...


    A set of utilities to produce a "from scratch" OCI/Docker container using Opensuse/SLE rpms by ldragon

    [comment]: # (Please use the project descriptio...


    SSH key distribution solution by vgrinco

    Project Description

    SSH key distribution so...


    LSP server for SPEC files by mcepl

    Has anybody ever heard about RPM Spec LSP serve...


    openSUSE on ZoL from OpenZFS project by jkohoutek

    Idea is to have SUSE system with OpenZFS as roo...