Comcast / Bynar

Server remediation as a service
Apache License 2.0
58 stars 13 forks source link

Maintenance Mode #59

Open cholcombe973 opened 5 years ago

cholcombe973 commented 5 years ago

Anything better we can come up with besides just disabling the cron job while maintenance is being performed on a server?

sdandam commented 5 years ago

Other alternatives are a) store a flag in the database b) A lock on the shared file (if read-only file system this will not work) API need to be exposed to a) write the flag to database. b) remove the flag. Bynar needs to re-evaluate if flag set is for too long.

lcao0319 commented 5 years ago

We may need to following changes:

If we go with the DB-centric way: Use Case: Set to Maintenance

  1. Upon receiving a setMaintenance message, the daemon will call the SQL DB to set the 'status' column to "maintenance" or some string.
  2. Whenever the daemon accepts a request, it will then check the SQL db to see if itself is in maintenance mode, if so, log it and get out without doing anything (ignore all request).

Use Case: Unset Maintenance

  1. Upon receiving a unsetMaintenance message, the daemon will call the SQL DB to set the status back to "running"(?)
    1. From then on, the daemon will perform usual duties to check disks/etc as usual.