|
@@ -45,7 +45,7 @@ try:
|
|
from .compress import CompressionSpec
|
|
from .compress import CompressionSpec
|
|
from .crypto.key import key_creator, key_argument_names, tam_required_file, tam_required, RepoKey, PassphraseKey
|
|
from .crypto.key import key_creator, key_argument_names, tam_required_file, tam_required, RepoKey, PassphraseKey
|
|
from .crypto.keymanager import KeyManager
|
|
from .crypto.keymanager import KeyManager
|
|
- from .helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR
|
|
|
|
|
|
+ from .helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR, EXIT_SIGNAL_BASE
|
|
from .helpers import Error, NoManifestError, set_ec
|
|
from .helpers import Error, NoManifestError, set_ec
|
|
from .helpers import positive_int_validator, location_validator, archivename_validator, ChunkerParams, Location
|
|
from .helpers import positive_int_validator, location_validator, archivename_validator, ChunkerParams, Location
|
|
from .helpers import PrefixSpec, GlobSpec, CommentSpec, SortBySpec, HUMAN_SORT_KEYS, FilesCacheMode
|
|
from .helpers import PrefixSpec, GlobSpec, CommentSpec, SortBySpec, HUMAN_SORT_KEYS, FilesCacheMode
|
|
@@ -4591,17 +4591,17 @@ def main(): # pragma: no cover
|
|
msg = 'Keyboard interrupt'
|
|
msg = 'Keyboard interrupt'
|
|
tb_log_level = logging.DEBUG
|
|
tb_log_level = logging.DEBUG
|
|
tb = '%s\n%s' % (traceback.format_exc(), sysinfo())
|
|
tb = '%s\n%s' % (traceback.format_exc(), sysinfo())
|
|
- exit_code = EXIT_ERROR
|
|
|
|
|
|
+ exit_code = EXIT_SIGNAL_BASE + 2
|
|
except SigTerm:
|
|
except SigTerm:
|
|
msg = 'Received SIGTERM'
|
|
msg = 'Received SIGTERM'
|
|
msgid = 'Signal.SIGTERM'
|
|
msgid = 'Signal.SIGTERM'
|
|
tb_log_level = logging.DEBUG
|
|
tb_log_level = logging.DEBUG
|
|
tb = '%s\n%s' % (traceback.format_exc(), sysinfo())
|
|
tb = '%s\n%s' % (traceback.format_exc(), sysinfo())
|
|
- exit_code = EXIT_ERROR
|
|
|
|
|
|
+ exit_code = EXIT_SIGNAL_BASE + 15
|
|
except SigHup:
|
|
except SigHup:
|
|
msg = 'Received SIGHUP.'
|
|
msg = 'Received SIGHUP.'
|
|
msgid = 'Signal.SIGHUP'
|
|
msgid = 'Signal.SIGHUP'
|
|
- exit_code = EXIT_ERROR
|
|
|
|
|
|
+ exit_code = EXIT_SIGNAL_BASE + 1
|
|
if msg:
|
|
if msg:
|
|
logger.error(msg, msgid=msgid)
|
|
logger.error(msg, msgid=msgid)
|
|
if tb:
|
|
if tb:
|
|
@@ -4615,6 +4615,8 @@ def main(): # pragma: no cover
|
|
rc_logger.warning(exit_msg % ('warning', exit_code))
|
|
rc_logger.warning(exit_msg % ('warning', exit_code))
|
|
elif exit_code == EXIT_ERROR:
|
|
elif exit_code == EXIT_ERROR:
|
|
rc_logger.error(exit_msg % ('error', exit_code))
|
|
rc_logger.error(exit_msg % ('error', exit_code))
|
|
|
|
+ elif exit_code >= EXIT_SIGNAL_BASE:
|
|
|
|
+ rc_logger.error(exit_msg % ('signal', exit_code))
|
|
else:
|
|
else:
|
|
rc_logger.error(exit_msg % ('abnormal', exit_code or 666))
|
|
rc_logger.error(exit_msg % ('abnormal', exit_code or 666))
|
|
sys.exit(exit_code)
|
|
sys.exit(exit_code)
|