Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add diagrams of typical io plumbing #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions README.plumbing
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@

svscanboot

..................
: svscanboot :
: :
null---> out>---null
: err>---null
:................:


===============================================================================

svscan

mkdir -p /service /svc0
cat <<EOF > /svc0/run
#!/bin/sh
exec /bin/sleep 9999
EOF
ln -s /svc0 /service/svc0
svscanboot &

................. .....................
: svscan : : readproctitle :
: : : :
null--->in out>--*---*------>in out>---null
: err>--' | : err>---null
:...............: | :...................:
|
................. |
: supervise : |
: : |
null--->in out>--*---*
: err>--' |
:...............: |
|
................. |
: main : |
: process : |
: : |
null--->in out>--*---'
: err>--'
:...............:


===============================================================================

svscan log management

mkdir -p /service /svc1 /svc1/log
cat <<EOF > /svc1/run
#!/bin/sh
exec /bin/sleep 9999
EOF
cat <<EOF > /svc1/log/run
#!/bin/sh
exec /bin/sleep 9999
EOF
ln -s /svc1 /service/svc1
svscanboot &

.............. .....................
: svscan : : readproctitle :
: : : :
null--->in out>--*-----------*---->in out>---null
: err>--' | : err>---null
.--->copy copy>-----. | :...................:
| :............: | |
`----------------------* *---------------------------.
| | |
................. | | ................. |
: supervise : | | : supervise : |
: : | | : : |
null--->in out>---*--------)---->in out>--*---*
: err>---)--------* : err>--' |
:...............: | | :...............: |
| | |
................. | | ................. |
: main : | | : log : |
: process : | | : process : |
: : | | : : |
null--->in out>---*--------)---->in out>--*---'
: err>------------' : err>--'
:...............: :...............:


===============================================================================

supervise log management

mkdir -p /service /svc2
cat <<EOF > /svc2/run
#!/bin/sh
exec /bin/sleep 9999
EOF
cat <<EOF > /svc2/log
#!/bin/sh
exec /bin/sleep 9999
EOF
ln -s /svc2 /service/svc2
svscanboot &

.............. .....................
: svscan : : readproctitle :
: : : :
null--->in out>---*----------*---->in out>---null
: err>---' | : err>---null
:............: | :...................:
|
................. |
: supervise : |
: : |
null--->in out>---*--------*-----------------------.
: err>---' | |
.--->copy copy>---. | |
| :...............: | | |
`-----------------------* | |
| | |
............... | | ............... |
: main : | | : log : |
: process : | | : process : |
: : | | : : |
null--->in out>----*--------)----->in out>---*
: err>-------------' : err>---'
:.............: :.............:


===============================================================================

combination svscan and supervise log management

mkdir -p /service /svc3 /svc3/log
cat <<EOF > /svc3/run
#!/bin/sh
exec /bin/sleep 9999
EOF
cat <<EOF > /svc3/log/run
#!/bin/sh
exec /bin/sleep 9999
EOF
cat <<EOF > /svc3/log/log
#!/bin/sh
exec /bin/sleep 9999
EOF
ln -s /svc3 /service/svc3
svscanboot &

.............. .....................
: svscan : : readproctitle :
: : : :
null--->in out>-----*----*------->in out>---null
: err>-----' | : err>---null
.--->copy copy>-----. | :...................:
| :............: | |
`----------------------* *---------------------------------.
| | |
................. | | ................. |
: supervise : | | : supervise : |
: : | | : : |
null--->in out>---*----)--------->in out>---*---*
: err>---)----* : err>---' |
:...............: | | .---->copy copy>---. |
| | | :...............: | |
| | *------------------------* |
| | | | |
............... | | | ................ | |
: main : | | | : log main : | |
: process : | | | : : | |
: : | | | : : | |
null--->in out>----*----)----)---->in out>----' |
: err>---------' | : err>--------*
:.............: | :..............: |
| |
| ............... |
| : log log : |
| : : |
`---->in out>-----*---'
: err>-----'
:.............: