Windows has something called the ShutdownBlockReasonCreate API which enables apps with long running operations to prevent a shutdown to avoid corruption or losing work.
Is there an equivalent for Linux? When used appropriately, it makes shut downs even more graceful.






Are you trying to make an offline website? If so, you could look into using a Service Worker which would give you full control over when the content gets refreshed.