How to logout all active users? Instead of putting my site in "maintenance mode" I would like to put it in a complete "readonly mode". There is a module for that, however, it only prevents "node add and edit".
I would like to prevent all user activity including login and registration to basically have the site get served from the (varnish) cache. As as side benefit I would use this type of "read only mode" if the site gets flooded with requests.

My question: how can I logout all active users? The login and registrations I can then redirect with a hook.
As far as I know you can empty the sessions table and all users will be logged out. There may be an issue though, depending on the modules that you have installed. For example, modules that implement hook_user_logout() will never get their actions fired, which could be an issue. Check to make sure none of your installed modules is implementing this hook.