rocky-linux / rocky-tools

MIT License
401 stars 139 forks source link

[Feature Request:] Warn/Prevent disconnected SSH/Cockpit running of script (i.e. Decrease boneheaded idiocity) #149

Closed gah242s closed 2 years ago

gah242s commented 2 years ago

Don't know if there is a way to detect if the script is running from a terminal, but with a Terminal window available in Cockpit, it's possible to destroy the box simply. The problem is, Cockpit gets restarted during the upgrade process, thus killing the Terminal session. Initiating a 'screen' session, or similar, as the first step in running the script would prevent such failed upgrades.

pajamian commented 2 years ago

I'm not sure if it's appropriate for migrate2rocky to try to detect this, but we can at least add some text to the known issues section of the README file to address this. Running migrate2rocky in a screen or tmux session should be recommended anyways.

gah242s commented 2 years ago

That would certainly be simpler. It should be common sense for anyone with experience, but with Cockpit being a relatively new feature, it's a simple mistake. (And if it wasn't clear before, been there, done that, cleaning up now.)

gah242s commented 2 years ago

Here's a potential PR: https://github.com/rocky-linux/rocky-tools/pull/150

gah242s commented 2 years ago

As this touched a different section of the document, I went ahead and submitted a separate PR: https://github.com/rocky-linux/rocky-tools/pull/151

pajamian commented 2 years ago

All looks good to me. thanks for the PRs!