Fossil SCM
Updated the systemd service article to account for my experience following the instructions on a CentOS 8 box. (It was originally written for an older Debian type platform.)
Commit
74670ab1fff5e2fcb9bbbb3a141b7b9baf2bef5e6a5ce69b2f03bc8a73f9add6
Parent
375589e50ec6542…
1 file changed
+14
-9
+14
-9
| --- www/server/debian/service.md | ||
| +++ www/server/debian/service.md | ||
| @@ -29,20 +29,19 @@ | ||
| 29 | 29 | `~/.local/share/systemd/user/fossil.service`: |
| 30 | 30 | |
| 31 | 31 | ```dosini |
| 32 | 32 | [Unit] |
| 33 | 33 | Description=Fossil user server |
| 34 | - After=network.target | |
| 34 | + After=network-online.target | |
| 35 | 35 | |
| 36 | 36 | [Service] |
| 37 | 37 | WorkingDirectory=/home/fossil/museum |
| 38 | 38 | ExecStart=/home/fossil/bin/fossil server --port 9000 repo.fossil |
| 39 | 39 | Restart=always |
| 40 | 40 | RestartSec=3 |
| 41 | 41 | |
| 42 | 42 | [Install] |
| 43 | - WantedBy=sockets.target | |
| 44 | 43 | WantedBy=multi-user.target |
| 45 | 44 | ``` |
| 46 | 45 | |
| 47 | 46 | Unlike with `inetd` and `xinetd`, we don’t need to tell `systemd` which |
| 48 | 47 | user and group to run this service as, because we’ve installed it |
| @@ -64,11 +63,11 @@ | ||
| 64 | 63 | find online: |
| 65 | 64 | |
| 66 | 65 | $ systemctl --user daemon-reload |
| 67 | 66 | $ systemctl --user enable fossil |
| 68 | 67 | $ systemctl --user start fossil |
| 69 | - $ systemctl --user status -l fossil | |
| 68 | + $ systemctl --user status fossil -l | |
| 70 | 69 | $ systemctl --user stop fossil |
| 71 | 70 | |
| 72 | 71 | That is, we don’t need to talk to `systemd` with `sudo` privileges, but |
| 73 | 72 | we do need to tell it to look at the user configuration rather than the |
| 74 | 73 | system-level configuration. |
| @@ -89,14 +88,21 @@ | ||
| 89 | 88 | |
| 90 | 89 | |
| 91 | 90 | |
| 92 | 91 | ### System Service Alternative |
| 93 | 92 | |
| 94 | -Another workaround for the problem with user services above is to | |
| 95 | -install the service as a system service instead. This is a better path | |
| 96 | -when you are proxying Fossil with a system-level service, such as | |
| 97 | -[nginx](./nginx.md). | |
| 93 | +There are a couple of common reasons that you’d have cause to install | |
| 94 | +Fossil as a system-level service rather than the prior user-level one: | |
| 95 | + | |
| 96 | +* You need Fossil to listen on a TCP port under 1024, such as because | |
| 97 | + you’re running it on a private LAN, and the server has no other HTTP | |
| 98 | + service, so you want Fossil to handle the web traffic directly. | |
| 99 | + | |
| 100 | +* You’re proxying Fossil with a system-level service such as | |
| 101 | + [nginx](./nginx.md), so you need to put Fossil into the system-level | |
| 102 | + service dependency chain to make sure things start up and shut down | |
| 103 | + in the proper order. | |
| 98 | 104 | |
| 99 | 105 | There are just a small set of changes required: |
| 100 | 106 | |
| 101 | 107 | 1. Install the unit file to one of the persistent system-level unit |
| 102 | 108 | file directories. Typically, these are: |
| @@ -146,19 +152,18 @@ | ||
| 146 | 152 | `[email protected]`: |
| 147 | 153 | |
| 148 | 154 | ```dosini |
| 149 | 155 | [Unit] |
| 150 | 156 | Description=Fossil socket server |
| 151 | - After=network.target | |
| 157 | + After=network-online.target | |
| 152 | 158 | |
| 153 | 159 | [Service] |
| 154 | 160 | WorkingDirectory=/home/fossil/museum |
| 155 | 161 | ExecStart=/home/fossil/bin/fossil http repo.fossil |
| 156 | 162 | StandardInput=socket |
| 157 | 163 | |
| 158 | 164 | [Install] |
| 159 | - WantedBy=sockets.target | |
| 160 | 165 | WantedBy=multi-user.target |
| 161 | 166 | ``` |
| 162 | 167 | |
| 163 | 168 | We’ll explain the “`@`” in the file name below. |
| 164 | 169 | |
| 165 | 170 |
| --- www/server/debian/service.md | |
| +++ www/server/debian/service.md | |
| @@ -29,20 +29,19 @@ | |
| 29 | `~/.local/share/systemd/user/fossil.service`: |
| 30 | |
| 31 | ```dosini |
| 32 | [Unit] |
| 33 | Description=Fossil user server |
| 34 | After=network.target |
| 35 | |
| 36 | [Service] |
| 37 | WorkingDirectory=/home/fossil/museum |
| 38 | ExecStart=/home/fossil/bin/fossil server --port 9000 repo.fossil |
| 39 | Restart=always |
| 40 | RestartSec=3 |
| 41 | |
| 42 | [Install] |
| 43 | WantedBy=sockets.target |
| 44 | WantedBy=multi-user.target |
| 45 | ``` |
| 46 | |
| 47 | Unlike with `inetd` and `xinetd`, we don’t need to tell `systemd` which |
| 48 | user and group to run this service as, because we’ve installed it |
| @@ -64,11 +63,11 @@ | |
| 64 | find online: |
| 65 | |
| 66 | $ systemctl --user daemon-reload |
| 67 | $ systemctl --user enable fossil |
| 68 | $ systemctl --user start fossil |
| 69 | $ systemctl --user status -l fossil |
| 70 | $ systemctl --user stop fossil |
| 71 | |
| 72 | That is, we don’t need to talk to `systemd` with `sudo` privileges, but |
| 73 | we do need to tell it to look at the user configuration rather than the |
| 74 | system-level configuration. |
| @@ -89,14 +88,21 @@ | |
| 89 | |
| 90 | |
| 91 | |
| 92 | ### System Service Alternative |
| 93 | |
| 94 | Another workaround for the problem with user services above is to |
| 95 | install the service as a system service instead. This is a better path |
| 96 | when you are proxying Fossil with a system-level service, such as |
| 97 | [nginx](./nginx.md). |
| 98 | |
| 99 | There are just a small set of changes required: |
| 100 | |
| 101 | 1. Install the unit file to one of the persistent system-level unit |
| 102 | file directories. Typically, these are: |
| @@ -146,19 +152,18 @@ | |
| 146 | `[email protected]`: |
| 147 | |
| 148 | ```dosini |
| 149 | [Unit] |
| 150 | Description=Fossil socket server |
| 151 | After=network.target |
| 152 | |
| 153 | [Service] |
| 154 | WorkingDirectory=/home/fossil/museum |
| 155 | ExecStart=/home/fossil/bin/fossil http repo.fossil |
| 156 | StandardInput=socket |
| 157 | |
| 158 | [Install] |
| 159 | WantedBy=sockets.target |
| 160 | WantedBy=multi-user.target |
| 161 | ``` |
| 162 | |
| 163 | We’ll explain the “`@`” in the file name below. |
| 164 | |
| 165 |
| --- www/server/debian/service.md | |
| +++ www/server/debian/service.md | |
| @@ -29,20 +29,19 @@ | |
| 29 | `~/.local/share/systemd/user/fossil.service`: |
| 30 | |
| 31 | ```dosini |
| 32 | [Unit] |
| 33 | Description=Fossil user server |
| 34 | After=network-online.target |
| 35 | |
| 36 | [Service] |
| 37 | WorkingDirectory=/home/fossil/museum |
| 38 | ExecStart=/home/fossil/bin/fossil server --port 9000 repo.fossil |
| 39 | Restart=always |
| 40 | RestartSec=3 |
| 41 | |
| 42 | [Install] |
| 43 | WantedBy=multi-user.target |
| 44 | ``` |
| 45 | |
| 46 | Unlike with `inetd` and `xinetd`, we don’t need to tell `systemd` which |
| 47 | user and group to run this service as, because we’ve installed it |
| @@ -64,11 +63,11 @@ | |
| 63 | find online: |
| 64 | |
| 65 | $ systemctl --user daemon-reload |
| 66 | $ systemctl --user enable fossil |
| 67 | $ systemctl --user start fossil |
| 68 | $ systemctl --user status fossil -l |
| 69 | $ systemctl --user stop fossil |
| 70 | |
| 71 | That is, we don’t need to talk to `systemd` with `sudo` privileges, but |
| 72 | we do need to tell it to look at the user configuration rather than the |
| 73 | system-level configuration. |
| @@ -89,14 +88,21 @@ | |
| 88 | |
| 89 | |
| 90 | |
| 91 | ### System Service Alternative |
| 92 | |
| 93 | There are a couple of common reasons that you’d have cause to install |
| 94 | Fossil as a system-level service rather than the prior user-level one: |
| 95 | |
| 96 | * You need Fossil to listen on a TCP port under 1024, such as because |
| 97 | you’re running it on a private LAN, and the server has no other HTTP |
| 98 | service, so you want Fossil to handle the web traffic directly. |
| 99 | |
| 100 | * You’re proxying Fossil with a system-level service such as |
| 101 | [nginx](./nginx.md), so you need to put Fossil into the system-level |
| 102 | service dependency chain to make sure things start up and shut down |
| 103 | in the proper order. |
| 104 | |
| 105 | There are just a small set of changes required: |
| 106 | |
| 107 | 1. Install the unit file to one of the persistent system-level unit |
| 108 | file directories. Typically, these are: |
| @@ -146,19 +152,18 @@ | |
| 152 | `[email protected]`: |
| 153 | |
| 154 | ```dosini |
| 155 | [Unit] |
| 156 | Description=Fossil socket server |
| 157 | After=network-online.target |
| 158 | |
| 159 | [Service] |
| 160 | WorkingDirectory=/home/fossil/museum |
| 161 | ExecStart=/home/fossil/bin/fossil http repo.fossil |
| 162 | StandardInput=socket |
| 163 | |
| 164 | [Install] |
| 165 | WantedBy=multi-user.target |
| 166 | ``` |
| 167 | |
| 168 | We’ll explain the “`@`” in the file name below. |
| 169 | |
| 170 |