[eluser]WanWizard[/eluser]
I have a maintenance flag in my configuration (which I load from the database and merge with the config loaded from file).
In my code I test this flag before I restore the user session, so whether or not a user is logged in is not relevant. The next page request hits the maintenance code first.
My cron functions (=module controllers) are all managed by a cron controller, which uses a crontab like database table to determine which jobs to start when, and also logs the state of each job. Only the cron controller itself is started by the OS cron process. So I always know which jobs are currently active, and when they were started. This also allows multiple instances of the cron process, if I want to enable multiple parallel cron processes.