Save or not at shutdown - the real possibility of choice

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
por01
White ninja
White ninja
Posts: 18
Joined: 19 Apr 2018, 14:17
Distribution: Porteus LXDE 4.0 x86_64

Save or not at shutdown - the real possibility of choice

Post#1 by por01 » 20 Apr 2018, 00:45

This is not really a bug report, but it is a bug if we consider bug a function that does not do what it should do really.

"Accidentaly," I observed in /mnt/live/cleanup file the following:

Code: Select all

# Save 'changes=EXIT:' session:
if [ -e /tmp/changes-exit ]; then
    echo -e "Your session will be saved in [1;33m3[0m seconds.\nPress space/enter to start doing it now or any other key to skip."; x=3
    while [ $x -gt 0 ]; do read -s -t1 -n1 ans && break || sleep 1; let x=x-1; done
So, at shutdown this message appears, and we have 3 seconds to press "any other key" to prevent saving the changes. Only I am sure the an average user does not even notice this message, and even he notices, he should be very vigilant and fast to be able to make a good decision. Why is this a problem for me? Because if you have a well set system, in most of the cases, there is no any reason to save the changes at shutdown, to wear your storage device...

I edited the file: replaced the above code with the following:

Code: Select all

# Save 'changes=EXIT:' session:
if [ -e /tmp/changes-exit ]; then
    echo -e "Do you want to save your session?\nPress space/enter if yes or any other key to skip."
    read -rsn1 ans
But /mnt/live/cleanup file is not saved when using persistence. So, I entered into /../../changes/etc/rc.d/rc-local file:

Code: Select all

sed -i '/Your session will be saved/c\    echo -e \"Do you want to save your session?\\nPress space/enter if yes or any other key to skip.\"' /mnt/live/cleanup

sed -i '/do read -s -t1 -n1 ans/c\    read -rsn1 ans' /mnt/live/cleanup

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Save or not at shutdown - the real possibility of choice

Post#2 by Ed_P » 20 Apr 2018, 01:24

Actually I have been using the changes=EXIT cheatcode for years and am therefore well aware of the 3 second prompt. When I am experimenting with the system and don't want anything I've done changed I look forward to the prompt to eliminate anything I may have screwed up. Otherwise I go get something to drink and let the system shutdown or restart.

Your script changes look interesting. I may play around with them or just changing the 3 to a 5 might be helpful for me. :)

Your change is a improvement for those that may be interested in such a change rather than a bug as such I am moving this to the Development section. ;)
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Save or not at shutdown - the real possibility of choice

Post#3 by brokenman » 21 Apr 2018, 13:41

Only I am sure the an average user does not even notice this message, and even he notices, he should be very vigilant and fast to be able to make a good decision.
If the user didn't open the configuration file and type in the cheatcode to save on exit then the 3 second message wouldn't appear. This only appears for people that opted for the changes on exit method and it offers them a last second 'opt out' of saving changes in case they made a mistake. We used to have a pause but for various reasons decided to no longer pause during boot/shutdown.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply