View Issue Details

IDProjectCategoryView StatusLast Update
0001448bareos-corebconsolepublic2022-04-21 10:23
Reportermdc Assigned Tobruno-at-bareos  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionno change required 
Platformx86_64OSCentOSOS Versionstream 8
Product Version21.1.2 
Summary0001448: Return code in batch mode always 0
DescriptionWhen using the console in the batch mode, the return code is always 0 also when an error was occurs.
Steps To ReproduceWhen no error occurs :
echo "reload" | bconsole;echo $?
Connecting to Director localhost:9101
Encryption: TLS_AES_128_GCM_SHA256 TLSv1.3
1000 OK: Bareos Director Version: 21.1.2 (17 March 2022)
...
reload
reloaded
0

But when en error occurs, for example because of miss configuration, the return code is also 0.
echo "reload" | bconsole;echo $?
Connecting to Director localhost:9101
 Encryption: TLS_AES_128_GCM_SHA256 TLSv1.3
1000 OK: Bareos Director Version: 21.1.2 (17 March 2022)
...
reload
failed to reload
You have messages.
0

It will be better, when an command failed, that the return code will be something other the 0 to detect the error.
TagsNo tags attached.

Activities

bruno-at-bareos

bruno-at-bareos

2022-04-11 13:42

manager   ~0004567

Not an issue, the exit code can't be really anything else than 0, if bconsole doesn't failed.
if you want to test the configuration the -t for each daemon is there.

You can still propose a code improvement by following our developer guideline by sending a PR to github repository
bruno-at-bareos

bruno-at-bareos

2022-04-21 10:23

manager   ~0004574

The way the daemon exit is the "normal" behavior shared by all daemon. This will not be changed.

Issue History

Date Modified Username Field Change
2022-04-08 13:20 mdc New Issue
2022-04-11 13:42 bruno-at-bareos Note Added: 0004567
2022-04-21 10:23 bruno-at-bareos Assigned To => bruno-at-bareos
2022-04-21 10:23 bruno-at-bareos Status new => closed
2022-04-21 10:23 bruno-at-bareos Resolution open => no change required
2022-04-21 10:23 bruno-at-bareos Note Added: 0004574