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 01 Sep 2014, 18:23
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Suggestions
Standardise Temp dir for Puppy frugal (outside of savefile)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [16 Posts]   Goto page: 1, 2 Next
Author Message
darkcity


Joined: 23 May 2010
Posts: 2444
Location: near here

PostPosted: Tue 31 Jan 2012, 07:41    Post subject:  Standardise Temp dir for Puppy frugal (outside of savefile)  

Does anyone else thin it would be useful to have a standard temp dir for Puppy outside of the savefile

it is a annoying having to config the temp directory for every program,

may a solution would be to have PupTempDir option,

the default for an installed puppy could be

/mnt/home/tmp

what do people think?

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
Peterm321

Joined: 29 Jan 2009
Posts: 225

PostPosted: Wed 14 Mar 2012, 23:30    Post subject:  

darkcity wrote:
it is a annoying having to config the temp directory for every program,

may a solution would be to have PupTempDir option,

the default for an installed puppy could be

/mnt/home/tmp

what do people think?


Perhaps assigning env variable TMPDIR in /etc/rc.d/rc.sysinit , /etc/rc.d/rc.local or /etc/profile could do this? http://stackoverflow.com/questions/31068/how-do-i-find-the-temp-directory-in-linux
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2444
Location: near here

PostPosted: Fri 16 Mar 2012, 09:21    Post subject:  

That's sounds like a proper way to go Cool

I wonder if Apps would pick up on that, maybe symlink the /tmp dir to /home/tmp Idea

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
Peterm321

Joined: 29 Jan 2009
Posts: 225

PostPosted: Sun 18 Mar 2012, 03:06    Post subject:  

darkcity wrote:
I wonder if Apps would pick up on that, maybe symlink the /tmp dir to /home/tmp


You could see if apps are still opening files in the /tmp directory by using a program like lsof, but if you really want to keep temporary files out of /tmp altogether you may have to change /tmp to a symlink as you suggest. Some programs have /tmp hardcoded. If you change /tmp to a symlink in the middle of a session there may be issues. Probably best to change /tmp, if in fact you decide to do so, at the start of a session and reboot to be on a safer side.
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2444
Location: near here

PostPosted: Sun 18 Mar 2012, 06:54    Post subject:  

I might try and change it before X win is loaded. Thanks for your help Cool
_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sun 18 Mar 2012, 21:26    Post subject:  

I believe that /tmp is outside of the Save file.
Type "df" in rxvt and you`ll see the line:
Code:
tmpfs                   553784       372    553412   1% /tmp

If you put a file in /tmp and reboot it won`t be there.
This is good as /tmp is fast in ram, and the Save file`s slow being on a partition.
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2444
Location: near here

PostPosted: Mon 19 Mar 2012, 11:55    Post subject:  

The trouble is lots of programs put temporary files in /root/

which is inside the savefile - firefox is one example.

why don't use /tmp

---

what I'm trying to avoid is having to configure every program individually to use a location outside the savefile - also beginners won't know to do this. Cool

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Mon 19 Mar 2012, 22:47    Post subject:  

Yep... And links don`t solve the slow Save access. This is a good example of poor programming and Linux`s legacy problems.
It`s a shame industry and the populace need to be told what to do. But obviously they can`t handle it on their own.

I`ve said many times that Linux files need to be organized into read-only and read-write directories.
And the read-write files divided into /tmp and /etc ( more or less...).
Back to top
View user's profile Send private message 
Peterm321

Joined: 29 Jan 2009
Posts: 225

PostPosted: Thu 22 Mar 2012, 05:12    Post subject:  

darkcity wrote:
The trouble is lots of programs put temporary files in /root/

which is inside the savefile - firefox is one example.

why don't use /tmp


I have read that many programs are not writing to /root/ in terms of hardcoding but rather they are writing to the directory stored in environment variable $HOME      Puppy Linux, being essentially a single user system defaults its $HOME to /root. But I think you may find that there is added to most puppy linuxes the "spot" user and there have been discussions in the murga forum about getting it to work with various apps with another home directory such as /mnt/home

http://www.murga-linux.com/puppy/viewtopic.php?search_id=45282452&t=71358
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2444
Location: near here

PostPosted: Tue 29 May 2012, 09:09    Post subject:  

