small medium large xlarge

Working with Unix Processes


Cover image for Working with Unix Processes

Working with Unix Processes


Take advantage of system programming techniques without toiling away in C. If you program for the web, you might be missing some fundamentals in the name of getting stuff working. Now you can fill that gap. In Working With Unix Processes, you’ll reuse decades of battle-tested, highly optimized, and proven techniques to put your system to work for you.

This work was written and produced entirely by the author. We are proud to be distributing it.

About this Title

Pages: 134
Published: 2012-05-23
Release: P1.3 (2013-08-07)
ISBN: pending

In Working With Unix Processes you’ll learn simple, powerful techniques that can help you write your own servers and debug your full stack when things go awry. The techniques and methods that give you primitives for concurrency, daemons, spawning processes, and signals transcend programming languages and have been used unchanged for decades. You can bet they’ll be relied upon for years to come.

The book takes an incremental approach. It begins with the very basics of Unix processes and system calls and builds all the way up to writing daemon processes and preforking servers. Once you’ve worked through the basics you’ll dive into two real-world projects, Unicorn and Resque, that make use of Unix processes.

This is not a book about Unix system administration or shell programming. This book covers the concepts and techniques that underlie tools like shells, servers, and daemons. It will help you understand the building blocks that these tools are built on.

What You Need:

The book assumes you’re running on a Unix-like operating system (Mac OS X, Linux, FreeBSD, etc. Pretty much anything besides Windows). Code samples in the book are written for Ruby 1.9.x and assume a working knowledge of Ruby.

Contents & Extracts

  • Introduction
  • Primer
  • Processes Have IDs
  • Processes Have Parents
  • Processes Have File Descriptors excerpt
  • Processes Have an Environment
  • Processes Have Arguments
  • Processes Have Names
  • Processes Have Exit Codes
  • Processes Can Fork
  • Orphaned Processes
  • Processes Are Friendly
  • Processes Can Wait
  • Zombie Processes
  • Processes Can Get Signals
  • Processes Can Communicate
  • Daemon Processes excerpt
  • Spawning Terminal Processes
  • Ending
  • Appendix: How Resque Manages Processes
  • Appendix: How Unicorn Reaps Worker Processes
  • Appendix: Preforking Servers
  • Appendix: Spyglass


My name is Jesse Storimer. I’m a programmer and a tinkerer. For the past four years I’ve been solving hard problems at Shopify, one of the largest, busiest Ruby on Rails sites on the web. My journey into the world of Unix programming started while working on web infrastructure and hasn’t slowed down yet. I live in rural Ontario, Canada with my wife and daughter. And, yes, I’m working on my Unix beard. I also write at