Skip to content

Create an Ubuntu Service for the CrypToolStore server

Nils Kopal edited this page Apr 26, 2022 · 1 revision

This small documentation shows how to create an Ubuntu service which can be managed using systemd for CrypToolStore server. We assume that you have already copied CrypToolStore server into a folder of your choice. We also assume that you have configured it properly and Mono is installed. Finally, we assume you already have installed and configured the MySQL database.

Create the service in folder "/etc/systemd/system/". Here, create a "cryptoolstore.service" file containing:

 [Unit]
 Description=CrypToolStore service
 After=network.target mysql.service
 StartLimitIntervalSec=0
 
 [Service]
 Type=simple
 Restart=always
 RestartSec=1
 User=cryptoolstore
 ExecStart=/cryptoolstoreserver/start.sh
 
 [Install]
 WantedBy=multi-user.target

In this file, adapt "User=" and "ExecStart=" entries according to your needs.

In your installation folder of CrypToolStore server, e.g. "/cryptoolstoreserver/", create a shell script:

 #!/bin/sh
 cd /cryptoolstoreserver
 mono Main.exe

Make the shellscript executable: "chmod u+x start.sh"

Enable the newly created service with "sudo systemctl enable cryptoolstore"

To restart cryptool store service every 00:00am (we have a threading problem with Mono, thus restarts are needed) use "crontab -e" and add the following entry at the end of your crontab.

 0 0 * * * service cryptoolstore restart