examples/unicorn@.service: note the NonBlocking flag
It's racy otherwise when starting simultaneous instanced units.
Without specifying NonBlocking=true, systemd will clear the
O_NONBLOCK flag every time it starts a new service instance.
There's a small window where systemd can clear O_NONBLOCK
immediately after it's set by Ruby (or kgio):
unicorn@1 |systemd |unicorn@2
---------------------------+----------------+--------------------
F_SETFL, O_NONBLOCK|O_RDWR | | (not running, yet)
|F_SETFL, O_RDWR |
|fork |
| exec unicorn@2 |
accept4(...) # blocks! | | (now started by systemd)
| |F_SETFL,O_NONBLOCK|O_RDWR
| |accept4(...) non-blocking