blob: 0c5d8c4c6df3e43884a8dcccf60d2630c57d7c71 (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>longrun-make</title>
<meta name="Description" content="Helper script to generate s6-rc longrun source directories from a commandline." />
<meta name="Keywords" content="goetia s6-rc longrun source directory" />
</head>
<header>
<p>
<a href="//0x53.net/software/goetia/goetia-base">goetia-base</a>
<br />
<a href="//0x53.net/software/goetia">goetia</a>
<br />
<a href="//0x53.net/software">Software</a>
<br />
<a href="//0x53.net">0x53.net</a>
</p>
</header>
<body>
<h1>The longrun-make program</h1>
<p>
longrun-make contains boilerplate code
required to create the
<a href="https://skarnet.org/software/s6-rc/s6-rc-compile.html#source">source directory</a>
of a longrun service
based on strings.
</p>
<h2>Interface</h2>
<pre> longrun-make <em>workingdir</em> <em>name</em> <em>type</em> <em>script</em> <em>dependencies</em></pre>
<ul>
<li>
<code><em>type</em></code> can only be one of <code>log | srv</code>.
</li>
<li>
<code><em>dependencies</em></code> can only be one of <code>"dependency1 dependency2 ..." | none</code>.
</li>
<li>
longrun-make creates the directory <code><em>workingdir</em>/<em>name</em>-<em>type</em></code>.
</li>
<li>
It creates the file <code><em>workingdir</em>/<em>name</em>-<em>type</em>/type</code>
(literal "<code>type</code>") and writes the line <code>longrun</code> to it.
</li>
<li>
It creates the file <code><em>workingdir</em>/<em>name</em>-<em>type</em>/notification-fd</code>
and writes the line <code>3</code> to it.
</li>
<li>
It creates the file <code><em>workingdir</em>/<em>name</em>-<em>type</em>/run</code>
and writes <code><em>script</em></code> to it.
</li>
<li>
If <code><em>type</em></code> is <code>log</code> <em>and</em> the file
<code><em>workingdir</em>/<em>name</em>-<em>type</em>/consumer-for</code>
does <em>not</em> contain the string <code><em>name</em></code>:
<ul>
<li>
longrun-make aquires a lock on the file
<code><em>workingdir</em>/<em>name</em>-<em>type</em>/consumer-for</code>
using
<a href="https://skarnet.org/software/s6/s6-setlock.html">s6-setlock</a>.
</li>
<li>
It appends the string <code><em>name</em>-srv</code> to the file
<code><em>workingdir</em>/<em>name</em>-<em>type</em>/consumer-for</code>
creating it if it does not exist.
</li>
<li>
It creates a file <code><em>workingdir</em>/<em>name</em>-<em>type</em>/pipeline-name</code>,
truncating it if it does exist and adds the string <code><em>name</em></code>.
</li>
</ul>
</li>
<li>
If <code><em>type</em></code> is <code>srv</code>:
<ul>
<li>
The file
<code><em>workingdir</em>/<em>name</em>-<em>type</em>/producer-for</code>
is created, truncated and the string <code><em>name</em>-log</code> is added.
</li>
</ul>
</li>
<li>
If <code><em>dependencies</em></code> is not <code>none</code>:
<ul>
<li>
The directory
<code><em>workingdir</em>/<em>name</em>-<em>type</em>/dependencies.d</code>
is created.
</li>
<li>
For each word <code>"dependency1 dependency2 ..."</code> in
<code><em>dependencies</em></code> separated by spaces,
a file
<code><em>workingdir</em>/<em>name</em>-<em>type</em>/dependencies.d/<em>dependency</em></code>
is created.
</li>
</ul>
</li>
</ul>
<p>
longrun-make is, by means of locking and checking for duplicates,
specifically designed to allow parallel creation of logging
<a href="https://skarnet.org/software/s6-rc/s6-rc-compile.html#source">source directories</a>.
</p>
<h2>Exit codes</h2>
<ul>
<li>
0: success
</li>
<li>
Since longrun-make is an
<a href="https://skarnet.org/software/execline/">execline</a>
script, it exits with an approximation
of employed program that failed.
</li>
<li>
longrun-make mostly uses
<a href="https://skarnet.org/software/execline/">execline</a>
and
<a href="https://skarnet.org/software/s6/">s6</a>
software, the exit behaviour of which can be looked up on
their respective pages.
</li>
<li>
See also:
<a href="https://skarnet.org/software/execline/exitcodes.html">execline exit code handling</a>.
</li>
</ul>
<h2>Options</h2>
<ul>
<li>
There are no otions to longrun-make.
</li>
</ul>
</body>
</html>
|