Assume I have a CI app that does the following:
- Allow users to log in and perform certain tasks
- Constantly have cron running scripts in the background
Now, say I need to do some upgrades to the site. How do I do this safely? I don’t want to shut down the server while users are logged in or cron script still running.
I could set a flag in the DB so that the login page will no longer let people log in. This flag can also be used to tell cron script to stop running more processes. The problem is how do I know if there are still users logged in or scripts still running in the background?
Suggestions?