summarylogtreecommitdiffstats
path: root/epoptes.service
blob: 74df4ad0694cbe041bb65516811962d703d9bd04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# TODO: If this is an LTSP client, then service only should run if EPOPTES=True in lts.conf

[Unit]
Description=A twisted-based daemon that manages epoptes-client
After=syslog.target

[Service]
Type=forking
PIDFile=/run/epoptes.pid
ExecStartPre=/bin/sh -c "if ! [ -s /etc/epoptes/server.key ] || ! [ -s /etc/epoptes/server.crt ]; then faketime '1970-01-01 00:00:00 UTC' openssl req -batch -x509 -nodes -newkey rsa:1024 -days $(($(date --utc +%s) / 86400 + 3652)) -keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt; chmod 600 /etc/epoptes/server.key; fi"
ExecStart=/usr/bin/twistd --pidfile /run/epoptes.pid --logfile /var/log/epoptes.log epoptes

[Install]
WantedBy=multi-user.target