SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

2 issues with linux servers #944

Closed jatapa closed 4 years ago

jatapa commented 4 years ago

Now I am not sure if this happens to everybody both linux and windows but after the latest update my servers have had these 2 problems.

  1. Running commands from console does not work.

  2. The servers will freeze right after they are up or after some time and after that nobody can connect to them.

Also tried without plugins and atleast the first issue still happens

Mithallas commented 4 years ago

same here, ubuntu 16.04

aman7 commented 4 years ago

yes its happening with me too.

Trojaner commented 4 years ago

Related to #932

Ascivv1 commented 4 years ago

I am also having this happen to me as well

SDGNelson commented 4 years ago

For the meantime: add -NoDefaultConsole to the command-line.

I'll probably do some more work on a Linux implementation of the console IO in the future, but in the meantime if it's blocking other input workarounds (e.g. Trojaner's straightforward solution in #932) then the best workaround is to add -NoDefaultConsole to the command-line.

Ascivv1 commented 4 years ago

What if I am using a RocketMod script? How do I do this?

SDGNelson commented 4 years ago

If you post the script as a gist I can direct exactly, but there are a few options:

  1. If calling the ServerHelper.so script, -NoDefaultConsole could be added to the command-line arguments in there, or added to the arguments passed to the script.

  2. If the custom script passes command-line arguments then -NoDefaultConsole could simply be added to the arguments passed to the script.

  3. If the custom script calls Unturned_Headless.x86_64 directly then -NoDefaultConsole can be added to the line that calls it.

Trojaner commented 4 years ago

If anyone uses https://github.com/ImperialPlugins/unturned-docker/ and docker, you can also just attach -NoDefaultConsole to the docker command:

docker run -it -p 27015:27015 -p 27016:27016 -e SERVER_TYPE=rm4 --restart unless-stopped --name myserverinstance imperialplugins/unturned -NoDefaultConsole 
Mithallas commented 4 years ago

https://gist.github.com/Mithallas/1c65c6bba630df162b75949ce7632ef6

Trojaner commented 4 years ago

The RocketLauncher doesn't support passing arguments to Unturned.

Ascivv1 commented 4 years ago

RM Scripts.zip

Here is my scripts folder (Couldn't send .bat so I had to use .zip)

Trojaner commented 4 years ago

You are using the same scripts as Mith with RocketLauncher. You can not use -NoDefaultConsole.

Ascivv1 commented 4 years ago

How can I use -NoDefaultConsole?

Trojaner commented 4 years ago

You don't need to edit the ServerHelper.sh (and I dont recommend doing so) When executing the ServerHelper.sh just add the -NoDefaultConsole argument to it.

e.g. ./ServerHelper.sh -NoDefaultConsole +secureserver/myserver

Ascivv1 commented 4 years ago

But what do I do if I want to start the RocketMod script with -NoDefaultConsole?

Nacho-Neko commented 4 years ago

same here, ubuntu 18.04 i try to fix RocketLauncher,but no effect。 if add -NoDefaultConsole to RocketLauncher arguments , console does not work too and worse

Nacho-Neko commented 4 years ago

@Trojaner use ServerHelper or other shell linux console can output and input?

aman7 commented 4 years ago

so for the linux users only way left is to use docker? since RocketLauncher doesnt takes any arguments.

TH3AL3X commented 4 years ago

I have the same problem

Eiromplays commented 4 years ago

So I will need to switch to docker or?

KyeNormanGill commented 4 years ago

Using

./ServerHelper.sh -NoDefaultConsole -logfile 2>&1 +secureserver/Rocket | tee Servers/Rocket/Server.log

Still console doesn't work, i don't have enough experience with docker to use it for my server. Any ETA on a fix for this?

Trojaner commented 4 years ago

But what do I do if I want to start the RocketMod script with -NoDefaultConsole?

You can't, it's that simple.

so for the linux users only way left is to use docker? since RocketLauncher doesnt takes any arguments.

So I will need to switch to docker or?

No one ever claimed you must use docker?!

./ServerHelper.sh -NoDefaultConsole -logfile 2>&1 +secureserver/Rocket | tee Servers/Rocket/Server.log

What exactly does not work? Did you also use export TERM=xterm before that?

There seems to be a misunderstanding that RocketLauncher is required to use RocketMod. This isn't and was never the case. All what the RocketLauncher does is provide console output (not even input, which is handled by Unity itself). The commands with ServerHelper and -logfile 2>&1 replace this functionality.

aman7 commented 4 years ago

which file is calling ./ServerHelper.sh, i dont see it in my Start.sh `#!/bin/bash GAME_INSTALL_DIR="$PWD" server=$1

cd $GAME_INSTALL_DIR ulimit -n 2048 LD_LIBRARY_PATH=$GAME_INSTALL_DIR/lib64:$GAME_INSTALL_DIR/Unturned_Headless/Plugins/x86_64 mono Rocket.Unturned.Launcher.exe $1 `

Trojaner commented 4 years ago

You are using the RocketLauncher which is not using ServerHelper...

aman7 commented 4 years ago

so what is the other way to use ServerHelper and not the RocketLauncher. what should be the Start script.

Trojaner commented 4 years ago

I have posted the related start commands at least 2 times facepalm

gegtor commented 4 years ago
senpai@scw-gifted-goldberg:~/Unturned_Server$ ./ServerHelper.sh -NoDefaultConsole +secureserver/SV1
Set current directory to /home/senpai/Unturned_Server
Found path: /home/senpai/Unturned_Server/Unturned_Headless.x86_64
Mono path[0] = '/home/senpai/Unturned_Server/Unturned_Headless_Data/Managed'
Mono config path = '/home/senpai/Unturned_Server/Unturned_Headless_Data/MonoBleedingEdge/etc'
Preloaded 'libsteam_api.so'
Preloaded 'steamclient.so'
Logging to /home/senpai/.config/unity3d/Smartly Dressed Games/Unturned/Player.log
CAppInfoCacheReadFromDiskThread took 10 milliseconds to initialize
CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
Bad thread local
senpai@scw-gifted-goldberg:~/Unturned_Server$

It crashes like this

Trojaner commented 4 years ago

Can you also add -logfile 2>&1 so we can actually get console output. Dont forget to type export TERM=xterm before that.

gegtor commented 4 years ago

./ServerHelper.sh -logifle 2>&1 -NoDefaultConsole +secureserver/SV1

Same thing happens with logfile argument

Trojaner commented 4 years ago

You have a typo in your logfile argument (I apparently wrote it wrong). The output must be different when typed correctly.

Nacho-Neko commented 4 years ago

-logfile 2>&1

gegtor commented 4 years ago

Dumm me i didn't even looked what i'm typing in

Output works now

To be sure i started clean server and it stops here:

[registered] /tphere (Rocket.Unturned.Commands.CommandTphere/tphere)
Other mapping to: Rocket.Unturned.Commands.UnturnedCommands/unadmin / Rocket.Unturned.Commands.CommandUnadmin/unadmin
[registered] /unadmin (Rocket.Unturned.Commands.CommandUnadmin/unadmin)
[registered] /v (Rocket.Unturned.Commands.CommandV/v)
[registered] /vanish (Rocket.Unturned.Commands.CommandVanish/vanish)
This server will automatically save every 1800 seconds
UnloadTime: 1.376000 ms
isHolidayActive called before backend realtime was available!

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Current backend date: 1/1/1970 12:00:42 AM

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Halloween: [10/27/2018 12:00:01 AM, 11/1/2018 11:59:59 PM]

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Christmas: [12/10/2018 12:00:01 AM, 12/31/2018 11:59:59 PM]

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

isHolidayActive called before backend realtime was available!

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Setting up 1 worker threads for Enlighten.
  Thread -> id: 7f89218ed700 -> priority: 1 
Bad thread local
KyeNormanGill commented 4 years ago

Do i run export TERM=xterm as a seperate command before running the server? I did exactly what gegtor did, but input doesn't work. Output was always fine. Just input.

Nacho-Neko commented 4 years ago

@SDGNelson can you modify it back? please

gegtor commented 4 years ago

Okay it seems like i had other server running in the background and that caused the Bad thread local error

It works now

gegtor commented 4 years ago

@KyeNormanGill

Do ~export TERM=xterm Then ~./ServerHelper.sh -logfile 2>&1 -NoDefaultConsole +secureserver/<server-name>

Trojaner commented 4 years ago

I can confirm that console input is currently broken even with -NoDefaultConsole.

Nacho-Neko commented 4 years ago

I hope to cancel this update.

gegtor commented 4 years ago

@HanaForward

There were much worse updates than this

Even if everything is on fire there is no such thing as rollback update for Nelson

aman7 commented 4 years ago

@KyeNormanGill

Do ~export TERM=xterm Then ~./ServerHelper.sh -logfile 2>&1 -NoDefaultConsole +secureserver/<server-name>

are you able to run multiple instance?

Nacho-Neko commented 4 years ago

@gegtor lol just hope Nelson can rollback update hhhh

jatapa commented 4 years ago

@HanaForward no need for that just do what trojaner said it's not that hard

aman7 commented 4 years ago

@HanaForward no need for that just do what trojaner said it's not that hard

good thing is its working, but it crashes when we run more than 1 instance, also console is not working, and nobody have confirmed about the freezing issue. so there should be a patch/rollback/workaround.

Nacho-Neko commented 4 years ago

The servers will freeze right after they are up or after some time and after that nobody can connect to them. same here

Ascivv1 commented 4 years ago

I haven't gotten a single freeze since using > ./ServerHelper.sh -logfile 2>&1 -NoDefaultConsole +secureserver/

Trojaner commented 4 years ago

good thing is its working, but it crashes when we run more than 1 instance

Did you also change the port?

aman7 commented 4 years ago

yes, and as i remember if you start the second instance on same port, it doesnt effect the 1st instance, just 2nd instance doesnt start.

gegtor commented 4 years ago

I can also confirm that no freezes occurred with ./ServerHelper.sh -logfile 2>&1 -NoDefaultConsole +secureserver/

And i also confirm that multiple instances are broken with this script^

Trojaner commented 4 years ago

Posting crash logs would be useful

Mithallas commented 4 years ago

Find it odd that Ascivv1's linux servers are working using trojaner's start script, but everyone else can't host more than one server?