Fossil SCM

Doc additions for running fossil as a server on OpenBSD, contributed by Thomas Levine in [forum:/forumpost/9a5b913c99|forum post 9a5b913c99].

stephan 2021-05-28 01:38 trunk
Commit 62073f6dbb4b691087a2be42c156cf307ed0191804e067fc8ec8bad842e44a0a
--- www/server/index.html
+++ www/server/index.html
@@ -256,11 +256,11 @@
256256
<td class="doc"><a href="any/cgi.md">✅</a></td>
257257
<td class="doc"><a href="any/scgi.md">✅</a></td>
258258
<td class="doc"><a href="openbsd/fastcgi.md">✅</a></td>
259259
<td class="doc"><a href="any/althttpd.md">✅</a></td>
260260
<td class="doc">❌</td>
261
- <td class="doc">❌</td>
261
+ <td class="doc"><a href="openbsd/service.wiki">✅</a></td>
262262
</tr>
263263
264264
<tr>
265265
<th class="host"><a href="windows/">Windows</a></th>
266266
<td class="doc"><a href="windows/none.md">✅</a></td>
267267
268268
ADDED www/server/openbsd/service.wiki
--- www/server/index.html
+++ www/server/index.html
@@ -256,11 +256,11 @@
256 <td class="doc"><a href="any/cgi.md">✅</a></td>
257 <td class="doc"><a href="any/scgi.md">✅</a></td>
258 <td class="doc"><a href="openbsd/fastcgi.md">✅</a></td>
259 <td class="doc"><a href="any/althttpd.md">✅</a></td>
260 <td class="doc">❌</td>
261 <td class="doc">❌</td>
262 </tr>
263
264 <tr>
265 <th class="host"><a href="windows/">Windows</a></th>
266 <td class="doc"><a href="windows/none.md">✅</a></td>
267
268 DDED www/server/openbsd/service.wiki
--- www/server/index.html
+++ www/server/index.html
@@ -256,11 +256,11 @@
256 <td class="doc"><a href="any/cgi.md">✅</a></td>
257 <td class="doc"><a href="any/scgi.md">✅</a></td>
258 <td class="doc"><a href="openbsd/fastcgi.md">✅</a></td>
259 <td class="doc"><a href="any/althttpd.md">✅</a></td>
260 <td class="doc">❌</td>
261 <td class="doc"><a href="openbsd/service.wiki">✅</a></td>
262 </tr>
263
264 <tr>
265 <th class="host"><a href="windows/">Windows</a></th>
266 <td class="doc"><a href="windows/none.md">✅</a></td>
267
268 DDED www/server/openbsd/service.wiki
--- a/www/server/openbsd/service.wiki
+++ b/www/server/openbsd/service.wiki
@@ -0,0 +1,60 @@
1
+<title>Serving via rc on OpenBSD</title>
2
+
3
+OpenBSD provides [https://man.openbsd.org/rc.subr.8|rc.subr(8)],
4
+a framework for writing [https://man.openbsd.org/rc.8|rc(8)] scripts.
5
+
6
+<h2>Creating the daemon</h2>
7
+Create the file /etc/rc.d/fossil with contents like the following.
8
+
9
+<blockquote><pre>
10
+#!/bin/ksh
11
+daemon="/usr/local/bin/fossil" # fossil executable
12
+daemon_user="_fossil" # user to run fossil as
13
+daemon_flags="server /home/_fossil/example --repolist --port 8888" # fossil command
14
+
15
+. /etc/rc.d/rc.subr
16
+# pexp="$daemon sil' kills the process.
17
+rc_bg=YES # Run in the background, since fossil serve does not daemon</blockquote>
18
+
19
+<h3>pexp</h3>
20
+You may need to uncomment the "pexp=". rc.subr typically
21
+finds the daemon process based by matching the process name and argument list.
22
+Without the "pexp=" line, rc.subr would look for this exact command:
23
+
24
+<blockquote><pre>
25
+/usr/local/bin/fossil se--repolist --port 8888
26
+</pre></blockquot--repolist --port 8888
27
+</pre>
28
+
29
+Depending on the arguments and their order, fossil may rewrite the arguments
30
+for display in the process listing ([https://man.openbsd.org/ps.1|ps(1)]),
31
+so rc.subr may fail to find the process through the default match. The example
32
+above does not get rewritten, but the same commands in a different order can
33
+be rewritten.
34
+For example, when I switch the order of the argublockquote><pre>
35
+/usr/local/bin/fossil server --repolist --port 8888 /home/_fossil/example
36
+</pre></blockquote>
37
+
38
+the process comblockquote><pre>
39
+/usr/local/bin/fossil server /home/_fossil/example /home/_fossil/example 8888 /</blockquot /home/_fossil/example
40
+</pre>
41
+
42
+The commented "pexp=" line instructs rc.subr to choose the processblockquote><pre>
43
+/usr/local/bin/fossil server
44
+</pre></blockquote>
45
+
46
+<h2>Enabling the daemon</h2>
47
+>Enabling the daemon</h2>
48
+
49
+Once youblockquote>ssil, run these commands.
50
+
51
+<pre>
52
+rcctl enable fossil # add fossil to pkg_scripts in /etc/rc.conf.</blockquot# start the daemon now
53
+</pre>
54
+
55
+The daemon should now be running and set to start at boot.
56
+You may want to serve multiple fossil instances with different options.
57
+For example,
58
+
59
+ * If different users own different repositories, you may want different users
60
+ to serve different repositori
--- a/www/server/openbsd/service.wiki
+++ b/www/server/openbsd/service.wiki
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/www/server/openbsd/service.wiki
+++ b/www/server/openbsd/service.wiki
@@ -0,0 +1,60 @@
1 <title>Serving via rc on OpenBSD</title>
2
3 OpenBSD provides [https://man.openbsd.org/rc.subr.8|rc.subr(8)],
4 a framework for writing [https://man.openbsd.org/rc.8|rc(8)] scripts.
5
6 <h2>Creating the daemon</h2>
7 Create the file /etc/rc.d/fossil with contents like the following.
8
9 <blockquote><pre>
10 #!/bin/ksh
11 daemon="/usr/local/bin/fossil" # fossil executable
12 daemon_user="_fossil" # user to run fossil as
13 daemon_flags="server /home/_fossil/example --repolist --port 8888" # fossil command
14
15 . /etc/rc.d/rc.subr
16 # pexp="$daemon sil' kills the process.
17 rc_bg=YES # Run in the background, since fossil serve does not daemon</blockquote>
18
19 <h3>pexp</h3>
20 You may need to uncomment the "pexp=". rc.subr typically
21 finds the daemon process based by matching the process name and argument list.
22 Without the "pexp=" line, rc.subr would look for this exact command:
23
24 <blockquote><pre>
25 /usr/local/bin/fossil se--repolist --port 8888
26 </pre></blockquot--repolist --port 8888
27 </pre>
28
29 Depending on the arguments and their order, fossil may rewrite the arguments
30 for display in the process listing ([https://man.openbsd.org/ps.1|ps(1)]),
31 so rc.subr may fail to find the process through the default match. The example
32 above does not get rewritten, but the same commands in a different order can
33 be rewritten.
34 For example, when I switch the order of the argublockquote><pre>
35 /usr/local/bin/fossil server --repolist --port 8888 /home/_fossil/example
36 </pre></blockquote>
37
38 the process comblockquote><pre>
39 /usr/local/bin/fossil server /home/_fossil/example /home/_fossil/example 8888 /</blockquot /home/_fossil/example
40 </pre>
41
42 The commented "pexp=" line instructs rc.subr to choose the processblockquote><pre>
43 /usr/local/bin/fossil server
44 </pre></blockquote>
45
46 <h2>Enabling the daemon</h2>
47 >Enabling the daemon</h2>
48
49 Once youblockquote>ssil, run these commands.
50
51 <pre>
52 rcctl enable fossil # add fossil to pkg_scripts in /etc/rc.conf.</blockquot# start the daemon now
53 </pre>
54
55 The daemon should now be running and set to start at boot.
56 You may want to serve multiple fossil instances with different options.
57 For example,
58
59 * If different users own different repositories, you may want different users
60 to serve different repositori

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button