|
1
|
# Serving as a Standalone Server on Windows |
|
2
|
|
|
3
|
On Windows, this method works more or less identically to how it’s |
|
4
|
documented in [the generic instructions](../any/none.md). |
|
5
|
|
|
6
|
...but only while `fossil.exe` is actually running, which is the source |
|
7
|
of much trouble on Windows. This problem has two halves: |
|
8
|
|
|
9
|
|
|
10
|
## No App Startup Without Desktop |
|
11
|
|
|
12
|
The easy methods for starting a program in Windows at system start all |
|
13
|
require an interactive desktop. There is no *easy* way to start an arbitrary |
|
14
|
program on Windows at boot before anyone has logged in. In Unix |
|
15
|
terms, Windows has no simple equivalent to [the `/etc/rc.local` file][rcl]. |
|
16
|
|
|
17
|
You can partially get around the first problem by setting your `fossil |
|
18
|
server` call up as one of the user’s interactive startup items. Windows |
|
19
|
10 has its own [idiosyncratic way of doing this][si10], and in older |
|
20
|
systems you have [several alternatives to this][si7]. Regardless of the |
|
21
|
actual mechanism, these will cause the Fossil standalone HTTP server to |
|
22
|
start on an *interactive desktop login* only. While you’re sitting at |
|
23
|
the Windows login screen, the Fossil server is *down*. |
|
24
|
|
|
25
|
[rcl]: http://nixdoc.net/man-pages/FreeBSD/man8/rc.local.8.html |
|
26
|
[si10]: https://www.tenforums.com/tutorials/2944-add-delete-enable-disable-startup-items-windows-10-a.html |
|
27
|
[si7]: https://www.wikihow.com/Change-Startup-Programs-in-Windows-7 |
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
## No Simple Background Mode |
|
32
|
|
|
33
|
Windows also lacks a direct equivalent of the Bourne shell’s “`&`” control operator to |
|
34
|
run a program in the background, which you can give in Unix’s `rc.local` |
|
35
|
file, which is just a normal Bourne shell script. |
|
36
|
|
|
37
|
By “background,” I mean |
|
38
|
“not attached to any interactive user’s login session.” When the |
|
39
|
`rc.local` script exits in Unix, any program it backgrounded *stays |
|
40
|
running*. There is no simple and direct equivalent to this mechanism in |
|
41
|
Windows. |
|
42
|
|
|
43
|
If you set `fossil server` to run on interactive login, as above, it |
|
44
|
will shut right back down again when that user logs back out. |
|
45
|
|
|
46
|
With Windows 10, it’s especially problematic because you can no longer |
|
47
|
make the OS put off updates arbitrarily: your Fossil server will go down |
|
48
|
every time Windows Update decides it needs to reboot your computer, and |
|
49
|
then Fossil service will *stay* down until someone logs back into that |
|
50
|
machine interactively. |
|
51
|
|
|
52
|
|
|
53
|
## Better Solutions |
|
54
|
|
|
55
|
Because of these problems, we only recommend setting `fossil server` up |
|
56
|
on Windows this way when |
|
57
|
you’re a solo developer or you work in a small office where everyone |
|
58
|
arrives more or less at the same time each day, and everyone goes home |
|
59
|
about the same time each day, so that one user can keep the Fossil |
|
60
|
server up through the working day. |
|
61
|
|
|
62
|
If your needs go at all beyond this, you should expect proper “server” |
|
63
|
behavior, which you can get on Windows by [registering Fossil as a |
|
64
|
Windows service](./service.md), which solves the interactive startup and |
|
65
|
shutdown problems above, at a bit of complexity over the Startup Items |
|
66
|
method. You may also want to consider putting that service behind [an |
|
67
|
IIS front-end proxy](./iis.md) to add additional web serving features. |
|
68
|
|
|
69
|
*[Return to the top-level Fossil server article.](../)* |
|
70
|
|