summaryrefslogtreecommitdiffstats
path: root/doc/bin/compile-db.html
blob: c0ed957837c18b8d69444d5c99e6cbfc3549635f (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
<!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>compile-db</title>
    	<meta name="Description" content="A helper script for compiling s6-rc databases." />
    	<meta name="Keywords" content="goetia s6-rc s6-rc-compile 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 compile-db program</h1>
		<p>
			compile-db is a helper script for use by other software
			that compiles a general <code><em>confdir</em></code>
			tries to use the result to update a general
			<code><em>livedir</em></code>.
		</p>
		<h2>Interface</h2>
		<pre>     compile-db <em>confdir</em> <em>livedir</em></pre>
		<ul>
			<li>
    			compile-db runs
				<a href="https://skarnet.org/software/s6-rc/s6-rc-compile.html">s6-rc-compile</a>
				on <code><em>confdir</em>/src/*</code>.
			</li>
			<li>
    			This creates a new <code><em>confdir</em>/<var>@xyz@</var>_db</code>
				file with <code><var>@xyz@</var></code> based on the current UNIX time.
			</li>
			<li>
    			If <code><em>livedir</em></code> exists, that is,
				a goetia based supervision tree is running,
				compile-db the tries to update the live state at <code><em>livedir</em></code>
				to <code><var>@xyz@</var>_db</code> using
				<a href="https://skarnet.org/software/s6-rc/s6-rc-update.html">s6-rc-update</a>.
			</li>
			<li>
    			If it succeeds, it updates the symlink
				<code><em>confdir</em>/compiled</code>
				to point to
				<code><em>confdir</em>/<var>@xyz@</var>_db</code>
				and deletes the old database
				<code><em>confdir</em>/<var>@abc@</var>_db</code>.
			</li>
			<li>
    			If it does <em>not</em> succeed,
				it runs s6-rc-update to switch back to
				<code><em>confdir</em>/compiled</code>
				which points to
				<code><em>confdir</em>/<var>@abc@</var>_db</code>.
				Followed by deleting
				<code><em>confdir</em>/<var>@xyz@</var>_db</code>.
			</li>
		</ul>
		<h2>Exit codes</h2>
		<ul>
			<li>
    			0: success
			</li>
			<li>
    			Since compile-db is an
				<a href="https://skarnet.org/software/execline/">execline</a>
				script, it exits with an approximation
				of employed program that failed.
			</li>
			<li>
    			compile-db 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 compile-db.
			</li>
		</ul>
	</body>
</html>