dot

packages and services management
Log | Files | Refs | README

commit 1ed2f7f028272ecf39f05fb3e1c5117b1178801e
parent b2a458c981a629c05d320dc892dba63d5dd98e59
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 11 Nov 2018 17:40:53 +0100

permit use of multiple "configuration overlays" to services

Diffstat:
Mbin/service-disable | 5+++--
Mbin/service-enable | 34++++++++++++++--------------------
As6/geomyidae/4/env/IPV | 1+
As6/geomyidae/6/env/IPV | 1+
Ms6/geomyidae/x/run | 3++-
Ds6/vsftpd-tcp/josuah.net/data/rsa_cert_file | 1-
As6/vsftpd/josuah.net/data/rsa_cert_file | 1+
Rs6/vsftpd-tcp/x/data/allow_anon_ssl -> s6/vsftpd/x/data/allow_anon_ssl | 0
Rs6/vsftpd-tcp/x/data/anon_root -> s6/vsftpd/x/data/anon_root | 0
Rs6/vsftpd-tcp/x/data/anonymous_enable -> s6/vsftpd/x/data/anonymous_enable | 0
Rs6/vsftpd-tcp/x/data/connect_from_port_20 -> s6/vsftpd/x/data/connect_from_port_20 | 0
Rs6/vsftpd-tcp/x/data/ftp_username -> s6/vsftpd/x/data/ftp_username | 0
Rs6/vsftpd-tcp/x/data/listen -> s6/vsftpd/x/data/listen | 0
Rs6/vsftpd-tcp/x/data/pasv_enable -> s6/vsftpd/x/data/pasv_enable | 0
Rs6/vsftpd-tcp/x/data/pasv_promiscuous -> s6/vsftpd/x/data/pasv_promiscuous | 0
Rs6/vsftpd-tcp/x/data/ssl_enable -> s6/vsftpd/x/data/ssl_enable | 0
Rs6/vsftpd-tcp/x/data/tcp_wrappers -> s6/vsftpd/x/data/tcp_wrappers | 0
Rs6/vsftpd-tcp/x/data/vsftpd_log_file -> s6/vsftpd/x/data/vsftpd_log_file | 0
Rs6/vsftpd-tcp/x/env/HOST -> s6/vsftpd/x/env/HOST | 0
Rs6/vsftpd-tcp/x/env/PORT -> s6/vsftpd/x/env/PORT | 0
Rs6/vsftpd-tcp/x/env/ROOT -> s6/vsftpd/x/env/ROOT | 0
Rs6/vsftpd-tcp/x/run -> s6/vsftpd/x/run | 0
Rs6/vsftpd-tcp/x/type -> s6/vsftpd/x/type | 0
23 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/bin/service-disable b/bin/service-disable @@ -4,6 +4,7 @@ cd /var/s6 if { mkdir -p ok-all } if { touch ok-all/contents } -forbacktickx -n x { pipeline { dollarat } tr / - } importas x x +backtick x { dollarat -n -d - } importas x x if { rm -rf ${x} ${x}-log } -pipeline { grep -Fv -e ${x} -e ${x}-log ok-all/contents } sort -u -o ok-all/contents - +pipeline { grep -Fv -e ${x} -e ${x}-log ok-all/contents } + sort -u -o ok-all/contents - diff --git a/bin/service-enable b/bin/service-enable @@ -1,24 +1,18 @@ #!/usr/bin/env execlineb cd /var/s6 -ifelse { pipeline { dollarat } grep -Evq "^[^/]+/[^/]+\$" } { - foreground { echo "usage: service-enable service/version..." } - exit 1 -} - -forbacktickx -n src { dollarat } importas src src -backtick -n dir { dirname $src } importas dir dir -backtick -n dst { pipeline { echo $src } tr / - } importas dst dst -define -n log ${dst}-log - -if { rm -rf $dst $log } -if { s6-hiercopy /etc/s6/${dir}/x $dst } -if { s6-hiercopy /etc/s6/${src} $dst } -if { pipeline { echo $dst } sort -u -o ok-all/contents ok-all/contents - } +importas -n base 1 +backtick -n x { dollarat -n -d - } importas name x -if { grep -qFx longrun /etc/s6/${src}/type } -if { s6-hiercopy /etc/s6/.s6-rc/service-log $log } -if { redirfd -w 1 ${dst}/producer-for echo $log } -if { redirfd -w 1 ${log}/consumer-for echo $dst } -if { redirfd -w 1 ${log}/env/SERVICE echo $dst } -if { pipeline { echo $log } sort -u -o ok-all/contents ok-all/contents - } +if { rm -rf ${name} ${name}-log } +if { export 1 x forbacktickx -n x { dollarat } importas x x + s6-hiercopy /etc/s6/${base}/${x} ${name} +} +if { grep -qFx longrun /etc/s6/${base}/x/type } +if { s6-hiercopy /etc/s6/.s6-rc/service-log ${name}-log } +if { redirfd -w 1 ${name}/producer-for echo ${name}-log } +if { redirfd -w 1 ${name}-log/consumer-for echo ${name} } +if { redirfd -w 1 ${name}-log/env/SERVICE echo ${name} } +if { pipeline { printf "%s\n" ${name} ${name}-log } + sort -u -o ok-all/contents ok-all/contents - +} diff --git a/s6/geomyidae/4/env/IPV b/s6/geomyidae/4/env/IPV @@ -0,0 +1 @@ +4 diff --git a/s6/geomyidae/6/env/IPV b/s6/geomyidae/6/env/IPV @@ -0,0 +1 @@ +6 diff --git a/s6/geomyidae/x/run b/s6/geomyidae/x/run @@ -3,6 +3,7 @@ fdmove -c 2 1 s6-envdir env multisubstitute { importas HOST HOST importas PORT PORT importas ROOT ROOT + importas IPV IPV } -geomyidae -d -b $ROOT -h $HOST -p $PORT +geomyidae -d -b $ROOT -h $HOST -p $PORT -$IPV diff --git a/s6/vsftpd-tcp/josuah.net/data/rsa_cert_file b/s6/vsftpd-tcp/josuah.net/data/rsa_cert_file @@ -1 +0,0 @@ -/etc/ssl/josuah.net/privkey.pem diff --git a/s6/vsftpd/josuah.net/data/rsa_cert_file b/s6/vsftpd/josuah.net/data/rsa_cert_file @@ -0,0 +1 @@ +/etc/ssl/josuah.net/chain.pem diff --git a/s6/vsftpd-tcp/x/data/allow_anon_ssl b/s6/vsftpd/x/data/allow_anon_ssl diff --git a/s6/vsftpd-tcp/x/data/anon_root b/s6/vsftpd/x/data/anon_root diff --git a/s6/vsftpd-tcp/x/data/anonymous_enable b/s6/vsftpd/x/data/anonymous_enable diff --git a/s6/vsftpd-tcp/x/data/connect_from_port_20 b/s6/vsftpd/x/data/connect_from_port_20 diff --git a/s6/vsftpd-tcp/x/data/ftp_username b/s6/vsftpd/x/data/ftp_username diff --git a/s6/vsftpd-tcp/x/data/listen b/s6/vsftpd/x/data/listen diff --git a/s6/vsftpd-tcp/x/data/pasv_enable b/s6/vsftpd/x/data/pasv_enable diff --git a/s6/vsftpd-tcp/x/data/pasv_promiscuous b/s6/vsftpd/x/data/pasv_promiscuous diff --git a/s6/vsftpd-tcp/x/data/ssl_enable b/s6/vsftpd/x/data/ssl_enable diff --git a/s6/vsftpd-tcp/x/data/tcp_wrappers b/s6/vsftpd/x/data/tcp_wrappers diff --git a/s6/vsftpd-tcp/x/data/vsftpd_log_file b/s6/vsftpd/x/data/vsftpd_log_file diff --git a/s6/vsftpd-tcp/x/env/HOST b/s6/vsftpd/x/env/HOST diff --git a/s6/vsftpd-tcp/x/env/PORT b/s6/vsftpd/x/env/PORT diff --git a/s6/vsftpd-tcp/x/env/ROOT b/s6/vsftpd/x/env/ROOT diff --git a/s6/vsftpd-tcp/x/run b/s6/vsftpd/x/run diff --git a/s6/vsftpd-tcp/x/type b/s6/vsftpd/x/type