On 7/6/21 9:38 pm, jrb3-beckenbach.us wrote:
Hi again, Jon!
On 6 Jun 2021, at 20:51, Jon Gough <jonsgo...@gmail.com> wrote:
These suggest that a full cleanup could/should(?) be done including all user
generated files.
Not at all, because packages do not install any files to any user-$HOME.
If the user generated (or triggered the generation of) any files, by definition
the package-installer didn't create them,
and by policy and following "the law of least surprise" the package-uninstaller
shouldn't touch them.
If $HOME is not allowed to be touched by convention I was trying to ascertain
where else they could be located that does not require root access to create,
modify, delete so that the cleanup could be done.
Two different approaches I've used for this situation over the decades have
worked well for me.
Not sure if either will be an improvement for you.
1/ Have the package-installer emplace a pseudo-group, with the plugin-manager
set-group to that pseudo-group.
Then, chgrp anything created for the user into his $HOME to that pseudo-group.
The user-invoked script to clean up $HOME
then just has to look for file-system entries with that group.
2/ If you're absolutely dead-set on forcing clean-up of per-user files,
*whether or not the user wants them cleaned up*,
then just don't put anything in any $USER-home. Problem solved. Then, take
your cue from {mail,news,uucp,cups,ftp,...}
and keep all per-user files off in /var/spool/plug-package/ and/or a pseudo-user
"home directory". On package-uninstall,
make sure /var/spool/plug-package/ and pseudo-user "home directory" get cleared
and removed. (This is where you'd differ
from {mail,news,uucp,cups,ftp,...} -- they won't clear and remove [or at least
didn't the times I looked from ~1990 onward].)
That sounds like a solution putting the large binary read-only files in
the /var/spool/plug-package directory. I presume, to avoid using root
access all the time, that the directory would have to be rw by everyone
who may be running the program, via a group, or just world. The worst
that would happen is it gets deleted by mistake and the data would have
to be downloaded again.
Trade-off between 1/ and 2/ is "where do the files live" and "how much must the
package harden itself from user interference".
If you're dead-set on using space in each user's $HOME, option 1 it is. Doing
that means your package has explicitly given-over
custody of those files to the user, since they're in the user-controlled space.
Your package has to have the user trigger clean-up,
I am not set on any particular location and have been put off $HOME by
the clean up issue.
using commands your package provides documented by your package. Your
plugin-manager also has to self-repair any changes
made by the user in his file-space, since it's the user's file-space not yours
and he'll do whatever he darn well pleases there.
If it's just you want to make use of disk-space available on /home/ go ahead
with option 2 and pseudo-user homed on /home/.
Thanks!
Joseph
——
Joseph Beckenbach
+1-678-602-3192 (EST/EDT)
Thanks for the suggestion, I will now investigate how to implement this.
Jon