locked
Reboot web server when application server updated/rebooted RRS feed

  • Question

  • We have server environments where a web server depends on an application server, if the application server is rebooted the web server needs to be rebooted after the application server is back up, so as to reconnect.

    In respect to windows updates being applied automatically.  Does anyone have an automated process configured to reboot a web server following on from an application server that it depends on being rebooted?

    My current thought is to put a script on the application server which will run on start-up and cause the web server to reboot.  It would be good to restrict this to only after windows updates having completed.

    Regards,

    Pete.

    Thursday, August 8, 2019 12:03 PM

All replies

  • Hi Pete,

    You could create 2 computer groups in WSUS and apply the updates with deadline to each server at a specific time. With deadlines, be advised, the reboot will happen automatically after 15 minutes, more info here:
    https://blogs.technet.microsoft.com/wsus/2013/06/10/managing-updates-with-deadlines-in-an-era-of-automatic-maintenance/

    Thanks,
    Andrei


    We could change the world, if God would give us the source code.

    Thursday, August 8, 2019 7:33 PM
  • Thanks Andrei, definitely one to be explored.

    Regards

    pete.

    Friday, August 9, 2019 10:35 AM
  • If you can find an event in the eventlogs on the web server (like a worker process crash) you could attach a task to it to invoke a bat file to recycle the apps. That would be faster than a reboot and would also cover the situation where someone had to reboot the app server outside of the scheduled maintenance window and it impacted the web server.

    :: Delay to allow the app server time to recover
    sleep 120
    :: Stop all application services
    net stop Application-Services
    :: Force kill any hung app processes
    taskkill -f -im Application.exe 
    :: Restart all application services
    net start Application-Services
    :: Tell IIS to recycle
    iisreset.exe
    :: Alert the team to the event. 
    send email alert to support team 

     
    • Edited by MotoX80 Friday, August 9, 2019 1:05 PM
    Friday, August 9, 2019 12:56 PM
  • Thanks MotoX80, I'll look into that.

    Regards,

    Pete.

    Monday, August 12, 2019 8:15 AM