jgm / jgm/gitit

Add systemd service

Open
#503 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
2.3k
Forks
231
PR merge metrics
No merged PRs in 30d

Description

It was proposed in https://github.com/tensor5/haskell-happstack/issues/11 to add `systemd` service file to the `haskell-gitit` Arch Linux package. We agreed that this issue should be discussed upstream.

We think that there should be two service files, one named `gitit.service`:

``` ini
[Unit]
Description=Gitit wiki
After=network.target

[Service]
ExecStart=/usr/bin/gitit -f /etc/gitit/default.conf
WorkingDirectory=/srv/gitit/default
User=gitit
Group=gitit
#Restart=on-failure

[Install]
WantedBy=multi-user.target
```

and the other named `gitit@.service`:

``` ini
[Unit]
Description=Gitit wiki
After=network.target

[Service]
ExecStart=/usr/bin/gitit -f /etc/gitit/%I.conf
WorkingDirectory=/srv/gitit/%I
User=gitit
Group=gitit
#Restart=on-failure

[Install]
WantedBy=multi-user.target
```

with `gitit` user and group being created upon installation and `%I` being the [unescaped instance name](http://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers). User can enable mutliple instances by running e.g. `systemctl start gitit@public.service`. Depending on the configuration it could run on port 80 (the executable `/usr/bin/gitit` should be granted the capability `CAP_NET_BIND_SERVICE`), or proxied behind a web server. The use of the directory `/srv/gitit` as home of `gitit` data is still being debated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.