Setup HERA as a Service â
To prevent the HERA server from shutting down after 2 hours, you should set up a service. To set up the HERA server as a service, you need SSH credentials for your Linux server. Then, enter the following information into the configuration file.
Start HERA as a Service â
Create a file named HERA.service and edit it with a text editor. Replace [YOUR USERNAME] with the username you use to log in to the Linux server (for example, heraserver). Context: You should never log in as root on your server. Instead, create a separate user. This name is used for the login and must be entered in the appropriate places in the configuration. Enter the following content:
[Unit]
Description=HERA Unreal Dedicated Server
After=network.target
[Service]
Type=simple
# The user account under which the server should run
User=[YOUR USERNAME]
# Base directory where your script is located
WorkingDirectory=/home/[YOUR USERNAME]/LinuxServer
# Your start script
ExecStart=/home/[YOUR USERNAME]/LinuxServer/HERA_Server.sh
# If the server crashes -> automatically restart
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetNow you must place the HERA.service file in the following path:
/etc/systemd/system/Afterward, you can reload the new configuration file into the system:
sudo systemctl daemon-reloadIf you want to start the service automatically when the server bootsâwhich is primarily relevant for server failuresâyou can do so with the following command:
sudo systemctl enable HERA.serviceNow you can start the service manually:
sudo systemctl start HERA.serviceIf desired, you can stop the service with this command:
sudo systemctl stop HERA.serviceOr restart the service with:
sudo systemctl restart HERA.serviceQuerying Status and Logs â
You can check the current status of the service with the following command:
sudo systemctl status HERA.serviceYou can easily exit this status display by pressing the Q key.
In the status display, you will see important information such as:
- Active: Shows whether the service is running and how long it has been active
You can view the log stream separately. Here you will find all information from the application itself, such as users logging in or other errors and issues:
journalctl -u HERA.service -fYou can terminate this log stream at any time with the shortcut CTRL+C.
If you want to check the number of automatic restarts so far, use this command:
systemctl show HERA.service -p NRestartsIf you want to check all currently running programs on the system related to HERA:
ps aux | grep -i HERAYou will receive a list of all programs including their process ID (PID)âfor example, 335715. You can terminate the respective program with the kill command:
kill 335715