Standardise Temp dir for Puppy frugal (outside of savefile)
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?
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/3106 ... y-in-linuxdarkcity 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?
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.darkcity wrote:I wonder if Apps would pick up on that, maybe symlink the /tmp dir to /home/tmp
I believe that /tmp is outside of the Save file.
Type "df" in rxvt and you`ll see the line:
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.
Type "df" in rxvt and you`ll see the line:
Code: Select all
tmpfs 553784 372 553412 1% /tmp
This is good as /tmp is fast in ram, and the Save file`s slow being on a partition.
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...).
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...).
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/homedarkcity 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
http://www.murga-linux.com/puppy/viewto ... 52&t=71358
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.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)
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: Select all
mount --bind <old dir> <new dir>
Code: Select all
cp -a /root /tmp
mount --bind /tmp/root /root
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 .
/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 .
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 of saluki-19 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)
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: Select all
mount |grep tmp
Code: Select all
source /etc/rc.d/PUPSTATE && echo $PUPMODE
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)
Now I have booted racy-5.3 in PUPMODE=13 frugal installed on SDCard flash :
"mount |grep tmp" gives :
tmpfs on /initrd/pup_rw type tmpfs (rw,relatime,size=1303776k)
tmpfs on /initrd/mnt/tmpfs type tmpfs (rw,relatime,size=111640k)
shmfs on /dev/shm type tmpfs (rw,relatime,size=192808k)
where all folders on '/' inclusive /tmp are mounted also as /initrd/pup_rw, the top unionfs|aufs layer , so apparently no need to mount the main /tmp folder another time separately . Will have to check if the /tmp folder gets copied to the save file, which i think it shouldn't.
The main puppy_racy_5.3.sfs is copied to /initrd/mnt/tmpfs/ directory :
Q:
A: puppy_racy_5.3.sfs
The devx is not copied to ram .
The save-file is now mounted as :
/dev/loop1 on /initrd/pup_ro1 type ext3 (rw,noatime,errors=continue,barrier=0,data=ordered)
It is a little confusing to call the savefile pup_ro1 : as far as i saw the code, the save-file does not get remount,ro 'ed and remount,rw 'ed when snapmergepuppy is running or when the save at rc.shutdown is made.
The save-file is mounted rw all the time . (A possible risk imho.)
free shows :
Mem : 1025472 total
Swap: 1582076 total
(have disabled one swap in rc.sysinit to be reserved for Resume from Hibernation (which is not possible with stock Puppy kernels by Bk but from pemasu fex.)
"mount |grep tmp" gives :
tmpfs on /initrd/pup_rw type tmpfs (rw,relatime,size=1303776k)
tmpfs on /initrd/mnt/tmpfs type tmpfs (rw,relatime,size=111640k)
shmfs on /dev/shm type tmpfs (rw,relatime,size=192808k)
where all folders on '/' inclusive /tmp are mounted also as /initrd/pup_rw, the top unionfs|aufs layer , so apparently no need to mount the main /tmp folder another time separately . Will have to check if the /tmp folder gets copied to the save file, which i think it shouldn't.
The main puppy_racy_5.3.sfs is copied to /initrd/mnt/tmpfs/ directory :
Q:
Code: Select all
ls /initrd/mnt/tmpfs
The devx is not copied to ram .
The save-file is now mounted as :
/dev/loop1 on /initrd/pup_ro1 type ext3 (rw,noatime,errors=continue,barrier=0,data=ordered)
It is a little confusing to call the savefile pup_ro1 : as far as i saw the code, the save-file does not get remount,ro 'ed and remount,rw 'ed when snapmergepuppy is running or when the save at rc.shutdown is made.
The save-file is mounted rw all the time . (A possible risk imho.)
free shows :
Mem : 1025472 total
Swap: 1582076 total
(have disabled one swap in rc.sysinit to be reserved for Resume from Hibernation (which is not possible with stock Puppy kernels by Bk but from pemasu fex.)