diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-19 01:28:09 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-19 01:28:09 +0000 |
commit | df8c8876bc245c6124dd4691e5a95d8f397ca152 (patch) | |
tree | fcfec66704123b58c286aab83af16ab1b5248a21 /examples/ROOT/img/tmpfs/service/s6-svscan-log | |
parent | 90acd08f35f9691753fdd523c6970365b6ea4b73 (diff) | |
download | s6-df8c8876bc245c6124dd4691e5a95d8f397ca152.tar.xz |
Add examples/ subtree
Diffstat (limited to 'examples/ROOT/img/tmpfs/service/s6-svscan-log')
-rw-r--r-- | examples/ROOT/img/tmpfs/service/s6-svscan-log/README | 9 | ||||
-rwxr-xr-x | examples/ROOT/img/tmpfs/service/s6-svscan-log/run | 13 |
2 files changed, 22 insertions, 0 deletions
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. |