mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-12 22:55:06 +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
11
README.md
11
README.md
|
@ -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
|
||||
|
||||
|
@ -27,4 +36,4 @@ Run `help` to get what commands are available in the server console.
|
|||
Run the `loadsettings` command in the console to update the settings without restarting.
|
||||
Server address and port will require a server restart, but everything else should update when you run `loadsettings`.
|
||||
|
||||
[//]: # (TODO: Document all commands, possibly rename them too.)
|
||||
[//]: # (TODO: Document all commands, possibly rename them too.)
|
||||
|
|
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