diff options
| author | PS <p@0x53.net> | 2026-02-01 12:02:03 +0100 |
|---|---|---|
| committer | PS <p@0x53.net> | 2026-02-01 12:02:03 +0100 |
| commit | 980c5408489a3a3a56e49c3873f1bce6a0155cad (patch) | |
| tree | 91df5fa62e7eca03d04b8ed114b20b337b99a556 /src/bin/longrun-make | |
| download | goetia-base-980c5408489a3a3a56e49c3873f1bce6a0155cad.tar.gz goetia-base-980c5408489a3a3a56e49c3873f1bce6a0155cad.tar.bz2 goetia-base-980c5408489a3a3a56e49c3873f1bce6a0155cad.zip | |
version 0.2.0.0
Diffstat (limited to 'src/bin/longrun-make')
| -rwxr-xr-x | src/bin/longrun-make | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/bin/longrun-make b/src/bin/longrun-make new file mode 100755 index 0000000..2b5b433 --- /dev/null +++ b/src/bin/longrun-make @@ -0,0 +1,36 @@ +#!@shebangdir@/execlineb -WS5 + +# ISC license. + +multisubstitute { + define WORKINGDIR ${1} + define NAME ${2} + define TYPE ${3} + define SCRIPT ${4} + define DEPENDENCIES ${5} +} + +if { mkdir -p ${WORKINGDIR}/${NAME}-${TYPE} } + +background { + if { eltest ${TYPE} = log } + s6-setlock ${WORKINGDIR}/${NAME}-log/consumer-for + if -n { grep -Fq -- ${NAME}-srv ${WORKINGDIR}/${NAME}-log/consumer-for } + background { redirfd -a 1 ${WORKINGDIR}/${NAME}-log/consumer-for echo ${NAME}-srv } + background { redirfd -w 1 ${WORKINGDIR}/${NAME}-log/pipeline-name echo ${NAME} } +} + +background { + if { eltest ${TYPE} = srv } + redirfd -w 1 ${WORKINGDIR}/${NAME}-srv/producer-for echo ${NAME}-log +} + +background { redirfd -w 1 ${WORKINGDIR}/${NAME}-${TYPE}/type echo longrun } +background { redirfd -w 1 ${WORKINGDIR}/${NAME}-${TYPE}/notification-fd echo 3 } +background { redirfd -w 1 ${WORKINGDIR}/${NAME}-${TYPE}/run echo ${SCRIPT} } +background { + if { eltest ${DEPENDENCIES} != none } + define -s SPLITDEPENDENCIES ${DEPENDENCIES} + if { mkdir -p ${WORKINGDIR}/${NAME}-${TYPE}/dependencies.d } + touch ${WORKINGDIR}/${NAME}-${TYPE}/dependencies.d/${SPLITDEPENDENCIES} +} |
