dot

packages and services management
Log | Files | Refs | README

commit b2a458c981a629c05d320dc892dba63d5dd98e59
parent c3744a2981a61406eacb4751c923b7a1778813b0
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 11 Nov 2018 02:17:43 +0100

vsftpd ready for testing

Diffstat:
Abin/grep-r | 17+++++++++++++++++
Abin/ptree-grep | 8++++++++
Mbin/service-enable | 6++++--
Mbin/service-init | 23+++++++----------------
As6/.s6-rc/ok-all/contents | 2++
Rs6/ok/laptop/type -> s6/.s6-rc/ok-all/type | 0
As6/.s6-rc/s6-log/run | 5+++++
Rs6/s6-log/x/type -> s6/.s6-rc/s6-log/type | 0
Rs6/s6-log/x/env/SERVICE -> s6/.s6-rc/service-log/env/SERVICE | 0
Rs6/s6-log/x/run -> s6/.s6-rc/service-log/run | 0
Rs6/s6-svscan/log/type -> s6/.s6-rc/service-log/type | 0
Ds6/ok/minimal/contents | 3---
Ds6/ok/minimal/type | 1-
Ds6/ok/server/contents | 9---------
Ds6/ok/server/type | 1-
Ds6/s6-svscan/log/run | 6------
Ms6/ssh-agent/x/run | 0
As6/vsftpd-tcp/josuah.net/data/rsa_cert_file | 1+
18 files changed, 44 insertions(+), 38 deletions(-)

diff --git a/bin/grep-r b/bin/grep-r @@ -0,0 +1,17 @@ +#!/bin/sh -e + +args= +IFS=' +' + +while expr "$1" : '-.*' >/dev/null; do + args="$args$IFS$1" + shift +done + +pattern=$1 +shift; + +echo "$@" + +find "$@" -type f -exec grep $args "$pattern" {} + diff --git a/bin/ptree-grep b/bin/ptree-grep @@ -0,0 +1,8 @@ +#!/bin/sh -e + +while true; do + cols=$(stty size | sed 's/.* //') + clear + ptree | grep "$@" | cut -c "1-$cols" + sleep 1 +done diff --git a/bin/service-enable b/bin/service-enable @@ -14,9 +14,11 @@ 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 { s6-hiercopy /etc/s6/s6-log/x $log } +if { pipeline { echo $dst } sort -u -o ok-all/contents ok-all/contents - } + +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 $dst } sort -u -o ok-all/contents ok-all/contents - } if { pipeline { echo $log } sort -u -o ok-all/contents ok-all/contents - } diff --git a/bin/service-init b/bin/service-init @@ -1,31 +1,22 @@ #!/usr/bin/env execlineb if { s6-rmrf /run/s6 /var/s6/.s6-rc/log } -if { s6-mkdir -p /run/s6 /var/log /var/s6/.s6-rc } -if { s6-mkfifo /var/s6/.s6-rc/log } -cd /var/s6 - -if { cp -r /etc/s6/s6-svscan/log s6-svscan-log } - -background { - redirfd -r 1 .s6-rc/log - s6-log /var/log/s6-svscan t -} +if { s6-mkdir -p /run/s6 /var/log /var/s6/.s6-rc } cd /var/s6 +if { s6-mkfifo .s6-rc/log } +if { s6-hiercopy /etc/s6/.s6-rc/s6-log .s6-rc/s6-log } +if { s6-ln -s /var/s6/.s6-rc/s6-log /run/s6 } background { backtick -n t { s6-clock } importas t t if { s6-rc-compile .s6-rc/compiled$t . } - if { s6-rc-init -c /var/s6/.s6-rc/compiled$t -l /var/s6/.s6-rc/live /run/s6 } - redirfd -w 1 .s6-rc/log # wait that s6-svscan start - if { importas ! ! kill $! } # then kill s6-log - if { s6-rc -l live -u change s6-svscan-log } - if { s6-rc -l live -u change ok-all } + redirfd -w 1 .s6-rc/log # wait that s6-svscan start + if { s6-rc-init -c /var/s6/.s6-rc/compiled$t -l /var/s6/.s6-rc/live /run/s6 } + if { s6-rc -l .s6-rc/live -u change ok-all } if { echo service-init started } } redirfd -r 0 /dev/null redirfd -wnb 1 .s6-rc/log fdmove -c 2 1 - s6-svscan -t0 /run/s6 diff --git a/s6/.s6-rc/ok-all/contents b/s6/.s6-rc/ok-all/contents @@ -0,0 +1,2 @@ +s6rc-fdholder +s6rc-oneshot-runner diff --git a/s6/ok/laptop/type b/s6/.s6-rc/ok-all/type diff --git a/s6/.s6-rc/s6-log/run b/s6/.s6-rc/s6-log/run @@ -0,0 +1,5 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 + +redirfd -rnb 0 /var/s6/.s6-rc/log +s6-log -bp t /var/log/s6 diff --git a/s6/s6-log/x/type b/s6/.s6-rc/s6-log/type diff --git a/s6/s6-log/x/env/SERVICE b/s6/.s6-rc/service-log/env/SERVICE diff --git a/s6/s6-log/x/run b/s6/.s6-rc/service-log/run diff --git a/s6/s6-svscan/log/type b/s6/.s6-rc/service-log/type diff --git a/s6/ok/minimal/contents b/s6/ok/minimal/contents @@ -1,3 +0,0 @@ -s6-svscan-log -s6rc-fdholder -s6rc-oneshot-runner diff --git a/s6/ok/minimal/type b/s6/ok/minimal/type @@ -1 +0,0 @@ -bundle diff --git a/s6/ok/server/contents b/s6/ok/server/contents @@ -1,9 +0,0 @@ -acme-client -curvevpn -httpfile -ngircd -qmail -s6-svscan-log -s6rc-fdholder -s6rc-oneshot-runner -tinysshd diff --git a/s6/ok/server/type b/s6/ok/server/type @@ -1 +0,0 @@ -bundle diff --git a/s6/s6-svscan/log/run b/s6/s6-svscan/log/run @@ -1,6 +0,0 @@ -#!/usr/bin/env execlineb -redirfd -w 2 /dev/console -redirfd -w 1 /dev/null -redirfd -rnb 0 /var/s6/init/fifo - -s6-log -bp t /var/log/s6-svscan diff --git a/s6/ssh-agent/x/run b/s6/ssh-agent/x/run diff --git a/s6/vsftpd-tcp/josuah.net/data/rsa_cert_file b/s6/vsftpd-tcp/josuah.net/data/rsa_cert_file @@ -0,0 +1 @@ +/etc/ssl/josuah.net/privkey.pem