Sometimes a server will start showing some kind of hardware failures, not disabling its functionalities, but requiring hands-on presence (it could be days to reach, if remote post).
In some such cases, the server must be kept on to preserve some inner state: it cannot be powered off, nor restarted, but at the same time, it must be put in a state as idle as possible, trying to keep it on until tech arrive.
Currently we manually disable all services, including databases, syslog, etc. Sometimes they are several dozens, and we must keep a tab on what was on or off.
I am aware of this, but it does not help much.
Is there a way to do this programmatically, keeping a record of what was enabled so to restart such services properly if server condition improves?
I am interested in an answer for any OS, but possibly also regarding illumos-based OS on-the-metal (SmartOS / OmniOS), as this is the setup we are using.