blob: 2322a87807f95d988625591f3d579f28c6e041ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[Unit]
Description=running answer daemon
Requires=network-online.target
After=network-online.target
[Service]
Type=simple
# 'setcap CAP_NET_BIND_SERVICE=+ep' is to allow non-root user binding port within 1-1024
ExecStart=bash -c 'setcap CAP_NET_BIND_SERVICE=+ep /usr/bin/answer; if [[ -f "/var/lib/answer/data/conf/config.yaml" ]]; then sudo -u answer /usr/bin/answer run; else sudo -u answer /usr/bin/answer init ;fi'
ExecStop=
[Install]
WantedBy=multi-user.target
|