examples/hgweb@.service

1
# systemd template unit: one hgweb wire-protocol instance per domain.
2
#   systemctl enable --now hgweb@code.example.org
3
# Reads /srv/<domain>/config/hgweb.env, which must define:
4
#   HGWEB_CONFIG=/srv/code.example.org/config/hgweb.config
5
#   PORT=8420   (must match the port in that domain's apache.d/nginx config)
6
 
7
[Unit]
8
Description=hgweb wire protocol for %i
9
After=network.target
10
 
11
[Service]
12
User=sympl
13
Group=sympl
14
EnvironmentFile=/srv/%i/config/hgweb.env
15
ExecStart=/usr/bin/gunicorn --workers 2 --bind 127.0.0.1:${PORT} \
16
    --chdir /usr/local/lib/hgweb hgweb_wsgi:application
17
Restart=on-failure
18
 
19
[Install]
20
WantedBy=multi-user.target