On 04/14/2017 12:45 PM, Carlos E. R. wrote:
Hi,
Do we have a method so that halt, reboot, suspend, hibernate operations are disabled? Requiring a secondary confirmation or removal of the inhibit?
Scenario: ssh to server. I can accidentally type the wrong command to the wrong session and thus disable the server. If I'm local restoring is easy, but not if remote.
Happened already once (I was local).
Creating a lock (an 'inhibitor') with a process on boot blocking reboot or shutdown until removed looks possible, Here is the verbiage from the 'man systemctl' regarding the '--ignore-inhibitors' option: -i, --ignore-inhibitors When system shutdown or a sleep state is requested, ignore inhibitor locks. Applications can establish inhibitor locks to avoid that certain important operations (such as CD burning or suchlike) are interrupted by system shutdown or a sleep state. Any user may take these locks and privileged users may override these locks. If any locks are taken, shutdown and sleep state requests will normally fail (regardless of whether privileged or not) and a list of active locks is printed. However, if --ignore-inhibitors is specified, the locks are ignored and not printed, and the operation attempted anyway, possibly requiring additional privileges. -- David C. Rankin, J.D.,P.E.