Sanae6 / SmoOnlineServer

Official server for Super Mario Odyssey: Online
https://discord.gg/jYCueK2BqD
108 stars 27 forks source link

Systemd not working #21

Closed LeGeRyChEeSe closed 2 years ago

LeGeRyChEeSe commented 2 years ago

Hello, i can't make systemd working on my raspberry pi 4B: user@server:~/SmoOnlineServer/Server/bin/Release/net6.0 $ systemctl status smo ● smo.service - "Super Mario Odyssey Multiplayer Server" Loaded: loaded (/etc/systemd/system/smo.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Fri 2022-07-29 00:48:04 CEST; 3s ago Process: 4379 ExecStart=/home/user/SmoOnlineServer/Server/bin/Release/net6.0/Server (code=exited, status=131) Main PID: 4379 (code=exited, status=131)

There is the smo.service file: [Unit] Description="Super Mario Odyssey Multiplayer Server" After=network.target StartLimitIntervalSec=0

[Service] User=user ExecStart="/home/user/SmoOnlineServer/Server/bin/Release/net6.0/Server" WorkingDirectory=/home/user/SmoOnlineServer/Server/bin/Release/net6.0/ Restart=always RestartSec=5

[Install] WantedBy=multi-user.target

And this is my server folder: user@server:~/SmoOnlineServer $ tree -d . ├── Server │   ├── bin │   │   └── Release │   │ ......└── net6.0 │   │............ └── Server │   └── obj │   └── Release │   └── net6.0 │   ├── ref │   └── refint ├── Shared │   ├── bin │   │   └── Release │   │   └── net6.0 │   ├── obj │   │   └── Release │   │   └── net6.0 │   │   ├── ref │   │   └── refint │   └── Packet │   └── Packets └── TestClient

21 directories

piplup55 commented 2 years ago

could you provide the systemd output

should look something like this (notice the red box around what i'm looking for) image

LeGeRyChEeSe commented 2 years ago

I get only this:

kilian@stain:/ $ sudo systemctl status smo
● smo.service - "Super Mario Odyssey Multiplayer Server"
   Loaded: loaded (/etc/systemd/system/smo.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sat 2022-07-30 04:27:48 CEST; 9ms ago
  Process: 13541 ExecStart=/home/kilian/SmoOnlineServer/Server/bin/Release/net6.0/Server (code=exited, status=131)
 Main PID: 13541 (code=exited, status=131)
kilian@stain:/ $
Melechtna commented 2 years ago

I get only this:

kilian@stain:/ $ sudo systemctl status smo
● smo.service - "Super Mario Odyssey Multiplayer Server"
   Loaded: loaded (/etc/systemd/system/smo.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sat 2022-07-30 04:27:48 CEST; 9ms ago
  Process: 13541 ExecStart=/home/kilian/SmoOnlineServer/Server/bin/Release/net6.0/Server (code=exited, status=131)
 Main PID: 13541 (code=exited, status=131)
kilian@stain:/ $

Is the binary stored in /home/user? You did make sure to adjust both lines to kilian correct?

To demonstrate, it should look like this

[Service] User=kilian ExecStart="/home/kilian/SmoOnlineServer/Server/bin/Release/net6.0/Server" WorkingDirectory=/home/kilian/SmoOnlineServer/Server/bin/Release/net6.0/ Restart=always RestartSec=5

Istador commented 2 years ago

We fixed this together in Discord on Saturday.

They were building the project themselves from source on a Raspberry Pi (linux-arm).

Problem summary: 1.) sudo systemctl status smo didn't output any logs in this situation (solved by using journalctl -u smo directly). 2.) Server.dll: No such file or directory (IDK how it was solved). 3.) A runtime error message saying that the .NET Runtime wasn't installed, though the install script said that it was. (Solved by building with --self-contained to bundle the runtime dependencies into the build binaries).


Probably related to the issues he had on the Raspberry Pi (arm): when I build the docker image of the server with --no-self-contained for linux/arm/v7, then it fails to run with the M$ runtime image (dotnet host fxr missing). For linux/arm64 and linux/amd64 it works with --no-self-contained. And with --self-contained it works for all three of them. (Which is why that's currently in the Dockerfile and increases the image size by about 64 MB.) (Could also be an qemu emulation issue though.)

piplup55 commented 2 years ago

We fixed this together in Discord on Saturday.

They were building the project themselves from source on a Raspberry Pi (linux-arm).

Problem summary: 1.) sudo systemctl status smo didn't output any logs in this situation (solved by using journalctl -u smo directly). 2.) Server.dll: No such file or directory (IDK how it was solved). 3.) A runtime error message saying that the .NET Runtime wasn't installed, though the install script said that it was. (Solved by building with --self-contained to bundle the runtime dependencies into the build binaries).

Probably related to the issues he had on the Raspberry Pi (arm): when I build the docker image of the server with --no-self-contained for linux/arm/v7, then it fails to run with the M$ runtime image (dotnet host fxr missing). For linux/arm64 and linux/amd64 it works with --no-self-contained. And with --self-contained it works for all three of them. (Which is why that's currently in the Dockerfile and increases the image size by about 64 MB.) (Could also be an qemu emulation issue though.)

if that's the case why wasn't it closed as competed?

Sanae6 commented 2 years ago

Seems to be resolved now.