Open ilario opened 7 years ago
In case you don't know what safe-reboot
is:
is this thing:
When you run $(PKG_NAME) specifying a grace time, it makes a backup of /etc at that point,
and after the grace time reboots the system. At the next boot, it waits again for a timeout;
if you can't login and delete the backup, it will restore it and reboot.
This mechanism makes it possible to run $(PKG_NAME), try risky operations (like restarting
the network), and if something goes wrong, just wait for the fallback timeout.
Even more, you can make actual changes to /etc config and reboot. If it comes back up right,
you can login and delete the backup. If something went wrong with the new /etc, just wait
for the revert timeout.
If safe-reboot is running it is hard, even for the same user that is using it, to know when it will reboot the system.
It would be great if it can notify all users connected that it will reboot the system and how to prevent it or react to it.
I think it could be added here: https://github.com/libremesh/lime-packages/blob/feb3b8996fe8e008ff391dd6feef9a6f11225dfa/packages/safe-reboot/files/usr/sbin/safe-reboot#L100
This is the function that it could use to notify:
function message_to_all_loggedin_users {
message="$1";
for pts in `ls /dev/pts/`; do
echo "$message" > /dev/pts/$pts;
done;
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When safe-reboot is activated:
/etc/banner.notes
to remind the user to issue eithersafe-reboot cancel
orsafe-reboot discard
;These warnings should be deleted when safe-reboot is stopped (with safe-reboot cancel or discard commands).