Skip to content

daemons: set CLI11 error exit code to 41 and bareos config parsing error exit code to 42#1515

Merged
BareosBot merged 10 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes
Sep 20, 2023
Merged

daemons: set CLI11 error exit code to 41 and bareos config parsing error exit code to 42#1515
BareosBot merged 10 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes

Conversation

@alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Aug 1, 2023

Description

When CLI11 exists on error, it produces a lot of different exit codes that are not always useful to us. Also configuration errors do not have a specific exit code.
This PR makes sure CLI11 error exit codes are overridden so that the daemons exit with a 41 code no matter what the type of error is, as they are all command line parsing errors anyway. On top of that configuration, parsing errors will report a 42 code on exit.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes branch 2 times, most recently from 190d721 to 48ed99d Compare August 2, 2023 10:56
@bruno-at-bareos bruno-at-bareos self-assigned this Aug 2, 2023
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

See below

@bruno-at-bareos bruno-at-bareos requested review from arogge and removed request for bruno-at-bareos August 10, 2023 09:56
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes branch from 48ed99d to 2db29de Compare August 10, 2023 11:54
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes branch from cc8feac to 6e27aa9 Compare August 16, 2023 13:52
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes branch from 6e27aa9 to a01fdc9 Compare September 8, 2023 11:34
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes branch from a01fdc9 to 3959187 Compare September 18, 2023 14:45
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes branch from 3959187 to 83fce6d Compare September 19, 2023 09:27
bruno-at-bareos and others added 6 commits September 20, 2023 08:47
- add After=local-fs.target
- place StartLimitBurst=10 in service part instead unit
- replace generic exit 1 by the specific configuration error
 exit code 42 and wrong command line parameter 41
- add comment about how to reset failed counter
- reformat debian filedaemon service file

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5517-s5506-parsing-exit-codes branch from 83fce6d to 7bdabc5 Compare September 20, 2023 06:48
@sebsura sebsura dismissed their stale review September 20, 2023 11:58

andreas already approved

@BareosBot BareosBot merged commit 3432b47 into bareos:master Sep 20, 2023
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.

5 participants