Skip to content

RustSystemsAcademy/rust-signals-book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Signals — Handling OS Signals in Rust

This repo is under active development please come back soon.

This repository contains the source of an mdBook dedicated to learning operating system signals through Rust, one signal per chapter.

📚 Goals of the book:

  • Explain what each POSIX/Linux signal actually means
  • Show when and why it is delivered by the OS
  • Provide practical Rust examples (blocking + Tokio async)
  • Explain Windows equivalents (or lack thereof)
  • Teach daemon/service patterns like graceful shutdown and reload
  • Give exercises to practice in real development environments

Project Structure

rust-signals-book/
├─ README.md
├─ book.toml
├─ src/
│  ├─ SUMMARY.md
│  ├─ 01-intro.md
│  ├─ 02-platforms.md
│  ├─ 03-rust-overview.md
│  ├─ 04-sigint.md
│  ├─ 05-sigterm.md
│  ├─ 06-sigkill.md
│  ├─ 07-sigquit.md
│  ├─ 08-sighup.md
│  ├─ 09-sigusr1.md
│  ├─ 10-sigusr2.md
│  ├─ 11-sigstop.md
│  ├─ 12-sigtstp.md
│  ├─ 13-sigcont.md
│  ├─ 14-sigttin.md
│  ├─ 15-sigttou.md
│  ├─ 16-sigsegv.md
│  ├─ 17-sigbus.md
│  ├─ 18-sigfpe.md
│  ├─ 19-sigill.md
│  ├─ 20-sigabrt.md
│  ├─ 21-sigtrap.md
│  ├─ 22-sigsys.md
│  ├─ 23-sigalrm.md
│  ├─ 24-sigvtalrm.md
│  ├─ 25-sigprof.md
│  ├─ 26-sigxcpu.md
│  ├─ 27-sigxfsz.md
│  ├─ 28-sigpipe.md
│  ├─ 29-sigio.md
│  ├─ 30-sigurg.md
│  ├─ 31-sigpwr.md
│  ├─ 32-sigstkflt.md
│  ├─ 33-realtime-signals.md
│  ├─ appendix-exercises.md
│  └─ appendix-cheatsheet.md
└─ examples/
   ├─ ctrlc-sync/
   └─ ctrlc-tokio/

examples/ contains runnable Rust programs demonstrating concepts.

Build / View the Book Locally

Install mdBook:

cargo install mdbook

Serve locally:

mdbook serve --open

Platform Notes

The book explains both:

  • POSIX / Linux signals 8 Windows console control events (CTRL_C_EVENT, CTRL_SHUTDOWN_EVENT) Rust examples are written to run cross-platform when possible.

Contributing

PRs welcome — especially:

  • Expanding chapters
  • Adding additional runnable examples
  • Improving platform accuracy for macOS / BSD / Windows

License

MIT (See LICENSE)

About

Rust Signals - Handling OS Signals in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors