Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 15 Oct 2018, 07:31
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Shutdown without Save
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
glene77is


Joined: 17 Aug 2010
Posts: 136
Location: Memphis, TN, USA

PostPosted: Sat 03 Mar 2012, 09:42    Post subject:  Shutdown without Save  

Guys,

Along the lines of the TinyCore Shutdown GUI,

I would like to execute a system shutdown
without automatic Save to pupsave.2fs.

Rolling Eyes the PupShutdown app does not offer this option.

_________________
Puppy Linux is more fun than a barrel of M$ monkeys Razz
glene77is --- {^,^} --- electricity is shocking, Memphis, TN, USA.
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13038
Location: Arizona USA

PostPosted: Sat 03 Mar 2012, 10:36    Post subject:  

If you run Puppy from a multisession DVD like I do, you can just shut off the power to the computer. Smile
Back to top
View user's profile Send private message 
glene77is


Joined: 17 Aug 2010
Posts: 136
Location: Memphis, TN, USA

PostPosted: Sat 03 Mar 2012, 15:04    Post subject:  

Flash,
I run Puppy Linux from a pendrive, almost all the time.
So, just shut off power. right! Shocked
I was hoping someone knew of a script that skipped the 'save' function. Razz

_________________
Puppy Linux is more fun than a barrel of M$ monkeys Razz
glene77is --- {^,^} --- electricity is shocking, Memphis, TN, USA.
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13038
Location: Arizona USA

PostPosted: Sat 03 Mar 2012, 15:32    Post subject:  

glene77is wrote:
...I was hoping someone knew of a script that skipped the 'save' function. Razz

There is a way to do what you want. I believe there are several recent threads about it. I've never needed it because I never ran Puppy from a USB Flash stick.
Back to top
View user's profile Send private message 
CatDude


Joined: 03 Jan 2007
Posts: 1570
Location: UK

PostPosted: Sat 03 Mar 2012, 16:24    Post subject: Shutdown without Save  

Hello glene77is

Maybe this is what you are looking for
Be sure to read the post by walter90 further down the same page.

Hope this helps
CatDude
.

_________________

Back to top
View user's profile Send private message 
glene77is


Joined: 17 Aug 2010
Posts: 136
Location: Memphis, TN, USA

PostPosted: Sat 03 Mar 2012, 17:10    Post subject:  

Smile Catdude and Flash,
Thanks for the comments.
Have tried running rc.shutdown directly,
then it locks up,
then do a power-off.
Very poor hack approach, but I am not well versed in BASH scripting.

rc.shutdown is written by an expert, B.Kauler.
Is as complex as any app I ever wrote (in my own language).

So, I'll check your suggestions.
Mostly it is a curiosity thing, having run TinyCore off-on for a while.

(Did have fun getting "boot_info_script" to rename the output file
and then call geany to edit it.)
(And tinkered extensively with the grub4dos menu routines.)
Smile

_________________
Puppy Linux is more fun than a barrel of M$ monkeys Razz
glene77is --- {^,^} --- electricity is shocking, Memphis, TN, USA.
Back to top
View user's profile Send private message Visit poster's website 
glene77is


Joined: 17 Aug 2010
Posts: 136
Location: Memphis, TN, USA

PostPosted: Sat 03 Mar 2012, 18:03    Post subject:  

Catdude

The code looks fine.
Can't read the fine-print, but it looks right.

I commented-out the line of code, as in your example #1.
I placed a somefile at the base directory as /somefile.
Then activated the RedFace icon in lower left and selected Shutdown,
and selected Reboot,
and the test file was saved, anyway.

Well, this is great fun.
When I have learned some more about Bash and the hoops Puppy jumps through to do a shutdown, then I might figure it out.
Smile
Right now, I should get back to work.

_________________
Puppy Linux is more fun than a barrel of M$ monkeys Razz
glene77is --- {^,^} --- electricity is shocking, Memphis, TN, USA.
Back to top
View user's profile Send private message Visit poster's website 
CatDude


Joined: 03 Jan 2007
Posts: 1570
Location: UK

PostPosted: Sun 04 Mar 2012, 09:07    Post subject:  

Hello glene77is

glene77is wrote:
..I commented-out the line of code, as in your example #1.
I placed a somefile at the base directory as /somefile.
Then activated the RedFace icon in lower left and selected Shutdown,
and selected Reboot,
and the test file was saved, anyway.


