Understanding Signals (128+n)
If an exit code is greater than 128, it often means the process was killed by a fatal signal. To find the signal number, subtract 128 from the exit code.
High Value Codes (>256)
Linux stores exit codes in 2-byte values. Bits 8-15 contain the actual code, while bits 0-6 represent the signal.
Bash Shell
5 entriesMisuse of Shell Builtins
Shell builtin used incorrectly or bad syntax.
Bash returns 2 for syntax errors or misuse of builtins.
- Fix syntax or quoting.
- Pass valid arguments to the builtin.
Command Invoked Cannot Execute
Command exists but cannot be executed.
Shell found the file but execution failed.
chmod +xthe file or use a valid binary.- Use the correct interpreter or rebuild for the platform.
Command Not Found
Shell cannot locate the command in PATH.
Returned by the shell when lookup fails.
- Install the command.
- Add its directory to PATH or use the full path.
Invalid Argument to Exit
Exit invoked with a non-integer status.
Shell expects an integer between 0 and 255.
- Ensure
exitreceives an integer 0-255.
Program Interrupted (SIGINT)
Process interrupted by Ctrl+C (SIGINT).
128 + SIGINT (2) = 130.
- Avoid sending SIGINT if you need graceful shutdown.
- Handle SIGINT to clean up before exit.
Standard / Unix
9 entriesSuccessful Termination
The command finished successfully.
Standard success for Unix-like processes.
- No action required unless the script logic is incorrect.
General Error
Generic failure when no specific exit code applies.
Catch-all error used by many programs.
- Correct inputs or environment and retry.
- Fix the underlying error reported by the tool.
No Such Device or Address
Invalid device, address, or host.
System call reported a bad device/address; some tools surface it as exit 6.
- Correct the target address.
- Ensure the device or host is reachable.
Program Abort (SIGABRT)
Process aborted itself (SIGABRT).
128 + SIGABRT (6) = 134.
- Fix the underlying bug or assertion.
- Update dependencies that triggered the abort.
Arithmetic Error (SIGFPE)
Erroneous arithmetic operation (SIGFPE).
128 + SIGFPE (8) = 136.
- Guard against invalid math.
- Fix overflow/underflow bugs.
Killed (SIGKILL)
Process killed by SIGKILL, often OOM.
128 + SIGKILL (9) = 137.
- Increase memory limits or reduce usage.
- Find memory leaks and cap resource usage.
Segmentation Fault (SIGSEGV)
Segmentation fault (SIGSEGV).
128 + SIGSEGV (11) = 139.
- Fix memory safety bugs.
- Update or roll back native dependencies.
Terminated (SIGTERM)
Process terminated by SIGTERM.
128 + SIGTERM (15) = 143.
- Handle SIGTERM for graceful shutdown.
- Increase stop timeout if cleanup needs more time.
Maximum Exit Code
Exit status 255, often used for fatal errors.
Exit status wraps to 255 or indicates fatal failure (e.g., SSH).
- Fix the underlying fatal error.
- Resolve SSH auth, DNS, or network issues.
GNU Coreutils
2 entriesCommand Timed Out
Command exceeded the time limit enforced by timeout.
Returned by GNU timeout when the child process times out.
- Increase timeout or optimize the command.
- Add retries or timeouts inside the process.
Command Failure
The timeout wrapper failed before running the command.
GNU timeout encountered an internal error.
- Fix the
timeoutinvocation. - Resolve system limits or permission issues.
Systemd Units
17 entriesEXIT_CHDIR
Changing to working directory failed.
Systemd could not enter WorkingDirectory=.
- Create the directory or update permissions.
EXIT_NICE
Setting scheduling priority failed.
Systemd could not apply Nice=.
- Use a valid nice level or adjust privileges.
EXIT_FDS
Failed to manage file descriptors.
Systemd could not close or set file descriptors.
- Raise FD limits or fix the service config.
EXIT_EXEC
Process execution failed.
execve() failed for the configured command.
- Fix the path/permissions or install the binary.
EXIT_MEMORY
Memory shortage.
Systemd could not allocate required memory.
- Increase memory or reduce service footprint.
EXIT_LIMITS
Failed to adjust resource limits.
Systemd could not apply Limit* settings.
- Use limits supported by the OS.
EXIT_OOM_ADJUST
Failed to adjust OOM setting.
Systemd could not apply OOMScoreAdjust=.
- Set a value between -1000 and 1000.
EXIT_STDIN
Failed to set up standard input.
StandardInput= is invalid or inaccessible.
- Fix input configuration or permissions.
EXIT_STDOUT
Failed to set up standard output.
StandardOutput= is invalid or inaccessible.
- Fix output configuration or permissions.
EXIT_CHROOT
Failed to change root directory.
RootDirectory= or RootImage= is invalid.
- Fix
RootDirectory=orRootImage=values.
EXIT_SETSCHEDULER
Failed to set up CPU scheduling.
Scheduling policy/priority is invalid or unsupported.
- Use supported scheduling values.
EXIT_GROUP
Failed to change group credentials.
Configured group or supplementary group is invalid.
- Create the group or fix
Group=settings.
EXIT_USER
Failed to change user credentials.
Configured user is invalid or missing.
- Create the user or fix
User=settings.
EXIT_NETWORK
Failed to set up network namespace.
PrivateNetwork= could not be configured.
- Disable
PrivateNetwork=or update the kernel.
EXIT_NAMESPACE
Failed to set up namespaces.
Namespace restrictions are invalid or conflicting.
- Fix conflicting paths or namespace config.
EXIT_NO_NEW_PRIVILEGES
Failed to disable new privileges.
Kernel does not support or rejects no_new_privs.
- Upgrade kernel or disable the setting.
EXIT_NUMA_POLICY
Failed to set NUMA policy.
NUMA policy or mask is invalid or unsupported.
- Use valid NUMA settings or disable them.
BSD Sysexits
15 entriesEX_USAGE
Command line usage error.
Wrong flags or argument structure.
- Correct the command syntax per documentation.
EX_DATAERR
Input data format error.
Data is malformed or incorrect.
- Fix the data source or regenerate valid input.
EX_NOINPUT
Cannot open input.
Input file is missing or unreadable.
- Provide the correct file path or permissions.
EX_NOUSER
Addressee unknown.
Specified user or address does not exist.
- Use a valid user or create the account.
EX_NOHOST
Host name unknown.
Host cannot be resolved.
- Fix the hostname or DNS settings.
EX_UNAVAILABLE
Service unavailable.
Required service or support program is missing.
- Start the service or install the missing dependency.
EX_SOFTWARE
Internal software error.
Application bug or unhandled exception.
- Fix the bug or update to a patched version.
EX_OSERR
System error.
Operating system failure (fork, pipe, etc.).
- Free resources or raise system limits.
EX_OSFILE
Critical OS file missing.
Essential system file is missing or unreadable.
- Restore the file or reinstall the package.
EX_CANTCREAT
Cannot create output.
Failed to create or write output file.
- Free disk space or adjust permissions.
EX_IOERR
Input/output error.
Physical I/O error during file operations.
- Repair storage or remount the filesystem.
EX_TEMPFAIL
Temporary failure.
Transient error; retry later.
- Add retry/backoff or wait for recovery.
EX_PROTOCOL
Remote protocol error.
Remote side sent invalid or unexpected protocol data.
- Upgrade/downgrade to compatible versions.
EX_NOPERM
Permission denied.
Insufficient privileges to perform the operation.
- Use the correct user or
sudowhen appropriate.
EX_CONFIG
Configuration error.
Configuration is invalid or incomplete.
- Fix configuration and restart the service.
Curl
4 entriesCould Not Resolve Host
Curl could not resolve the hostname.
DNS lookup failed for the given host.
- Fix the hostname or DNS settings.
- Use the correct domain or IP address.
Failed to Connect
Failed to connect to host or proxy.
Host resolved, but TCP connection could not be established.
- Open the port or start the service.
- Fix firewall, proxy, or routing issues.
Operation Timeout
The request timed out.
The operation exceeded --max-time or connection timeouts.
- Increase timeout values.
- Optimize the server or reduce response size.
SSL Connect Error
SSL/TLS handshake failed.
TLS negotiation failed, often due to protocol or cert issues.
- Use compatible TLS versions or ciphers.
- Fix CA trust or server certificates.
HTTP
3 entriesBad Request
Server cannot process the request.
Malformed syntax or invalid request data.
- Fix the request format and resend.
Not Found
Resource not found.
Server cannot find the requested path.
- Correct the URL or restore the resource.
Internal Server Error
Generic server-side error.
Server encountered an unexpected condition.
- Fix the underlying server bug and redeploy.