blob: 2b5b433f45ddbab043cdce85b5a4dc146f885252 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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}
}
|