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

Error function is returning exit code 0 #1485

Closed
didacog opened this issue Sep 12, 2017 · 5 comments
Closed

Error function is returning exit code 0 #1485

didacog opened this issue Sep 12, 2017 · 5 comments

Comments

@didacog
Copy link
Contributor

didacog commented Sep 12, 2017

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • rear version (/usr/sbin/rear -V): 2.2
  • OS version (cat /etc/rear/os.conf or lsb_release -a): any
  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
  • Are you using legacy BIOS or UEFI boot? any
  • Brief description of the issue:
    Seems that since some changes in _input-output-functions.sh the Error function is returning exit code 0 and DRLM remote mkbackup execution cannot detect the error in the rear execution.
    When a backup fails DRLM cannot detect the error (previously >0) and hangs.
  • Work-around, if any: NOT yet
@didacog
Copy link
Contributor Author

didacog commented Sep 13, 2017

I'm on this and could be an issue with some rare OS environment settings.
Please do not take this issue yet, I will update it with my results.

Thanks!

@jsmeix
Copy link
Member

jsmeix commented Sep 13, 2017

@didacog FYI:
any return code of the Error function should be meaningless
for the exit code of the usr/sbin/rear program because the
Error function terminates the usr/sbin/rear program by
sending SIGUSR1 for which a trap exists that kills
the usr/sbin/rear program (via the default SIGTERM)
so that the exit code of the usr/sbin/rear program
is in this case always 143 which is 128+15
and 15 is the value of SIGTERM (see "man 7 signal").

You can verify this e.g. by adding to
usr/share/rear/init/default/030_update_recovery_system.sh
a very first line like

Error "testerror"

(I misuse 030_update_recovery_system.sh for such tests
because that is an 'init' script that is always and early run)
and then I get

# usr/sbin/rear -d -D mkrescue
Relax-and-Recover 2.2 / Git
Using log file: /root/rear.master/var/log/rear/rear-e205.log
ERROR: testerror
Aborting due to an error, check /root/rear.master/var/log/rear/rear-e205.log for details
Terminated

# echo $?
143

When I change the Error function to this

    ...
    kill -USR1 $MASTER_PID
    exit 99
}

it still terminates with exit-code 143.
See also
#1134
therein

... the already used bash exit codes:
...
128+n Fatal error signal "n"
e.g.  kill -9 $PPID of script   
      $? returns 137 (128 + 9)
...

@jsmeix
Copy link
Member

jsmeix commented Sep 19, 2017

@didacog
because "no news is good news" I just assume that with
#1485 (comment)
the issue is sufficiently answered so that I can close it.
If not you can of course reopen it.

@jsmeix jsmeix closed this as completed Sep 19, 2017
@didacog
Copy link
Contributor Author

didacog commented Sep 20, 2017

@jsmeix
Sorry for the late response and for not updating on the issue, I was figuring out what happened with this issue and solving some critical issues in a customer.
Somehow our testing environment VMs got corrupted and all VMs started to malfunction with strange environment issues during tests.
We've re-deployed a new environment for testing and all seems is working fine now.

Thanks for updating and closing this issue.

Regards,
Didac

@jsmeix
Copy link
Member

jsmeix commented Sep 20, 2017

@didacog
many thanks for the information what the actual cause was.
It helps (at least me) a lot to have an explicit confirmation
when there was no (possibly obscure) issue in ReaR.

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

No branches or pull requests

2 participants