Skip to content

There is no good way to repeat a prep stanza if it failed #2

Description

@dottedmag

prep stanza runs once and stops the block if it failed.

This is most often what one needs, but sometimes prep failures are transient: e.g. a script was unable to apply DB schema while PostgreSQL server is starting. In this case it would be nice to repeat prep until it succeeds.

I have tried wrapping prep stanzas in while ! x; do sleep 1; done, but this solution also has issues:

  • It does not back-off
  • It is a separate shell script that will continue to run if ppow is brutally killed.

So, what I need is a hybrid between prep (run before other commands, allow other commands to run if prep succeeds) and daemon (rerun with backoff).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions