How to turn off autosave for USB flash install?

Booting, installing, newbie
Message
Author
KJ
Posts: 176
Joined: Thu 20 Jul 2006, 13:29
Location: Above sea level .. about 320m

#16 Post by KJ »

@ Pizzasgood ... Thank you very much.. Works great, adding ">/dev/console" does the trick. Blue dialog window, buttons , all there and working ....also it's clean on the next bootup too.

Thanks for working on this as I've wanting this solution for some time. KJ

KJ
Posts: 176
Joined: Thu 20 Jul 2006, 13:29
Location: Above sea level .. about 320m

#17 Post by KJ »

@ Pizzasgood FYI ... while running Puppy412 or Fatdog111 the rc.shutdown 13) solution doesn't seem to work the same with some boxes from the WM menu. I run wmreboot and wmpoweroff from icons on the desktop and these work great. On my e140 box shutdown (and reboot) work fine from JWM and IceWM menues, while on my newer Acer laptop menu entries do not work and result in a blank screen requiring the old "push the power button for 5 seconds" shutdown. Will do some more testing. KJ

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#18 Post by Pizzasgood »

It could be that they're running poweroff and reboot directly rather than going through wmpoweroff and wmreboot like they should.

Maybe if you add some code to the poweroff and reboot scripts to detect if X is running, and if so use the wmpoweroff/wmreboot options.

For example, /sbin/poweroff would become:

Code: Select all

#!/bin/sh
X_RUNNING="$(ps -Ao comm | grep '^X$')"
if [ "$X_RUNNING" ]; then
  exec wmpoweroff
else
  /etc/rc.d/rc.shutdown
  exec /bin/busybox poweroff
fi
And /sbin/reboot would be:

Code: Select all

#!/bin/sh
X_RUNNING="$(ps -Ao comm | grep '^X$')"
if [ "$X_RUNNING" ]; then
  exec wmreboot
else
  /etc/rc.d/rc.shutdown
  exec /bin/busybox reboot
fi

If those work, it could help reduce some confusion new users get due to not knowing about the wmreboot/wmpoweroff options.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

KJ
Posts: 176
Joined: Thu 20 Jul 2006, 13:29
Location: Above sea level .. about 320m

#19 Post by KJ »

@ Pizzasgood .... FYI ...Haven't gotten to work on this much lately but finally back got to it. I started over with new Puppy_save.2fs files on Puppy410, 412 and FatDog111. I added your re.shutdown 13) patch and your new sbin/poweroff and reboot files. All three shutdown and reboot with the blue background "save session?" dialog window. All three versions work great on two different computers.

FatDog111's default WM is Openbox and shutdown works fine with both Openbox and JWM.

Looks like most of the odd shutdown problems I've noted lately are now related to IceWM on my dual-core Acer notebook. Icewm shutdown works better on my e140 C7 thin-client.

On my notebook, I've installed two different IceWM versions on to Puppy412s from Pets and both will not shutdown from the menu but will shutdown correctly from a console window or a desktop link icon. Most interestingly, after installing IceWM, JWM will no longer shutdown from the menu. Blackscreen from both reboot and poweroff from menu. This behavior seems related to the modified shutdown procedures as they both work OK with the original files. Don't have access to the e140 until the weekend but I'm reasonably sure that IceWM and your file changes work fine on it with FatDog111 and Puppy412.

Looks like your changes are real keepers.
Keep up the good work ... Thanks.

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#20 Post by Pizzasgood »

Most interestingly, after installing IceWM, JWM will no longer shutdown from the menu. Blackscreen from both reboot and poweroff from menu.
Do you mean that after choosing to shutdown, the screen just goes black and sits, or that it proceeds through the normal shutdown procedure and just doesn't power down the machine in the end?

Try looking in /root/.icewm/menu to see how they implemented shutdown. If they added their own custom shutdown menu entry, that entry will define the script to be run. If they have it using IceWM's shutdown option, the command it runs should be defined in /root/.icewm/preferences.

You may also be interested in manually extracting that IceWM package to see if it's modifying things that it shouldn't. IceWM itself is a very small and simple thing, but I've seen some IceWM packages that would make Rube Goldberg proud.

.pet packages can be opened like this:

Code: Select all

pet2tgz some_package.pet
tar xf some_package.tar.gz
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

KJ
Posts: 176
Joined: Thu 20 Jul 2006, 13:29
Location: Above sea level .. about 320m

#21 Post by KJ »

Blackscreen (crash) only happens on my laptop. Nothing is saved and a powerbutton holddown is required.

Your modified shutdown files work great on both of my other (older) boxes with JWM, Openbox, and IceWM running Puppy410, 412, andFatDog111. Shutdown/reboot work from from menus, rxvt windows and desktop links to /usr/X11R7/bin/XXXX with all three WMs

