Fair Warning! Don't use /tmp diretory in .pet packages
Moderator: Forum moderators
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 119 times
Fair Warning! Don't use /tmp diretory in .pet packages
No, this is not about the Van Halen album. It's dedicated to all Puppy developers who creates .pet packages using pinstall.sh scripts.
If a developer needs to use such pinstall.sh script e.g.to copy files from /tmp to another location -e.g. to avoid overwriting files already existing- don't do that. It will break the Puppy.
I don't know exactly when this had changed, though I experienced problems in FossPup64 9.5 after installing a .pet package having such a pinstall.sh script. It's because in FossaPup /tmp is a symbolic link which gets overwritten by the installed package.Therefore all the pup_event functions were removed. So, clicking a drive icon won't open drives/partitions anymore. The functions will return after restarting X, though anything else in /tmp still is lost - which perhaps might cause even more trouble when using save files or save folders.
Since the forum has no general developer section -at least I couldn't find one-, I decided to post this here.
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
- Wiz57
- Moderator
- Posts: 700
- Joined: Fri Dec 13, 2019 3:54 pm
- Location: Chickasha, OK USA
- Has thanked: 93 times
- Been thanked: 159 times
Re: Fair Warning!
Hmmm, maybe that would be a good suggestion, add a new sub forum. In the "Programming" forum maybe?Since the forum has no general developer section -at least I couldn't find one-, I decided to post this here
Good catch, by the way...scripts need to implement measures to determine what data they add, and only
work with that, not what is linked to, already there, etc.
Brings back memories of late 1990s when I worked with Arachne for DOS...in some of the initial installer
batch files, if the "temp" variable was not set via config.sys or autoexec.bat, some installer script would
default to C:\DOS...then when the script finished, it would delete temp files, and subsequently EVERYTHING
in C:\DOS, leaving the computer inoperable, needing DOS reinstalled!
Wiz
Signature available upon request
- MochiMoppel
- Posts: 1294
- Joined: Mon Jun 15, 2020 6:25 am
- Location: Japan
- Has thanked: 22 times
- Been thanked: 480 times
Re: Fair Warning! Don't use pinstall scripts to make .pet packages
Which .pet package?taersh wrote: Fri Oct 02, 2020 7:47 pmI don't know exactly when this had changed, though I experienced problems in FossPup64 9.5 after installing a .pet package having such a pinstall.sh script.
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 119 times
Re: Fair Warning! Don't use /tmp directory in .pet packages
An older program I developed when I was working on L.A.S.S.I.E. - not published as far as I can recall.
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
- greengeek
- Posts: 1462
- Joined: Thu Jul 16, 2020 11:06 pm
- Has thanked: 590 times
- Been thanked: 209 times
Re: Fair Warning! Don't use pinstall scripts to make .pet packages
Sometimes i want to do things before pet files are installed, but sometimes i want to do stuff after the pet files are installed.
I see Debian has two kinds of scripts for that purpose.
Some pets i have used for years on Slacko 5.6 fail during my recent experiments with Tahr32 etc (because of different timing handling pinstall scripts) so I am keen to know how to handle pet installation better.
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 119 times
Re: Fair Warning! Don't use /tmp directory in .pet packages
Sorry, but I didn't wrote this. The title I wrote was "Fair Warning" only.
My warning was meant to the /tmp directory inside of a .pet package.
E.g in FossaPup64 /tmp is a symbolic link which gets overwritten by the /tmp directory inside the .pet package.
The title has changed later, but it wasn't me.
I'm still using pinstall.sh, though I don't place it into a /tmp directory of the package.
Instead I'm creating another directory to place files to be installed by the pinstall.sh script.
Edit: I changed the title now.
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
Re: Fair Warning! Don't use /tmp diretory in .pet packages
If so, I'm struggling to understand why one WOULD do it to begin with .. '/tmp' is one of the reserved OS directories like /dev, /run, and /sys
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 119 times
Re: Fair Warning! Don't use /tmp diretory in .pet packages
There could be many purposes to store files temporarily into /tmp or into a sub-directory of /tmp.
It's completely stupid to look at it as a reserved OS directory, and it's even more stupid to define it being a reserved OS directory.
A reserved OS directory should include content like it is in /dev, /proc, and /sys.
These directories obviously are not created/designed to store temporary files or even user files or even programs etc.
2. In older Puppies /tmp was a real directory. Not being a symbolic link like in the newer Puppies.
Even inside the initrd.gz, /tmp is still a real directory. And also inside of the base .sfs it is still a real directory.
And by the way: /run should also NOT being a reserved OS directory.
And by another way: /run is a symbolic link to /tmp in Puppy.
So, in newer Puppies somewhere within the boot process it changes to being a symbolic link.
My purpose of putting a /tmp directory into a .pet package is/was: installing files via .pet package and copying those files by the use of a pinstall.sh script. Within the pinstall.sh script I can make checks if the file is already existing, or if it is newer than the file in /tmp of the .pet package. So, that way I can avoid overwrite an existing/newer file. E.g. providing updates of a .pet package without to spare files out like .cfg files that may have changed by the user who already installed a first version.
I wrote:
If a developer needs to use such pinstall.sh script e.g.to copy files from /tmp to another location -e.g. to avoid overwriting files already existing- don't do that. It will break the Puppy.
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
Re: Fair Warning! Don't use /tmp diretory in .pet packages
Read: https://www.fosslinux.com/41739/linux-t ... o-know.htmtaersh wrote: Mon Oct 05, 2020 11:16 pm It's completely stupid to look at it as a reserved OS directory, and it's even more stupid to define it being a reserved OS directory.
Re: Fair Warning! Don't use /tmp diretory in .pet packages
Re: Fair Warning! Don't use /tmp diretory in .pet packages
I had learned years back that the solution was to use /var/tmprcrsn51 wrote: Tue Oct 06, 2020 3:21 am Even in old Puppies, using /tmp in a PET package was a problem. The /tmp folder needs full 1777 permissions so unprivileged processes (like in CUPS) can use it. Copying /tmp content out of a PET would often change it to 755.
Re: Fair Warning! Don't use /tmp diretory in .pet packages
It's exactly the same problem with /var/tmp. If a CUPS filter uses /var/tmp (some do) then it needs 1777 privileges too. So a PET that contains content in /var/tmp will cause trouble.Jafadmin wrote: Tue Oct 06, 2020 3:40 am I had learned years back that the solution was to use /var/tmp
Re: Fair Warning! Don't use /tmp diretory in .pet packages
But /var/tmp isn't a symlink, and both tmps are supposed to be 1777 by default.rcrsn51 wrote: Tue Oct 06, 2020 12:07 pmIt's exactly the same problem with /var/tmp. If a CUPS filter uses /var/tmp (some do) then it needs 1777 privileges too. So a PET that contains content in /var/tmp will cause trouble.Jafadmin wrote: Tue Oct 06, 2020 3:40 am I had learned years back that the solution was to use /var/tmp
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 119 times
Re: Fair Warning! Don't use /tmp diretory in .pet packages
Thanks for all the useful knowledge being new to me.
Meanwhile I have edited most of my .pet packages.
Instead of /tmp or /var/tmp I'm using now my own hidden temporary directory in /root to do what I need by the pinstall.sh script.
Again thanks!
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!