Maybe you commented out the wrong line ?

When you did a search for the string:
Code:
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw

you will actually find 3 such strings (in Lupu-525 anyway).

The one that concerns you (running from a flash drive)
is the one for pupmode 13

I just did a quick test using Lupu-525
and the block i changed in the: /etc/rc.d/rc.shutdown script

Was this:
Code:
 13) #PDEV1 and PUPSFS and PUPSAVE
  #/initrd/pup_rw has tmpfs, pup_ro1 has ${DISTRO_FILE_PREFIX}save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
  #the above are in unionfs at /.
  echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
  /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
  ;;


Which i changed to this:
Code:
 13) #PDEV1 and PUPSFS and PUPSAVE
  #/initrd/pup_rw has tmpfs, pup_ro1 has ${DISTRO_FILE_PREFIX}save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
  #the above are in unionfs at /.
  dialog --yesno "Save this session?" 0 0 >/dev/console
  if [ $? -eq 0 ]; then
  echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
  /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
  fi
  ;;


After i had saved that change, i restarted the X server
then rebooted.

I was then given the option of whether or not to save that session (see image below)

Don't forget, if you do not want puppy automatically saving every 30 minutes,
you need to change the settings in the: Desktop drive icons manager
as per my second link in earlier post. (see image below)


Hope this helps
CatDude
.
yes-or-no.jpg
 Description   
 Filesize   21.46 KB
 Viewed   1151 Time(s)

yes-or-no.jpg

save-interval.png
 Description   
 Filesize   85.14 KB
 Viewed   1141 Time(s)

save-interval.png


_________________

Back to top
View user's profile Send private message 
glene77is


Joined: 17 Aug 2010
Posts: 136
Location: Memphis, TN, USA

PostPosted: Sun 04 Mar 2012, 20:12    Post subject:  

CatDude,
Your help is awesome.
Obviously, You have been around this tree several times.

The error in my implementation came from a case statement like this:

Case
3)

which is a typo. Confused

With a

Case
13)

followed by your code, everything worked, as you expected.

Thanks for your help and the added notes. Laughing
I made a backup copy to
"/mnt/home/lupu_U16_525/usr-share/rc.shutdown_120304"

Friendly pass-along about how I installed Puppy on my pendrives.
My "/mnt/home/lupu_U16_525" (for my 16GB pendrive) contains
(1) the lupu OS kernels and lupusave.2fs,
(2) a "/usr-share" subdir which contains
--(a) my custom menu code,
--(b) a file called "BookMark_Alpha.html"
[ which I assign as my "home-page" in "IRON"
[ (under the little 'house' icon [containing a fancy page of 'favorite' URLs.
I keep /pmagic [PartedMagic install, per P. Verner] in /mnt/home, also.
When setting up a new pendrive or HDD,
I copy the /lupu_U16_525 across, then run grub4dos and upgrade menu.lst.

Cool Puppy Linux is cool.
If I ever learn how to make Python work,
then I can begin transferring my apps from M$-VFP-SQL to Linux.Py.sql .

_________________
Puppy Linux is more fun than a barrel of M$ monkeys Razz
glene77is --- {^,^} --- electricity is shocking, Memphis, TN, USA.
Back to top
View user's profile Send private message Visit poster's website 
glene77is


Joined: 17 Aug 2010
Posts: 136
Location: Memphis, TN, USA

PostPosted: Wed 25 Jul 2018, 20:25    Post subject: Shutdown without Save
Subject description: Shutdown without Save
 

to CatDude ,

Your help from Sun 04 Mar 2012 was awesome.
Obviously, You have been around this tree several times.

Really kick-started me into manipulating BASH.
Thanks for your efforts.

Now using XenialPup 7.0.8
and find it very interesting.
Have been tracing subroutine usage
and doing programmer documentation.

At first it was confusing that so many subroutines
were written right "in-line" , rather than grouped at the 'top of code'.
I guess that was so they would be more visible
when working with the code which called the subroutine.

I still find some of the BASH code is written at an expert level,
and the syntax is obscure.
Still refer to the BASH manual constantly.

Still the familiar Puppy API methodology
makes it easier to work.

cul

_________________
Puppy Linux is more fun than a barrel of M$ monkeys Razz
glene77is --- {^,^} --- electricity is shocking, Memphis, TN, USA.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1291s ][ Queries: 13 (0.0145s) ][ GZIP on ]