diff options
Diffstat (limited to 'examples/syslogd-linux')
-rw-r--r-- | examples/syslogd-linux/README | 9 | ||||
-rw-r--r-- | examples/syslogd-linux/log/README | 9 | ||||
-rw-r--r-- | examples/syslogd-linux/log/env/LOGSCRIPT | 6 | ||||
-rwxr-xr-x | examples/syslogd-linux/log/run | 8 | ||||
-rw-r--r-- | examples/syslogd-linux/notification-fd | 1 | ||||
-rwxr-xr-x | examples/syslogd-linux/run | 8 |
6 files changed, 41 insertions, 0 deletions
diff --git a/examples/syslogd-linux/README b/examples/syslogd-linux/README new file mode 100644 index 0000000..675715b --- /dev/null +++ b/examples/syslogd-linux/README @@ -0,0 +1,9 @@ +This is an example of a service directory for process supervision by s6. + +This syslogd emulation works on any Unix where syslog() is +implemented via a connection on the /dev/log Unix-domain socket. +It needs a Unix superserver (see s6-networking, ucspi-unix or +ucspi-ipc) and ucspilogd. +A ucspilogd process is spawned for every syslog() client. It +processes logs and sends them to stderr, i.e. the service's +logger. diff --git a/examples/syslogd-linux/log/README b/examples/syslogd-linux/log/README new file mode 100644 index 0000000..9d4968e --- /dev/null +++ b/examples/syslogd-linux/log/README @@ -0,0 +1,9 @@ + This logger service logs everything the syslogd service receives +into subdirectories of /var/log/syslogd/ logdir. + + The script provided in env/LOGSCRIPT emulates the default +syslogd behaviour on a majority of Linux distributions. + + Note that spaces cannot be used as is in the LOGSCRIPT file, +because they are delimiters for the splitting of $LOGSCRIPT +in the run script. So \s is used instead. diff --git a/examples/syslogd-linux/log/env/LOGSCRIPT b/examples/syslogd-linux/log/env/LOGSCRIPT new file mode 100644 index 0000000..e7a1eb7 --- /dev/null +++ b/examples/syslogd-linux/log/env/LOGSCRIPT @@ -0,0 +1,6 @@ +- +^[0-9]+:\s[0-9]+:\serror\. t /var/log/syslogd/error +- +^[0-9]+:\s[0-9]+:\sauthpriv\. t /var/log/syslogd/auth +- +^[0-9]+:\s[0-9]+:\suser\. t /var/log/syslogd/user +- +^[0-9]+:\s[0-9]+:\smessages\. t /var/log/syslogd/messages +- +^[0-9]+:\s[0-9]+:\sdaemon\. t /var/log/syslogd/daemon +f t /var/log/syslogd/misc diff --git a/examples/syslogd-linux/log/run b/examples/syslogd-linux/log/run new file mode 100755 index 0000000..56de271 --- /dev/null +++ b/examples/syslogd-linux/log/run @@ -0,0 +1,8 @@ +#!/command/execlineb -P +s6-setuidgid syslog +s6-envdir -f env +import -Cs LOGSCRIPT +exec -c +s6-log $LOGSCRIPT + +# Change env/LOGSCRIPT to alter s6-log's behaviour diff --git a/examples/syslogd-linux/notification-fd b/examples/syslogd-linux/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/examples/syslogd-linux/notification-fd @@ -0,0 +1 @@ +3 diff --git a/examples/syslogd-linux/run b/examples/syslogd-linux/run new file mode 100755 index 0000000..de33c2c --- /dev/null +++ b/examples/syslogd-linux/run @@ -0,0 +1,8 @@ +#!/command/execlineb -P +fdmove -c 2 1 +exec -c +s6-envuidgid nobody +fdmove 1 3 +s6-ipcserver -U -1 -- /dev/log +fdmove -c 1 2 +ucspilogd IPCREMOTEEUID IPCREMOTEEGID |