summaryrefslogtreecommitdiff
path: root/examples/syslogd
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2022-08-18 22:12:48 +0000
committerLaurent Bercot <ska@appnovation.com>2022-08-18 22:12:48 +0000
commit4c1373e6b4222e47f352247af397bcbcdae6cb59 (patch)
tree28242eb1ac6bd45890c1b11422e9e1972cccf338 /examples/syslogd
parentb653b531bab9cafc0a0137fbf373602132c7105b (diff)
downloads6-4c1373e6b4222e47f352247af397bcbcdae6cb59.tar.xz
Update syslogd example
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'examples/syslogd')
-rw-r--r--examples/syslogd/log/README10
-rw-r--r--examples/syslogd/log/env/LOGSCRIPT6
-rwxr-xr-xexamples/syslogd/log/run22
3 files changed, 20 insertions, 18 deletions
diff --git a/examples/syslogd/log/README b/examples/syslogd/log/README
index 9d4968e..eba7d19 100644
--- a/examples/syslogd/log/README
+++ b/examples/syslogd/log/README
@@ -1,9 +1,5 @@
This logger service logs everything the syslogd service receives
-into subdirectories of /var/log/syslogd/ logdir.
+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.
+ It emulates the default syslogd behaviour on a majority of Linux
+distributions.
diff --git a/examples/syslogd/log/env/LOGSCRIPT b/examples/syslogd/log/env/LOGSCRIPT
deleted file mode 100644
index 35ae234..0000000
--- a/examples/syslogd/log/env/LOGSCRIPT
+++ /dev/null
@@ -1,6 +0,0 @@
-- +^\\serror\\. t /var/log/syslogd/error
-- +^\\sauthpriv\\. t /var/log/syslogd/auth
-- +^\\suser\\. t /var/log/syslogd/user
-- +^\\smessages\\. t /var/log/syslogd/messages
-- +^\\sdaemon\\. t /var/log/syslogd/daemon
-f t /var/log/syslogd/misc
diff --git a/examples/syslogd/log/run b/examples/syslogd/log/run
index c066f37..36c7d87 100755
--- a/examples/syslogd/log/run
+++ b/examples/syslogd/log/run
@@ -1,8 +1,20 @@
-#!/bun/execlineb -P
+#!/bin/execlineb -P
s6-setuidgid syslog
-s6-envdir -f env
-importas -Cs LOGSCRIPT LOGSCRIPT
+multisubstitute
+{
+ define T t
+ define dir /var/log/syslogd
+}
exec -c
-s6-log -d3 -- $LOGSCRIPT
+s6-log -d3 --
-# Change env/LOGSCRIPT to alter s6-log's behaviour
+ - +^auth\\. +^authpriv\\. $T ${dir}/secure
+ - +^cron\\. $T ${dir}/cron
+ - +^daemon\\. $T ${dir}/daemon
+ - +^[[:alnum:]]*\\.debug: $T ${dir}/debug
+ - +^[[:alnum:]]*\\.err: +^[[:alnum:]]*\\.error: +^[[:alnum:]]*\\.emerg: +^[[:alnum:]]*\\.alert: +^[[:alnum:]]*\\.crit: $T ${dir}/errors
+ - +^kern\\. $T ${dir}/kernel
+ - +mail\\. $T ${dir}/mail
+ - +user\\. $T ${dir}/user
+ - +^[[:alnum:]]*\\.info: +^[[:alnum:]]*\\.notice: +^[[:alnum:]]*\\.warn: -^auth\\. -^authpriv\\. -^cron\\. -daemon\\. -mail\\. $T ${dir}/messages
+ + -^auth\\. -^authpriv\\. $T ${dir}/everything