Sign in to follow this  
LeBigMario172

Server not launching when auto updating but launch when someone updates it manually !

Recommended Posts

I made a server not long ago for a friend's discord server and i'm still managing it today. Here's the problem i have today.

I have scheduled an update script to launch everyday at 8AM which would first update the server, then update the mods, relaunch the server afterward and regenerate the world. Problem is, every time it tries to do all of this automatically, the server won't start. But it does start whenever I connect and launch the update script myself. I'm kinda stuck in an endless loop here.

 

Here's the update script:

ServerUpdate.thumb.PNG.2cce73bedf6ccf1a1a0421559af40dcf.PNG

Here's the logs i got from today:

For the master server:

Logs Master.txt

For the caves server:

Logs Caves.txt

 

If anyone got any idea on what the problem could be i would really apreciate it. I've been looking for an answer in so long but i guess google couldn't help me there.

Share this post


Link to post
Share on other sites
Daniel86268    383

Whenever something works when running as your user, and doesn't when launched automaticially, check if the service you are using has the same, or at least the necessary environmental variables configured.

Share this post


Link to post
Share on other sites

I'm guessing it has the same environmental variables configured since the update scripts does launch automatically and works sometimes, but it happens like 1/5 times. The other times, it fails and i have to do it myself.

Share this post


Link to post
Share on other sites

After quite some time, i finally managed to fix the problem. I'm still a little confused on what was the problem, but I have some ideas now.

The problem was in my update scripts. Turns out that the script did work automatically when the server was off, so in my opinion, it had either to with the way i closed the servers before updating them or the lack of pause in the script, making it probably update before the server was completely turned off.

 

I modificated the base of the script by:

-adding a 30 second delay before stopping the server while announcing in the server that it would stop for an update

-making it so the server will close normally like if someone would have manually put the "c_shutdown()" command in both servers

-removing the server launch with the -only_update_mods config that I thought would update my mods (spoiler: it was unnecessary, the server automatically does it when starting)

-Adding more pauses in the scripts to make sure it got time to do everything right before continuing

-Adding a little line that would make the server automatically regenerate so that after the daily update, the server start on a fresh world.

 

Here is how the script looks now:

5e6112f355e4c_NewScript.thumb.PNG.72b7d9f77168a48e0a6a9f676fb6ef1d.PNG

 

I hope I was able to help some of you out there suffering from the same issue I had and I wish you all a great day/night depending on the time you read this. =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this