[Unit]
Description=torus storage daemon
After=network-online.target etcd.service tinc@default.service

[Service]
TimeoutStartSec=0
EnvironmentFile=/etc/environment.tf
EnvironmentFile=/etc/environment.calc
ExecStartPre=/sbin/modprobe nbd
ExecStart=/usr/bin/torusd \
  --peer-address http://${IP_INT}:40000 \
  --data-dir /var/lib/torus \
  --size $TORUS_SIZE \
  --etcd https://%H:2379 \
  --etcd-ca-file ${CA_FILE} \
  --etcd-cert-file /etc/ssl/server.pem \
  --etcd-key-file /etc/ssl/server-key.pem
Restart=always
StartLimitInterval=0

[Install]
WantedBy=multi-user.target
