dot

packages and services management
Log | Files | Refs | README

commit a7aef80c559be4d7dd3d671d13ce18d69e47505b
parent 5ad605870044fcaab187382f356d3b9eb20d0d32
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 25 Nov 2018 00:01:01 +0100

bin/service-build: fix bundles handling

Diffstat:
Mbin/service-build | 23++++++++++++++---------
Mbin/service-status | 4++--
As6/host/glaphyrae/contents | 13+++++++++++++
As6/host/x/type | 1+
As6/ii/irc.epitech.eu/env/HOST | 1+
As6/ii/irc.epitech.eu/env/NAME | 0
As6/ii/irc.epitech.eu/env/NICK | 1+
As6/ii/irc.epitech.eu/env/PASS | 0
As6/ii/irc.epitech.eu/env/USER | 1+
Ms6/qmail-smtpd/tcp/run | 4++--
Ms6/qmail-smtpd/tls/run | 4++--
11 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/bin/service-build b/bin/service-build @@ -3,20 +3,14 @@ if { mkdir -p /var/s6 } cd /var/s6 forbacktickx -0 x { dollarat -0 } importas s x backtick -n x { heredoc 0 $s cut -d , -f 1 } importas base x - -ifelse { grep -qFx bundle /etc/s6/${base}/x/type } { - if { s6-hiercopy /etc/s6/ } - forbacktickx -n -d "\n" x { sed "s/^#.*//; /^[ \t]*$/ d" } importas x x - $0 $x -} - backtick -n x { heredoc 0 $s cut -s -d , -f 2- } importas -s -d , mod x if { forx -o 0 x { x $mod } importas x x test -d /etc/s6/${base}/${x} } if { rm -rf ${s} ${s},x } -if { forx -o 0 x { x $mod } importas x x s6-hiercopy /etc/s6/${base}/${x} ${s},x } ifelse { grep -qFx longrun /etc/s6/${base}/x/type } { + if { forx -o 0 x { x $mod } importas x x s6-hiercopy /etc/s6/${base}/${x} ${s},x } + if { s6-hiercopy /etc/s6/.s6-rc/service-log ${s},log } if { redirfd -a 1 ${s},x/producer-for echo ${s},log } if { redirfd -w 1 ${s},log/consumer-for echo ${s},x } @@ -26,4 +20,15 @@ ifelse { grep -qFx longrun /etc/s6/${base}/x/type } { cd ${s},x if -t { test -e setup } ./setup } -cd ${s} if -t { test -e setup } ./setup +ifelse { grep -qFx bundle /etc/s6/${base}/x/type } { + if { forx -o 0 x { x $mod } importas x x s6-hiercopy /etc/s6/${base}/${x} ${s} } + + forbacktickx -n -d "\n" x { sed "s/^#.*//; /^[ \t]*$/ d" ${s}/contents } importas x x + service-build $x +} + +ifelse { grep -qFx oneshot /etc/s6/${base}/x/type } { + if { forx -o 0 x { x $mod } importas x x s6-hiercopy /etc/s6/${base}/${x} ${s} } + + cd ${s},x if -t { test -e setup } ./setup +} diff --git a/bin/service-status b/bin/service-status @@ -1,10 +1,10 @@ #!/usr/bin/env execlineb elgetpositionals -P 1 -backtick x { +forbacktickx x { pipeline { s6-rc -l /var/s6/.s6-rc/live list $@ } sed -n "s/,x$// p" -} importas -ns -d "\n" s x +} importas -n -d "\n" s x if { printf " " } if { s6-svstat /run/s6/${s},x } diff --git a/s6/host/glaphyrae/contents b/s6/host/glaphyrae/contents @@ -0,0 +1,13 @@ +acme-client,git.josuah.net +acme-client,josuah.net +geomyidae,ipv4,josuah.net +geomyidae,ipv6,josuah.net +git-daemon +ii,tls,irc.freenode.net +ii,tls,irc.cyberia.is +ii,tls,irc.epitech.eu +ngircd,tls,josuah.net +tinysshd +qmail-smtpd,tcp,josuah.net +qmail-smtpd,tls,josuah.net +qmail-send,tls,josuah.net diff --git a/s6/host/x/type b/s6/host/x/type @@ -0,0 +1 @@ +bundle diff --git a/s6/ii/irc.epitech.eu/env/HOST b/s6/ii/irc.epitech.eu/env/HOST @@ -0,0 +1 @@ +irc.epitech.eu diff --git a/s6/ii/irc.epitech.eu/env/NAME b/s6/ii/irc.epitech.eu/env/NAME diff --git a/s6/ii/irc.epitech.eu/env/NICK b/s6/ii/irc.epitech.eu/env/NICK @@ -0,0 +1 @@ +iiosuah diff --git a/s6/ii/irc.epitech.eu/env/PASS b/s6/ii/irc.epitech.eu/env/PASS diff --git a/s6/ii/irc.epitech.eu/env/USER b/s6/ii/irc.epitech.eu/env/USER @@ -0,0 +1 @@ +josuah diff --git a/s6/qmail-smtpd/tcp/run b/s6/qmail-smtpd/tcp/run @@ -1,10 +1,10 @@ #!/usr/bin/env execlineb fdmove -c 2 1 s6-envdir env multisubstitute { importas USER USER - importas HOST HOST + importas BIND BIND importas PORT PORT } s6-envuidgid $USER -s6-tcpserver -U $HOST $PORT +s6-tcpserver -U $BIND $PORT qmail-smtpd diff --git a/s6/qmail-smtpd/tls/run b/s6/qmail-smtpd/tls/run @@ -2,10 +2,10 @@ fdmove -c 2 1 s6-envdir env multisubstitute { importas ACCESSFILE ACCESSFILE importas USER USER - importas HOST HOST + importas BIND BIND importas PORT PORT } s6-envuidgid $USER -s6-tlsserver -U $HOST $PORT +s6-tlsserver -U $BIND $PORT qmail-smtpd