mandriva

Deployment error codes in Pulse 2

Nicolas Rueff

$Id$

Revision History
Revision 1.2.42009-08-28NR

Nothing new

Revision 1.2.32009-07-22NR

First version.

Abstract

The error codes used when deploying a package with Pulse 2.


1. Introduction

Starting with version 1.2.3, error codes ranges have been rationalized to reduce the risk of collision between error codes used by scripts and error codes used by Pulse 2 for internal purposes.

Let's take an example: a script "foobar" runs a single command on targets;

  • in case of success, the returned value is 0,

  • in case of failure, the returned value is 137.

pre-1.2.3, Pulse 2 was also using the error code 137 to know when a script has been terminated using SIGTERM, for example when running out of time.

In our example, if Pulse 2 was given 137 as error code, it could not know if it was because of the script failure, or because the script was killed.

Additionally, pre-1.2.3, the error code range used by the Pulse 2 check-client feature was not established.

2. The error code ranges, short story

Use 0 for success.

Use any of 1-199 for failure.

Do not use 200-255.

3. The error code ranges, long story

3.1. Success

For "historical reason", error code 0 has to be used only to represent a success. Do not use it to represent a failure !

0

Script succeeded

3.2. Failure

Range 1 to 199 is freely usable by script authors to represent a failure that occurred within the script. Do not use them to represent a success !

1 to 199

Script failed, return error code can be freely used by the script author.

3.3. Signal

Range 200 to 231 is internally used to represent that script ended upon signal reception. Do not use them !

200

Script was killed by a signal higher than 31 (SIGSYS), most probably a RT signal.

201

Script was killed by signal 1 (SIGHUP).

202

Script was killed by signal 2 (SIGINT).

203

Script was killed by signal 3 (SIGQUIT).

204

Script was killed by signal 4 (SIGILL).

205

Script was killed by signal 5 (SIGTRAP).

206

Script was killed by signal 6 (SIGABRT).

208

Script was killed by signal 8 (SIGFPE).

209

Script was killed by signal 9 (SIGKILL).

211

Script was killed by signal 11 (SIGSEGV).

212

Script was killed by signal 12 (SIGHUP).

213

Script was killed by signal 13 (SIGPIPE).

214

Script was killed by signal 14 (SIGALRM).

215

Script was killed by signal 15 (SIGTERM).

207, 210, 216-231

Script was killed by signal <error-code> minus 200 .

3.4. Reserved

Range 232 to 239 is kept for future internal use. Do not use them !

3.5. Pre-check

Range 240 to 254 indicates a pre-check error.

240

Something weird append while pre-checking.

241

Pre-check failed.

242-254

Reserved for future use.

3.6. Connection failed

For "historical reason", error code 255 is used to represent a connection failure. Do not use it !