Docs / Linux Basics / Understanding Linux Signals and Process Control

Understanding Linux Signals and Process Control

By Admin · Mar 1, 2026 · Updated Apr 24, 2026 · 29 views · 2 min read

What Are Signals?

Signals are software interrupts sent to processes in Linux to notify them of events. They are a fundamental mechanism for process control, allowing you to terminate, pause, resume, or request graceful shutdowns of programs running on your Breeze.

Common Signals

  • SIGTERM (15) -- requests graceful termination; the default signal sent by kill
  • SIGKILL (9) -- forces immediate termination; cannot be caught or ignored
  • SIGHUP (1) -- hangup signal; often used to reload configuration
  • SIGINT (2) -- interrupt from keyboard (Ctrl+C)
  • SIGSTOP (19) -- pauses a process; cannot be caught
  • SIGCONT (18) -- resumes a paused process
  • SIGUSR1/SIGUSR2 (10/12) -- user-defined signals for custom behavior

Sending Signals

# Send SIGTERM (default, graceful shutdown)
kill 1234

# Send SIGKILL (force kill)
kill -9 1234

# Send SIGHUP (reload config)
kill -HUP 1234

# Send signal by name
kill -SIGTERM 1234

# Kill all processes by name
killall nginx
pkill -f "python app.py"

Process States

View process states with ps:

ps aux | head -20

# States: R (running), S (sleeping), T (stopped), Z (zombie), D (uninterruptible)

Job Control

# Run in background
./long-task.sh &

# List background jobs
jobs

# Bring job to foreground
fg %1

# Send running process to background
# Press Ctrl+Z first (sends SIGTSTP), then:
bg %1

Practical Tips

  • Always try SIGTERM before SIGKILL to allow graceful cleanup
  • Use SIGHUP to reload Nginx or Apache without downtime
  • Zombie processes indicate the parent is not collecting exit codes -- restart the parent

Was this article helpful?