[Unit]
Description=TheHive
Documentation=https://thehive-project.org
Wants=network-online.target
After=network-online.target
[Service]
WorkingDirectory=/opt/thehive
User=thehive
Group=thehive
ExecStart=/opt/thehive/bin/thehive \
-Dconfig.file=/etc/thehive/application.conf \
-Dlogger.file=/etc/thehive/logback.xml \
-Dpidfile.path=/var/run/thehive/pid
StandardOutput=journal
StandardError=inherit
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0
# SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM
# Java process is never killed
SendSIGKILL=no
# When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
(cat << _EOF_
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
play.http.secret.key="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1)"
_EOF_
) | sudo tee -a /etc/thehive/application.conf
Optional kann das init.d Script noch angepasst werden sollte dadürber der Dienst gestartet werden, liegt in /etc/init.d/thehive
Ganz oben die ersten Zeilen die so ähnlich aussen ändern
NAME=thehive
DAEMON=/opt/thehive/bin/thehive
PIDFILE=/var/run/thehive/pid
DAEMON_USER=thehive
DAEMON_ARGS="-Dconfig.file=/etc/thehive/application.conf -Dlogger.file=/etc/thehive/logback.xml -Dpidfile.path=/var/run/thehive/pid"
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#Type Path Mode UID GID Age Argument
d /run/thehive 0755 thehive thehive - -