| 1 | [Unit] |
| 2 | Description=Translation server and API for Apertium |
| 3 | Documentation=https://wiki.apertium.org/wiki/Apertium-apy |
| 4 | After=network.target |
| 5 | |
| 6 | [Service] |
| 7 | # Change this to your username and edit to how you start apy: |
| 8 | User=apertium |
| 9 | WorkingDirectory=/usr/share/apertium-apy/tools |
| 10 | ExecStart=/usr/bin/python3 servlet.py --fasttext-model /usr/share/apertium-apy/lid.release.ftz /usr/share/apertium/modes |
| 11 | Environment=LC_ALL=C.UTF-8 |
| 12 | |
| 13 | # By default, if it restarts >10 times within 5 secs, it marks it as failed and gives up: |
| 14 | Restart=always |
| 15 | |
| 16 | # Restart the service if it doesn't do a watchdog ping within 10 seconds: |
| 17 | WatchdogSec=10s |
| 18 | |
| 19 | # No reason to have access to shared tmp files: |
| 20 | PrivateTmp=yes |
| 21 | |
| 22 | [Install] |
| 23 | WantedBy=multi-user.target |