From df8c8876bc245c6124dd4691e5a95d8f397ca152 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 19 Dec 2014 01:28:09 +0000 Subject: Add examples/ subtree --- examples/ROOT/img/tmpfs/README | 7 +++++++ examples/ROOT/img/tmpfs/dev/README | 4 ++++ examples/ROOT/img/tmpfs/dev/pts/README | 2 ++ examples/ROOT/img/tmpfs/dev/shm | 1 + examples/ROOT/img/tmpfs/service/.s6-svscan/README | 2 ++ examples/ROOT/img/tmpfs/service/.s6-svscan/crash | 1 + examples/ROOT/img/tmpfs/service/.s6-svscan/finish | 1 + examples/ROOT/img/tmpfs/service/README | 5 +++++ examples/ROOT/img/tmpfs/service/getty/README | 2 ++ examples/ROOT/img/tmpfs/service/getty/run | 2 ++ examples/ROOT/img/tmpfs/service/s6-svscan-log/README | 9 +++++++++ examples/ROOT/img/tmpfs/service/s6-svscan-log/run | 13 +++++++++++++ examples/ROOT/img/tmpfs/shm/README | 3 +++ examples/ROOT/img/tmpfs/tmp/README | 4 ++++ examples/ROOT/img/tmpfs/tmp/uncaught-logs/README | 4 ++++ 15 files changed, 60 insertions(+) create mode 100644 examples/ROOT/img/tmpfs/README create mode 100644 examples/ROOT/img/tmpfs/dev/README create mode 100644 examples/ROOT/img/tmpfs/dev/pts/README create mode 120000 examples/ROOT/img/tmpfs/dev/shm create mode 100644 examples/ROOT/img/tmpfs/service/.s6-svscan/README create mode 120000 examples/ROOT/img/tmpfs/service/.s6-svscan/crash create mode 120000 examples/ROOT/img/tmpfs/service/.s6-svscan/finish create mode 100644 examples/ROOT/img/tmpfs/service/README create mode 100644 examples/ROOT/img/tmpfs/service/getty/README create mode 100755 examples/ROOT/img/tmpfs/service/getty/run create mode 100644 examples/ROOT/img/tmpfs/service/s6-svscan-log/README create mode 100755 examples/ROOT/img/tmpfs/service/s6-svscan-log/run create mode 100644 examples/ROOT/img/tmpfs/shm/README create mode 100644 examples/ROOT/img/tmpfs/tmp/README create mode 100644 examples/ROOT/img/tmpfs/tmp/uncaught-logs/README (limited to 'examples/ROOT/img/tmpfs') diff --git a/examples/ROOT/img/tmpfs/README b/examples/ROOT/img/tmpfs/README new file mode 100644 index 0000000..3b329e4 --- /dev/null +++ b/examples/ROOT/img/tmpfs/README @@ -0,0 +1,7 @@ +/img/tmpfs is the hierarchy that will be copied to /mnt/tmpfs +during stage 1 init, so the basics are covered for stage 2: + - /dev points to a real, writable device directory + - /tmp points to a real, writable temporary directory + - /service points to a real, writable scan directory that +already contains basic services (s6-svscan's own logger and +an early getty). diff --git a/examples/ROOT/img/tmpfs/dev/README b/examples/ROOT/img/tmpfs/dev/README new file mode 100644 index 0000000..8b944ff --- /dev/null +++ b/examples/ROOT/img/tmpfs/dev/README @@ -0,0 +1,4 @@ +This directory is the /dev image. +It should contain all your static devices. +It MUST contain at least /dev/null and /dev/console, +else the system will crash during stage 1 init. diff --git a/examples/ROOT/img/tmpfs/dev/pts/README b/examples/ROOT/img/tmpfs/dev/pts/README new file mode 100644 index 0000000..e0553f0 --- /dev/null +++ b/examples/ROOT/img/tmpfs/dev/pts/README @@ -0,0 +1,2 @@ +The place (after it's copied to the tmpfs) where +the virtual devpts filesystem will be mounted. diff --git a/examples/ROOT/img/tmpfs/dev/shm b/examples/ROOT/img/tmpfs/dev/shm new file mode 120000 index 0000000..c71cdc8 --- /dev/null +++ b/examples/ROOT/img/tmpfs/dev/shm @@ -0,0 +1 @@ +../shm \ No newline at end of file diff --git a/examples/ROOT/img/tmpfs/service/.s6-svscan/README b/examples/ROOT/img/tmpfs/service/.s6-svscan/README new file mode 100644 index 0000000..6500cc6 --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/.s6-svscan/README @@ -0,0 +1,2 @@ +This is the image of the control directory of the s6-svscan process. +Notice how the symlinks point to ever-existing scripts. diff --git a/examples/ROOT/img/tmpfs/service/.s6-svscan/crash b/examples/ROOT/img/tmpfs/service/.s6-svscan/crash new file mode 120000 index 0000000..262c196 --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/.s6-svscan/crash @@ -0,0 +1 @@ +/etc/s6-init/crash \ No newline at end of file diff --git a/examples/ROOT/img/tmpfs/service/.s6-svscan/finish b/examples/ROOT/img/tmpfs/service/.s6-svscan/finish new file mode 120000 index 0000000..feb771e --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/.s6-svscan/finish @@ -0,0 +1 @@ +/etc/s6-init/init-stage3 \ No newline at end of file diff --git a/examples/ROOT/img/tmpfs/service/README b/examples/ROOT/img/tmpfs/service/README new file mode 100644 index 0000000..dab0447 --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/README @@ -0,0 +1,5 @@ +This is the initial image of the scan directory. +When init executes into s6-svscan, s6-svscan will immediately +start the "s6-svscan-log" service, which logs s6-svscan's own +output, and the "getty1" service, which spawns a getty on +tty1 as early as possible, in case debugging is needed. diff --git a/examples/ROOT/img/tmpfs/service/getty/README b/examples/ROOT/img/tmpfs/service/getty/README new file mode 100644 index 0000000..efb079b --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/getty/README @@ -0,0 +1,2 @@ +This service is started very early, to make sure a tty exists as soon +as s6-svscan is run, so early debugging is possible. diff --git a/examples/ROOT/img/tmpfs/service/getty/run b/examples/ROOT/img/tmpfs/service/getty/run new file mode 100755 index 0000000..3240ffd --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/getty/run @@ -0,0 +1,2 @@ +#!/command/execlineb -P +getty -L -H DEBUG 38400 tty1 diff --git a/examples/ROOT/img/tmpfs/service/s6-svscan-log/README b/examples/ROOT/img/tmpfs/service/s6-svscan-log/README new file mode 100644 index 0000000..282d4f0 --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/s6-svscan-log/README @@ -0,0 +1,9 @@ +This service reads from the "fifo" named pipe and logs +what it reads to the /tmp/uncaught-logs log directory. +The whole supervision tree has its stderr redirected to "fifo", +as well as services that do not have their own logger. +So, /tmp/uncaught-logs is the catch-all logger: logs that aren't +caught anywhere else end up there. + + You should create the "fifo" named pipe in this directory, +belonging to nobody:nogroup with rights 0622. diff --git a/examples/ROOT/img/tmpfs/service/s6-svscan-log/run b/examples/ROOT/img/tmpfs/service/s6-svscan-log/run new file mode 100755 index 0000000..a55a822 --- /dev/null +++ b/examples/ROOT/img/tmpfs/service/s6-svscan-log/run @@ -0,0 +1,13 @@ +#!/command/execlineb -P +redirfd -w 2 /dev/console +redirfd -rnb 0 fifo +s6-setuidgid nobody +exec -c +s6-log -bpt /tmp/uncaught-logs + +# The -p option is important: +# even if s6-svscan is told to kill everything, +# you do not want this logger to die. +# The -b option ensures s6-log processes lines one +# at a time, so it doesn't eat up too much memory +# in case of a problem spike. diff --git a/examples/ROOT/img/tmpfs/shm/README b/examples/ROOT/img/tmpfs/shm/README new file mode 100644 index 0000000..7ef7853 --- /dev/null +++ b/examples/ROOT/img/tmpfs/shm/README @@ -0,0 +1,3 @@ +This directory exists so /dev/shm points to a place +in the tmpfs. +It should have "1777" rights. diff --git a/examples/ROOT/img/tmpfs/tmp/README b/examples/ROOT/img/tmpfs/tmp/README new file mode 100644 index 0000000..1e437a0 --- /dev/null +++ b/examples/ROOT/img/tmpfs/tmp/README @@ -0,0 +1,4 @@ +This directory contains what will be /mnt/tmpfs/tmp after +stage 1 init, so it contains everything /tmp should point +to. +It should have "1777" rights. diff --git a/examples/ROOT/img/tmpfs/tmp/uncaught-logs/README b/examples/ROOT/img/tmpfs/tmp/uncaught-logs/README new file mode 100644 index 0000000..c13d539 --- /dev/null +++ b/examples/ROOT/img/tmpfs/tmp/uncaught-logs/README @@ -0,0 +1,4 @@ +This directory should not belong to root, but to nobody:nogroup; +it should also have "2700" rights. +It is the catch-all logdir. +/tmp/uncaught-logs/current will be the current catch-all log file. -- cgit v1.2.3