10-03-2020, 02:41 PM
Take a look at the systemd.service manpage. It describes how to configure systemd to manage a service. I am sure you will find examples for your system in /usr/lib/systemd/system or similar paths.
In your case, the service would look somewhat like this:
[Unit]
Description=Unturned Game Server
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/bin/bash /home/steam/start.sh
Type=simple
User=steam
Group=steam
WorkingDirectory=/home/steam
Restart=on-failure
Put this in a file /etc/systemd/system/unturned.service. Then run systemctl daemon-reload (once, and whenever you change unturned.service to tell systemd to re-read the configuration) and systemctl start unturned.service to start the game server.
If that works as expected, you can use systemctl enable unturned.service to make sure it starts at boot.
In your case, the service would look somewhat like this:
[Unit]
Description=Unturned Game Server
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/bin/bash /home/steam/start.sh
Type=simple
User=steam
Group=steam
WorkingDirectory=/home/steam
Restart=on-failure
Put this in a file /etc/systemd/system/unturned.service. Then run systemctl daemon-reload (once, and whenever you change unturned.service to tell systemd to re-read the configuration) and systemctl start unturned.service to start the game server.
If that works as expected, you can use systemctl enable unturned.service to make sure it starts at boot.