@ -22,7 +22,7 @@ Starting the cooklang server is very straightforward: `cook server`, or `cook se
`systemd` uses [unit files](https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html) to configure resources it's responsible for. There's a lot going on in unit files so I've added as many comments as I could to explain what each lines does. Here, we're configuring a [service](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html) which specifically describes a *process* that systemd is responsible for maintaining.
`systemd` uses [unit files](https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html) to configure resources it's responsible for. There's a lot going on in unit files so I've added as many comments as I could to explain what each lines does. Here, we're configuring a [service](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html) which specifically describes a *process* that systemd is responsible for maintaining.
{{<highlight>}}
{{<highlightini>}}
[Unit]
[Unit]
# Describe your unit. This is displayed in various system utilities for human administrators to understand what they're looking at.
# Describe your unit. This is displayed in various system utilities for human administrators to understand what they're looking at.
Description="cooklang web server"
Description="cooklang web server"
@ -54,7 +54,7 @@ WantedBy=multi-user.target
{{</highlight>}}
{{</highlight>}}
With this unit file in place, my [recipes site](https://cook.ndumas.com) comes to life, with the help of a new block in my caddyfile:
With this unit file in place, my [recipes site](https://cook.ndumas.com) comes to life, with the help of a new block in my caddyfile:
{{<highlight>}}
{{<highlightini>}}
cook.ndumas.com {
cook.ndumas.com {
encode gzip
encode gzip
reverse_proxy localhost:9080
reverse_proxy localhost:9080
@ -66,7 +66,7 @@ Unfortunately, there's a catch. It looks like the cooklang server can't graceful
The full solution involves creating two additional unit-files: `cooklang-watcher.service` and `cooklang-watcher.path`. As above, I'll annotate the (new) directives to explain their functionality.
The full solution involves creating two additional unit-files: `cooklang-watcher.service` and `cooklang-watcher.path`. As above, I'll annotate the (new) directives to explain their functionality.
#### `cooklang-watcher.service`
#### `cooklang-watcher.service`
{{<highlight>}}
{{<highlightini>}}
[Unit]
[Unit]
Description=cooklang server restarter
Description=cooklang server restarter
After=network.target
After=network.target
@ -84,7 +84,7 @@ WantedBy=multi-user.target
{{</highlight>}}
{{</highlight>}}
#### `cooklang-watcher.path`
#### `cooklang-watcher.path`
{{<highlight>}}
{{<highlightini>}}
[Unit]
[Unit]
Description="Monitor /home/cook/recipes for changes"
Description="Monitor /home/cook/recipes for changes"