fixing settings.insist ignore by default

This commit is contained in:
Axel Kittenberger 2012-09-07 18:00:52 +02:00
parent 6d4149acdc
commit b6fa608787
1 changed files with 40 additions and 7 deletions

View File

@ -52,21 +52,53 @@ default = {
log('Normal', 'Startup of "',agent.source,'" finished.') log('Normal', 'Startup of "',agent.source,'" finished.')
return 'ok' return 'ok'
elseif rc == 'again' then elseif rc == 'again' then
log('Normal', 'Retrying startup of "',agent.source,'".') if settings.insist then
return "again" log(
'Normal',
'Retrying startup of "',
agent.source,
'": ',
exitcode
)
return 'again'
else
log(
'Error',
'Temporary or permanent failure on startup of "',
agent.source,
'". Terminating since "insist" is not set.'
)
terminate(-1) -- ERRNO
end
elseif rc == 'die' then elseif rc == 'die' then
log('Error', 'Failure on startup of "',agent.source,'".') log(
'Error',
'Failure on startup of "',
agent.source,
'".'
)
terminate(-1) -- ERRNO terminate(-1) -- ERRNO
else else
log('Error', 'Unknown exitcode "',exitcode,'" on startup of "',agent.source,'".') log(
'Error',
'Unknown exitcode "',
exitcode,
'" on startup of "',
agent.source,
'".'
)
return 'die' return 'die'
end end
end end
if agent.isList then if agent.isList then
if rc == 'ok' then log('Normal', 'Finished a list = ',exitcode) if rc == 'ok' then
elseif rc == 'again' then log('Normal', 'Retrying a list on exitcode = ',exitcode) log('Normal', 'Finished a list = ',exitcode)
elseif rc == 'die' then log('Error', 'Failure with a list on exitcode = ',exitcode) elseif rc == 'again' then
log('Normal', 'Retrying a list on exitcode = ',exitcode)
elseif rc == 'die' then
log('Error', 'Failure with a list on exitcode = ',exitcode)
else else
log('Error', 'Unknown exitcode "',exitcode,'" with a list') log('Error', 'Unknown exitcode "',exitcode,'" with a list')
rc = 'die' rc = 'die'
@ -84,6 +116,7 @@ default = {
rc = 'die' rc = 'die'
end end
end end
return rc return rc
end, end,