AFAIK you can enable a 'before shutdown' microflow which will be executed before the server shuts down.
Not sure if this is what you're looking for, but it might get you somewhere!
The rollback is most likely due to the fact that the transactions could not be finished, therefore if you don't rollback it would possibly create corrupt data. The only method to prevent this is to inform all of your users to logout well before the server goes down for maintenance.