Page 1 of 1

Updates without outages

Posted: Sat Nov 16, 2019 7:21 am
by Nelsona
If we are talking about what needs to be replaced/updated in the server, I think we can convince the server to do a self update based on another folder specially created for this purpose. From there the server takes some files and automatically replaces them when restarting without causing long interruptions the system automatically working with new files when no game is running. As a disadvantage, we only have the fact that the start-ups and scripts from the beginning do not support this scheme, even speaking of this implementation - a small human pause is needed here. If we are talking about replacing mods/textures or other packages conformed to the original and do not want to cause interruptions, we can apply this solution.
A sniper mod that needs to be replaced / added can be done by editing / preparing the INI and U files, and uploading them to the aforementioned update folder. When the reboot time comes, the server moves the new files in seconds and throws them where they need to be directly from the BAT startup / restart script without any further interruption to the update.
I'm not saying that it is absolutely necessary to do this physically, but it would be good to know that we also have such solutions for automating tasks and avoiding headaches.
Let's not forget the main idea: all updates must be pre-tested in a more or less accurate clone of the server to prevent any inconvenience caused by errors, everything that will be set for automatic updates must be checked because otherwise we do not do the right thing...

Re: Updates without outages

Posted: Sat Nov 16, 2019 3:52 pm
by SC]-[WARTZ_{HoF}
That is a good idea.

Re: Updates without outages

Posted: Mon Nov 18, 2019 8:24 pm
by Nelsona
I gotta know if this will require to update every single file type and here we are talking about EXE DLL too not only INI INT U UTX UMX UAX UNR at once with listing them - if anyone can witness such a restart, else server will work alone doing updates in seconds before auto-rebooting.
So far I wrote some external batch script targeting a files listing task. Purpose is my check how do it works and what kind of messages are thrown in console.

If I'm thinking well, I don't even need the automatic copying of all the files, the INI files are important. In a copy of the server we generate the list of maps that we prepare in this Update. At the first restart we have the available maps without an administrator logged in for reloading the lists, they are already there at once with the scheduled restart. Maps can be copied during run-time as long as their files are not write-protected in any way, we can avoid overwriting files that have multiple versions.

In end all methods are productive and causing less outages for updates and annoying MapVote sorting messages shown to the nice player.

Re: Updates without outages

Posted: Wed Nov 20, 2019 10:32 pm
by Nelsona
This would be the content of the update script without deleting the files in the Update folder. If files are found in the Update folder at the next auto-restart, they will be copied again. It is preferable to be deleted after the automatic update, but here it is only for testing, the final version includes DELETING new files after updating them as they are no longer needed.
  • Code: Select all

    @echo off
    echo === PERFORMING A SCAN INTO UPDATE FOLDER ===
    echo === IF ANY UT RELATED FILES ARE FOUND, ===
    echo === THEY ARE ABOUT TO BE MOVED IN 
    echo === THEIR TARGET LOCATION. ===
    echo === OLD FILES ALREADY IN TARGET PLACE ===
    echo === ARE GOING TO BE REPLACED !!! ===
    echo ============================================
    echo Looking for potential update files.
    echo Looking for INI files that have to be copied/moved into main Folder.
    
    IF exist "..\Update\*.ini" (
    goto INIFiles
    ) ELSE (
    goto NoIniFiles
    )
    
    :CheckINT
    echo Looking for INT files that have to be copied/moved into main Folder.
    IF exist "..\Update\*.int" (
    goto INTFiles
    ) ELSE (
    goto NoINTFiles
    )
    
    :CheckU
    echo Looking for U Packages...
    IF exist "..\Update\*.u" (
    goto UFiles
    ) ELSE (
    goto NoUFiles
    )
    
    :CheckUTX
    echo Looking for UTX Textures files...
    IF exist "..\Update\*.utx" (
    goto UTXFiles
    ) ELSE (
    goto NoUTXFiles
    )
    
    :CheckUMX
    echo Looking for UMX Music files...
    IF exist "..\Update\*.umx" (
    goto UMXFiles
    ) ELSE (
    goto NoUMXFiles
    )
    
    :CheckUAX
    echo Looking for UAX Sound files...
    IF exist "..\Update\*.uax" (
    goto UAXFiles
    ) ELSE (
    goto NoUAXFiles
    )
    
    :CheckUNR
    echo Looking for UNR MAP files...
    IF exist "..\Update\*.unr" (
    goto UNRFiles
    ) ELSE (
    goto NoUNRFiles
    )
    
    :INIFiles
    echo Found some INI files... Here they are...
    dir ..\Update\*.ini
    echo ...
    copy /Y ..\Update\*.ini ..\System\
    goto CheckINT
    
    :NOInifiles
    echo We do not have INI files for server update...
    goto CheckINT
    
    :INTFiles
    echo Found some INT files... Here they are...
    dir ..\Update\*.int
    echo ...
    copy /Y ..\Update\*.int ..\System\ 
    goto CheckU
    
    :NoINTFiles
    echo We do not have INT files for server update...
    goto CheckU
    
    :UFiles
    echo Found U files... Here they are...
    dir ..\Update\*.u
    echo ...
    copy /Y ..\Update\*.u ..\System\
    goto CheckUTX
    
    :NoUFiles
    echo We do not have U files...
    goto CheckUTX
    
    :UTXFiles
    echo Found UTX files... Here they are...
    dir ..\Update\*.utx
    echo ...
    copy /Y ..\Update\*.utx ..\Textures\
    goto CheckUMX
    
    :NoUTXFiles
    echo We do not have UTX files...
    goto CheckUMX
    
    :UMXFiles
    echo Found UMX files... Here they are...
    dir ..\Update\*.umx
    echo ...
    copy /Y ..\Update\*.umx ..\Music\
    goto CheckUAX
    
    :NoUMXFiles
    echo We do not have UMX files...
    goto CheckUAX
    
    :UAXFiles
    echo Found UAX files... Here they are...
    dir ..\Update\*.uax
    echo ...
    copy /Y ..\Update\*.uax ..\Sounds\
    goto CheckUNR
    
    :NoUAXFiles
    echo We do not have UAX files...
    goto CheckUNR
    
    :UNRFiles
    echo Found UNR MAP files... Here they are...
    dir ..\Update\*.unr
    echo ...
    copy /Y ..\Update\*.unr ..\Maps\
    goto Done
    
    :NoUNRFiles
    echo We do not have UNR files...
    goto Done
    
    :Done
    echo Update checks have been ended.
    :EOF
    
Of course, we have different folders paths declared in the HOF servers and then the script will be written according to the needs of the destination server.
This script will probably be called from the boot batch not integrated into it, it will be easier to remove later if it is no longer needed.