Why is DC so bad at dealing with its server shutdown?

Why is DC so bad at dealing with its server shutdown?

Why is DC so poorly coded to deal with its own shutdown?

I have DC installed on a single Windows Server 2019 machine, which runs alongside some other server services e.g. a small mail server. On a standard installation of everything including DC, if I simply shut down the server normally on the machine restarting DC is left having to recover it's Postgre databases because they were not shut down cleanly. It can take 30minutes sometimes, yet a clean start is just a few minutes. It's the only service I have this problem with. In desperation this is the shutdown Powershell script I have had to write myself, and deployed by GPO, in order to keep this from happening, and I really shouldn't have to:

Write-Host "Stopping Service" *> C:\StopDesktopCentral.log
Stop-Service DesktopCentralServer *>> C:\StopDesktopCentral.log
Write-Host "Waiting for Postgre control processes to stop" *>> C:\StopDesktopCentral.log
Wait-Process -name pg_ctl *>> C:\StopDesktopCentral.log
Write-Host "Stopping Postgre databases" *>> C:\StopDesktopCentral.log
D:
CD "D:\Program Files\ManageEngine\DesktopCentral_Server\bin"
.\stopDB.bat *>> C:\StopDesktopCentral.log
Write-Host "Waiting for Postgre database processes to stop" *>> C:\StopDesktopCentral.log
Wait-Process -name postgres *>> C:\StopDesktopCentral.log
Get-Process *>> C:\StopDesktopCentral.log

Today I was forced to insert code to include the "stopDB.bat" file because at some point in the past few updates you stopped the Postgre databases from being shutting down when the main DC service is stopped - they remained as running processes so when the server rebooted, they were not stopped cleanly.

Can you please sort out this really basic of all functions of a server? Windows doesn't kill processes on shutdown unless it has to, which in the case of DC is pretty much what it has to do because you haven't done your job, and DC should be better than this by using proper services for Postgre not spawned ones from Java. This isn't 1999.

                New to ADSelfService Plus?