mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 03:05:16 +00:00
Added a simple systemd service (#5)
Co-authored-by: Sanae <32604996+Sanae6@users.noreply.github.com>
This commit is contained in:
parent
ead6292f94
commit
aec13bb4a6
2 changed files with 29 additions and 1 deletions
|
@ -20,6 +20,15 @@ dotnet run --project Server/Server.csproj -c Release
|
|||
```
|
||||
If you ran `dotnet build` instead of `dotnet run`, you can find the binary at `Server/bin/net6.0/Release/Server.exe`
|
||||
|
||||
## Running under systemd
|
||||
|
||||
If you have systemd, you can use the existing systemd serivce.
|
||||
```shell
|
||||
cp smo.serivce /etc/systemd/system/smo.service
|
||||
# edit ExecStart to your path for the server executable and change WorkingDirectory to the server directory
|
||||
chmod +x filepath to the server executable
|
||||
systemctl enable --now smo.service
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
|
|
19
smo.service
Normal file
19
smo.service
Normal file
|
@ -0,0 +1,19 @@
|
|||
[Unit]
|
||||
Description="Super Mario Odyssey Multiplayer Server"
|
||||
After=network.target
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
# Uncommnt User to run under a different user
|
||||
# User=user
|
||||
# change ExecStart to the path of the server file
|
||||
ExecStart="/home/user/SMOServer/Server"
|
||||
# change WorkingDirectory to the folder of your server
|
||||
WorkingDirectory=/home/user/SMOServer/
|
||||
# ensure the service restarts after crashing
|
||||
Restart=always
|
||||
# amount of time to wait before restarting the service
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue