patrix87 / PowerShellGSM

A Comprehensive PowerShell Tool for Simple Automated Game Server Management.
https://github.com/patrix87/PowerShellGSM/
MIT License
111 stars 19 forks source link

Ark survival ascended server: daily reboot problem #31

Closed TOXid closed 11 months ago

TOXid commented 11 months ago

Automatic daily reboot does not work if the warning time is set to be greater than the task update time.

Timers = [System.Collections.ArrayList]@(1140, 600, 60)

With such a timer, the server sends only the first warning to the chat and then the next time the task is launched in the scheduler, it simply sets a new reboot time without completing the current task.

Verifying Dependencies...
Importing Server Configuration...
Locking Process.
Running Tasks for ark_survival_ascended ...
Getting Tasks Schedule...
Checking Alive State
Server is Alive
Updating Tasks Schedule...
Too soon for Update check
Server is due for Restart
Updating Tasks Schedule...
Verifying Server installation...
Verifying Server State...
Command Sent.
Server is responding to remote messages.
Server is running, warning users about upcomming restart.
Command Sent.
Waiting 1140 seconds before next warning...

This stops the execution of the script.

patrix87 commented 11 months ago

When the script launches it should create a lock file preventing any other instanced of the script to start. 30 minutes might be above the expiry threshold of the lock file.

patrix87 commented 11 months ago

Edit this value :

https://github.com/patrix87/PowerShellGSM/blob/98dfc698cc8bc6558f9947bfc967d9f813d92095/global.psm1#L48

TOXid commented 11 months ago

It did not help. It looks like the reboot script simply stops working after 5 minutes, or when the task starts. I set the reboot to 5:00. At 5:00

Verifying Dependencies...
Importing Server Configuration...
Locking Process.
Running Tasks for ark_survival_ascended ...
Getting Tasks Schedule...
Too soon for Alive check
Too soon for Update check
Server is due for Restart
Updating Tasks Schedule...
Verifying Server installation...
Verifying Server State...
Command Sent.
Server is responding to remote messages.
Server is running, warning users about upcomming restart.
Command Sent.
Waiting 1140 seconds before next warning...

And then every 5 minutes for a 35 minute lock:

**********************
PS>TerminatingError(): "System error."
**********************

The daily reboot cycle never completed. So at some point the reboot script simply stops working, perhaps you need to initialize the launch of the run.cmd file, it reboots correctly with a 30-minute cooldown.