Thanks for the information about Spot Cool

Ideally the solution wouldn't require using a different user.

the problem is separating out what's stored in
/root or $home

ie configuration files, personal files, temp files, data (like bookmarks)

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
Peterm321

Joined: 29 Jan 2009
Posts: 225

PostPosted: Tue 29 May 2012, 15:33    Post subject:  

darkcity wrote:
Ideally the solution wouldn't require using a different user.

the problem is separating out what's stored in
/root or $home

ie configuration files, personal files, temp files, data (like bookmarks)


Well IIRC Firefox (in reference to a pervious post of yours in this thread) uses the "$HOME/.mozilla/firefox" folder. I believe you can also change the profile with the eg "firefox-bin -profile <path>" commandline option.

Redefining $HOME will only affect the current shell and programs started from that shell. If you really want to kill all access to /root which I believe is in the savefile on systems that use a savefile, you can also consider the mount --bind command

Code:
mount --bind <old dir> <new dir>


Example:

Code:
 cp   -a   /root    /tmp
mount --bind  /tmp/root   /root


NB make a copy of your /root (standard $HOME) in your /tmp directory then remap /tmp/root to /root. The effect should be system wide if I read the documentation correctly. Any settings would be lost between reboots unless the settings were synced back to the original /root or $HOME directory.
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2444
Location: near here

PostPosted: Wed 30 May 2012, 05:03    Post subject:  

Thanks for reply, I haven't got time to fully look into at the moment.

The things I want configuration files and things that are part of Puppy in /root but temp and personal file out of it.

I know how to achieve this, however it wouldn't be obvious to a beginner.

Twisted Evil

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Wed 30 May 2012, 16:20    Post subject:  

There is a difference in frugal and full installations having a /tmp dir .

/tmp in frugal mode normally is mounted as tmpfs into RAM, full installs PUPMODE=2 have /tmp mounted on the HD .

just a few links about this theme :

Ubuntu: Want to mount tmpfs on /tmp
/tmp size fix
A big tmp with small memory
Do not delete /tmp/* at shutdown

As for Puppy Lupu-5 :
Lupu uses /sbin/pup_event_backend_modprobe_protect --daemon,
which is nice code, but waits for input via cat /tmp/pipe .
If that connection gets lost for a short time or even mounted read-only for a short time,
that daemon does not work anymore and was able to hang my PC forever waiting for input in /etc/rc.d/rc.sysinit .
Back to top
View user's profile Send private message Visit poster's website 
darkcity


Joined: 23 May 2010
Posts: 2444
Location: near here

PostPosted: Wed 30 May 2012, 16:49    Post subject:  

should programs use /tmp by default then?

what about media programs that have big files?

does swp come into it?

need to look into pupmodes more . . .

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Wed 30 May 2012, 17:22    Post subject:  

Yes it seems there is some confusion on using the term "/tmp" on Puppy .

There is a difference in /initrd/pup_rw as temporary main folder and the simple /tmp directory .

/initrd/pup_rw acts on flash PUPMODE=13 as tmp directory in RAM .
tmp in the meaning of temporary until flushed to the save file by /sbin/pup_event_frontend_d running /usr/sbin/snapmergepuppy
every minutes defined by
/usr/sbin/eventmanager with variables stored in /etc/eventmanger configuration file .

I post the
Code:
mount |grep tmp
of saluki-19
Code:
source /etc/rc.d/PUPSTATE && echo $PUPMODE
12
as example :

tmpfs on /tmp type tmpfs (rw,relatime,size=1047368k)
shmfs on /dev/shm type tmpfs (rw,relatime,size=247096k)

The /init of initrd.gz and /etc/rc.s/rc.sysinit are responsible for calculating sizes .
free is showing
Mem: 1025304 total
Swap: 3164152 total

On PUPMODE=12 the save file is mounted as
/dev/loop1 on /initrd/pup_rw type ext4 (rw,noatime,user_xattr,barrier=1,data=ordered)

NOT temporary as on flash and writes like downloads go directly into the save-file and not to RAM first .

(shinobar has found a solution by directing seamonkey dl to some folder on partition by altering the seamonkey preferences i think)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [16 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Taking the Puppy out for a walk » Suggestions
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.0813s ][ Queries: 12 (0.0034s) ][ GZIP on ]