Normally shutdown works on my laptop but not quite right as with most newer puppy versions I don't see the "saving session to puppy-saveXXX" message and just see the usb flash drive usage LED flashing for the save and then the laptop powers off.

As for the IceWM files, menu entries are the standard:

prog "Reboot" mini-turn wmreboot
prog "Shutdown" shutdown24 wmpoweroff

and preferences are the standard:

# Command to shutdown the system
ShutdownCommand="wmpoweroff"

# Command to reboot the system
RebootCommand="wmreboot"

I have tried using the fill path name /usr/X11R7/bin/XXXX in both statements but that doesn't help.

On this laptop, All WMs shutdown from the menu without the modified shutdown scripts. If I am running IceWM using the modified scripts shutdown from the menu will fail (blackscreen), and if I use the menu to change WM to JWM that too will fail to shutdown(blackscreen). However, if I use ctl,alt,bksp and start a different WM from there, then JWM or Openbox will shutdown correctly from the menu with the modified shutdown scripts. Confusing. All WMs will shutdown correctly from the rxvt window or from an desktop icon hooked to /usr/X11R7/bin/wmpoweroff just not from IceWM menu.

I'll take a look at the icewm.pet files as you suggested next as I didn't know how to do that.

Thanks for you help ... KJ

KJ
Posts: 176
Joined: Thu 20 Jul 2006, 13:29
Location: Above sea level .. about 320m

#22 Post by KJ »

@Pizzsgood FYI .... I am now running puppy 4.2 (bootable usb flash drive) with your modified shutdown scripts. JWM and IceWM reboot and shutdown from the menu correctly (save and no-save conditions) even on my quirky acer laptop. I have been playing with this for only an hour or so but your scripts seem to work rock solid with 4.2. Thanks KJ

User avatar
tgeer43
Posts: 45
Joined: Fri 22 May 2009, 04:08

Re: How to turn off autosave for USB flash install?

#23 Post by tgeer43 »

Thanks again Pizzasgood.

Funny thing, though... The first time I tried the rc.shutdown edit in your earlier post in this thread I chose 'NO' to the pup_save prompt and upon restarting I got a message stating that X had not exited cleanly on the prior shutdown. I chose 'Ignore' and everything was OK. Repeated the process with the same result. I then tried answering 'NO' during a shutdown rather than reboot and no error message. Also, choosing 'YES' to the save prompt produced no error message whether rebooting or shutting down. Very strange indeed. I was just getting ready to post an inquiry here when the problem disappeared altogether. I can now choose either 'YES' or 'NO' when rebooting or shutting down and everything works as advertised. I didn't change anything. It just started working. :?

Anyway, good work buddy - keep it up.

tgeer

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#24 Post by DaveS »

KJ, fell over this thread today, dont know if you are still monitoring it, but if you are I notice your underlying problem is your pup_save file slowly filling for no reason. I have had similar problems and solved it as follows: firstly, force a filesystem check on boot. It only adds about 5 secs if the save file is smallish, 256/512 MB. This makes a big difference. Secondly, drag your /root/.mozilla directory from your flash drive to your hard drive, then symlink it back. Of course, hard drive must be mounted. I use a little script in /root/startup to mount the HD on boot. This has the advantage of effectively making your email/browser stuff available to any USB you care to plug in. It is the /root/mozilla directory that grows and grows. Set up like this, my flash pup_save only fills if I deliberately add something.
I guess technically, you could create two partitions on the flash drive and do the .mozilla trick to one of them to keep everything in the same place, which would again put .mozilla outside the save file.
Spup Frugal HD and USB
Root forever!

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#25 Post by DaveS »

I am interested to know just what it is that gets saved during a 'save' event. Is it only changes made to the op system, or is it every change made, including to documents created in say Abi as well? This for a frugal install on a USB flash drive.
Spup Frugal HD and USB
Root forever!

User avatar
tgeer43
Posts: 45
Joined: Fri 22 May 2009, 04:08

Re: How to turn off autosave for USB flash install?

#26 Post by tgeer43 »

I haven't found anything yet that it doesn't save. No different than a full HD install except everything's saved at once.

tgeer

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#27 Post by DaveS »

I can add a little more here. Further experimentation shows that if I create an Abiword (or some such) document, and save it to the USB flash save file, say in 'my-documents' or similar and then shut down without using a 'save' event, the document is lost, BUT, if I save it to somewhere on the machines hard drive, it is retained. Interesting, especially as I usually work this way. Now I must try saving to the USB, but OUTSIDE of the save file, see if I get the same result. BTW, I also get the Xorg error message, but it has not gone away yet. Odd.
Spup Frugal HD and USB
Root forever!

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#28 Post by DaveS »

Can confirm that saving outside of the pup_save file is not affected by this, ie, work is always saved regardless of shutdown 'save' event PROVIDED the file is saved outside the pup_save file.
Spup Frugal HD and USB
Root forever!

Post Reply