dot

packages and services management
Log | Files | Refs | README

commit 45e86d1960b0ee9f57ede0cf03e2e685aac24ef4
parent 2c790aa463d7ed118425d4ad452252aa59bcad0f
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon, 26 Nov 2018 00:05:11 +0100

custom logger

Diffstat:
Mbin/service-build | 6++++--
Mbin/service-disable | 1+
As6/pjsua/client/run | 1+
As6/pjsua/log/env/SERVICE | 0
As6/pjsua/log/run | 6++++++
As6/pjsua/log/type | 1+
As6/pjsua/x/run | 3+++
As6/pjsua/x/setup | 15+++++++++++++++
As6/pjsua/x/type | 1+
Ms6/vsftpd/x/setup | 14+++++++++++---
10 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/bin/service-build b/bin/service-build @@ -14,7 +14,7 @@ redirfd -r 0 /etc/s6/${base}/x/type withstdinas x importas -n type x -if { cd /etc/s6/${base} fdclose 1 ls x ${mod} } +if { cd /etc/s6/${base} redirfd -w 1 /dev/null ls x ${mod} } backtick -n x { if -t { test $type = longrun } echo ,x } importas ext x @@ -34,7 +34,9 @@ if { if -t { test $type = bundle } } if { if -t { test $type = longrun } - if { s6-hiercopy /etc/s6/.s6-rc/service-log ${sv},log } + ifthenelse { test -d /etc/s6/${sv}/log } + { s6-hiercopy /etc/s6/${sv}/log ${sv},log } + { s6-hiercopy /etc/s6/.s6-rc/service-log ${sv},log } if { redirfd -a 1 ${sv},x/producer-for echo ${sv},log } if { redirfd -w 1 ${sv},log/consumer-for echo ${sv},x } if { redirfd -w 1 ${sv},log/env/SERVICE echo ${sv} } diff --git a/bin/service-disable b/bin/service-disable @@ -1,5 +1,6 @@ #!/usr/bin/env execlineb cd /var/s6 +elgetpositionals -P 1 if { rm -rf ${@} ${@},x ${@},log } diff --git a/s6/pjsua/client/run b/s6/pjsua/client/run @@ -0,0 +1 @@ +#!/usr/bin/execlineb diff --git a/s6/pjsua/log/env/SERVICE b/s6/pjsua/log/env/SERVICE diff --git a/s6/pjsua/log/run b/s6/pjsua/log/run @@ -0,0 +1,6 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 s6-envdir env multisubstitute { + importas SERVICE SERVICE +} + +s6-log -bp -- /var/log/$SERVICE diff --git a/s6/pjsua/log/type b/s6/pjsua/log/type @@ -0,0 +1 @@ +longrun diff --git a/s6/pjsua/x/run b/s6/pjsua/x/run @@ -0,0 +1,3 @@ +#!/usr/bin/env execlineb + +pjsua --config-file data/conf diff --git a/s6/pjsua/x/setup b/s6/pjsua/x/setup @@ -0,0 +1,15 @@ +#!/usr/bin/env execlineb + +if { mkdir -p data } +if { mkfifo data/fifo } +redirfd -w 1 data/conf +cd conf + +forbacktickx x { ls } +importas var x + +redirfd -r 0 +withstdinas x +importas x x + +printf "--%s %s\n" $var $x diff --git a/s6/pjsua/x/type b/s6/pjsua/x/type @@ -0,0 +1 @@ +longrun diff --git a/s6/vsftpd/x/setup b/s6/vsftpd/x/setup @@ -1,6 +1,14 @@ #!/usr/bin/env execlineb if { mkdir -p data } -redirfd -w 1 data/conf cd conf -forbacktickx x { ls } importas x x -if { printf "%s=" $x } cat $x + +redirfd -w 1 data/conf +cd conf + +forbacktickx x { ls } +importas var x + +redirfd -r 0 $var withstdinas x +importas -n x x + +printf "%s=%s\n" $var $x