You are not logged in.

#1 2013-07-10 04:43:53

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

How do you try out an application and keep $HOME clean afterwards

As a new Gnome user, naturally I turned to evolution for an email client well integrated with Gnome. As it turned out, I couldn't find any love for it, so I removed the package. But the problem was that it left behind in several places stuff I no longer wanted.

I had prepared for just that. During the try-out of evolution, I had inotify monitor the files it laid its hands on:

$ inotifywait -mr -e CREATE -e MODIFY -e DELETE ~

The list I got from this:

  • create ~/.pki/nssdb/{cert9.db,key4.db,pkcs11.txu}

  • create ~/.config/evolution/*

  • create ~/.local/share/evolution/*

  • modify ~/.config/dconf/user

  • modify ~/.local/share/gvfs-metadata/home*

  • add password to ~/.local/share/keyrings/login.keyring (gnome-keyring)

  • download mails etc. to ~/.cache/evolution/

Obviously the cleanup was not as easy as simply removing files/folders, I had to:

  • clean up dconf database:

    $ dconf reset -f /org/gnome/evolution/
    $ dconf read /org/gnome/desktop/notifications/application-children
    ['gnome-network-panel', 'nautilus', 'evolution']
    $ dconf write /org/gnome/desktop/notifications/application-children "['gnome-network-panel', 'nautilus']"
    $ dconf reset -f /org/gnome/desktop/notifications/application/evolution/
  • clean up login password stored in gnome-keyring: install and run `seahorse', delete the entry "Evolution Data Source XXXXXXXXXX.XXXX.XX@hostname".

  • clean up data and config:

    $ rm -rf ~/.cache/evolution/ ~/.local/share/evolution/ ~/.config/evolution/
  • I don't know about the NSS stuff, but since no other applications seem to use it (IIRC NSS is used by Chromium, which I don't use), I simply remove it all:

    $ rm -rf ~/.pki/
  • gvfs metadata stuff I really don't know about; ignoring.

As you can see, It takes some long hard work to simply try out an application like evolution while keeping my $HOME intact.
I imagine I could have tried it out under another user (correctly named "tester"), or maybe used some kind of filesystem snapshot (which ext4 lacks afaik), or some kind of sandbox. Too much hassle maybe?

My question to you is how do you do a throw-away trace-free test-run of an application?

Last edited by lolilolicon (2013-07-10 04:48:20)


This silver ladybug at line 28...

Offline

#2 2013-07-10 06:08:18

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: How do you try out an application and keep $HOME clean afterwards

Depending on the app, it's either 1) a chroot environment / sandbox, or 2) my default system, cleaned manually afterwards. A trace-free test-run is best performed in a 1), especially when the application is going to leave bits in /etc and /var. Besides, I check the content of my $HOME pretty often, so there's nothing unexpected most of the time. On the other hand, an easy way to recall a particular HDD snapshot is something I'm missing (ext4 is my default fs).


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2013-07-10 09:22:20

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: How do you try out an application and keep $HOME clean afterwards

$ HOME=/tmp evolution

Last edited by 65kid (2013-07-10 09:22:48)

Offline

#4 2013-07-10 12:44:18

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: How do you try out an application and keep $HOME clean afterwards

65kid wrote:
$ HOME=/tmp evolution

Have you actually tried this? Not every program respects $HOME, and even if they do, how about $XDG_CONFIG_HOME for example? Let alone the fact that in the case of evolution, there're several programs at work, including gnome-keyring and gvfs.

@bohoomil, you say you check your $HOME regularly, but you don't get to see the data programs like evolution leave in the dconf database by just "checking". And although I knew the dconf database was changed by monitoring with inotifywait, I had to kind of hunt around to catch the dirty entries that are no longer relevant.
I think the simplest solution would be using for /home a filesystem that supports snapshots.
But OTOH, if you had been trying evolution out for a month, then you wanted to remove it and all its traces, reverting to a earlier snapshot wouldn't be viable, because you wouldn't want to lose other data with it; instead, you must do the cleanup manually, which required your knowing the exact places where evolution had made changes.
Thinking about the scattered changes made by evolution that I wouldn't have expected, I recognize one of the things I hate about Windows, the hidden magical uncomprehensible registry, the dirty installer/uninstaller and other stuff I can never be sure of.  Such programs will bloat up my $HOME if I don't be extra careful about what they did. The manual cleanup process feels like picking dog crap out of a thick carpet.

Last edited by lolilolicon (2013-07-10 13:09:54)


This silver ladybug at line 28...

Offline

#5 2013-07-10 12:49:27

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: How do you try out an application and keep $HOME clean afterwards

hm, good point. I tried this once with XBMC and some other software and it worked perfectly fine. Well, you could set XDG_CONFIG_HOME as well, this should cover most cases. But yeah, if gnome-keyring/gvfs use dbus or something, you may be out of luck.

Offline

#6 2013-07-10 14:30:07

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: How do you try out an application and keep $HOME clean afterwards

Unfortunately (in my humble opinion), not all developers care about the XDG_CONFIG_HOME specification, and as a result some don't even take the time to respect it. There are ways of forcing things to use XDG_CONFIG_HOME (for instance, a very old library called libetc), but most of them are a bit sketchy. If a program offers no way of controlling where its files go, I often just avoid using it (I know that's kind of crazy, but I want my ~ to be clean).

All the best,

-HG

Last edited by HalosGhost (2013-07-10 14:30:43)

Offline

#7 2013-07-10 14:41:21

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: How do you try out an application and keep $HOME clean afterwards

Seems to me like a virtual machine would be the perfect candidate here...perhaps provisioned with something like Vagrant and Salt Stack/Chef/Ansible/Puppet if you wanted a particular environment in place and didn't want to worry about the snapshot filesystem limitations mentioned above. But even just a snapshot of a simple Virtualbox install of a base Arch system would probably be enough for everyday needs.

Scott

Last edited by firecat53 (2013-07-10 14:50:22)

Offline

#8 2013-07-10 15:23:23

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: How do you try out an application and keep $HOME clean afterwards

@HalosGhost, I too tend to avoid such crappy applications, but I fear I may find something I like too much to get rid of, in which case I really need to know exactly what/where it is crapping its crap.
@firecat53, I'm not sure I understand (I don't have an idea of the tools you just mentioned), but I feel that virtual machines seem to be overkill/over-complicating? For trying out they may be very suitable, but for daily use they don't seem to be very convenient.

I feel the need for documenting the exact post-uninstall cleanup procedure for every evolultion-like application, and possibly post-run cleanup procedures for something like the Tor bundle which still leaves some traces.
I guess the procedure cannot be fully automated in some cases.


This silver ladybug at line 28...

Offline

#9 2013-07-10 15:36:07

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: How do you try out an application and keep $HOME clean afterwards

Actually, upon further research, I'd recommend rewritefs. It was a project forked from libetc, but is far less sketchy and much more elegant.

All the best,

-HG

Offline

#10 2013-07-10 15:40:03

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: How do you try out an application and keep $HOME clean afterwards

Since I don't use any DE by default, I can safely remove obsolete config files. By the way, have you tried using

dconf dump / > mysettings.txt

dconf load / < mysettings.txt

which lets you easily edit dconf entries in a text editor and than reload a modified file?


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#11 2013-07-10 20:51:04

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: How do you try out an application and keep $HOME clean afterwards

lolilolicon wrote:

@firecat53, I'm not sure I understand (I don't have an idea of the tools you just mentioned), but I feel that virtual machines seem to be overkill/over-complicating? For trying out they may be very suitable, but for daily use they don't seem to be very convenient.

Heh, to me having to mess with dconf databases and moving $HOME seem way more complicated!

So if you just do a quick Arch install into a virtual machine (you can expedite it by mounting a shared directory and sharing/copying your /var/cache/pacman/pkg directory to avoid re-downloading all your installed packages). Configure it as you wish. Now create a shapshot of the virtual machine as it now exists. This is almost a one-click operation in Virtualbox. Now you have a 'saved state'. Boot up the VM, install the package you want to test...change things, break things, whatever. When you're done, shutdown the VM and select the option to 'Discard current state' or some such. Now the VM reverts back exactly to how you set it up originally. Keep it updated just like your regular system (or in whatever state you need for testing) and snapshot it after an update. You can discard old snapshots when you're comfortable with your current update.

The other other tools I mentioned are just tools that can deploy and configure  multiple virtual machines (for example for developers to be able  work collaboratively in identical environments). Probably overkill for what you need.

I think you will spend less time getting a suitable test VM configured then you will trying to worry about filesystem snapshots and monkeying with environment variables. Just my two cents smile

Scott

Last edited by firecat53 (2013-07-10 20:52:16)

Offline

#12 2013-07-10 21:32:44

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: How do you try out an application and keep $HOME clean afterwards

I got annoyed with applications cluttering up my home directory a while ago and came up with the following solution:

1) use pam_mount to mount a tmpfs directory for each user (in a given group) on login
2) make this the official system home directory for users in that group (i.e. in /etc/passwd)
3) link in all desired files and directories with synclinks (written for this very purpose) on login and logout. With synclinks, even if an application removes the symlink and creates a new file, it will be copied back to the disk and relinked when run in update mode.

The advantages are that ALL applications respect this temporary home directory and synclinks allows me to specify exactly which files I keep on the disk. For example, I only keep the essential firefox files instead of all the useless (history-preserving) clutter it normally dumps in its configuration directory.

Bonus: with encrypted or disabled swap, sensitive files in the temporary home directory are never written to disk and file access is very fast (it's all in memory). It works well in conjunction with a (pam_mount'd) encrypted "real" home directory.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#13 2013-07-11 04:08:31

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: How do you try out an application and keep $HOME clean afterwards

Why the fuss about HDD backups at the filesystem level? I would just backup the dotfiles in $HOME and overwrite them with the backups when I'm done.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#14 2013-07-11 09:48:53

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: How do you try out an application and keep $HOME clean afterwards

@firecat53, sounds like a good approach for testing stuff out, effectively in a sandbox. Thanks for the info. My other concern is about the often undetectable-after-the-event clutter that happens when I actually decide to use in my native environment some crappy (crapful?) application, which needs another approach.
@Xyne, synclinks is an interesting solution. I see it requires you to know *very well* the list of files you desire. In the case of the dconf and gnome-keyring databases, one really have to remember to clean it up afterwards.

For me, I still think that it can be seen as a documentation problem. Applications like evolution should include a thorogh list of things to do in order to completely remove it along with its traces, but in reality I cannot find the donf or gnome-keyring or nss or gvfs metadata changes mentioned anywhere in its docs.
Similar problems can be seen in some packages too, such as some package that adds a new user/group with a home dir in /var/lib/ on installation, but fails on unintallation to acknowledge the user to manually remove the user/group as well as the home dir if desired.
I really hate such leftovers. Before I enter a building, I'd like to first make sure that there is an exit, otherwise it's a trap.

Last edited by lolilolicon (2013-07-11 09:50:45)


This silver ladybug at line 28...

Offline

#15 2013-07-11 13:00:01

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: How do you try out an application and keep $HOME clean afterwards

lolilolicon wrote:

I imagine I could have tried it out under another user (correctly named "tester")

This sounds like an INSANELY simple and very good solution to your question. For all but the very few applications that touch stuff in the root directory, this would be perfect.

ConnorBehan wrote:

Why the fuss about HDD backups at the filesystem level? I would just backup the dotfiles in $HOME and overwrite them with the backups when I'm done.

This sounds very good too. I would just have to watch out for those stupid weird files that don't copy correctly, like "~/.gvfs" or something...

Anyway, I've been following this thread for a while. I guess I'll be the cheeky one: I try out applications and couldn't care less about keeping my $HOME clean afterwards. hmm

Actually, this thread reminds me of a fascinating (to me) discussion recently on the Haiku forums. A developer is implementing a package manager for the OS and was asking about what to do with the per-user config files that get put into the home directory. Should they be controlled by the package manager? Should the package manager ask the user what to do with them when installing / uninstalling an application? Should they be left for the user to deal with? You can read the thread here: http://www.freelists.org/post/haiku-dev … skbar-menu

Offline

#16 2013-07-11 13:41:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: How do you try out an application and keep $HOME clean afterwards

For me the real question is how to  try out all these cool applications and still manage to keep $APARTMENT clean, particularly $KITCHEN and $BATHROOM.  I wish I could just restore a clean backup!
wink


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#17 2013-07-11 13:59:13

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: How do you try out an application and keep $HOME clean afterwards

Trilby wrote:

For me the real question is how to  try out all these cool applications and still manage to keep $APARTMENT clean, particularly $KITCHEN and $BATHROOM.  I wish I could just restore a clean backup!
wink

$ pacman -S maid
$ systemctl start maid.service

You could also try

$ pacman -S girlfriend
$ systemctl start girlfriend@cleaning.service

but the service is not guaranteed to run. It seems to depend on the build configuration but acquiring the source code is difficult. In any case, the package should not be installed for that purpose. It's just an occasional bonus to the much more interesting main services. Even if it does run the service, letting it run too often will fill up your logs. If you do not pay attention to the warnings, the package will actually uninstall itself and may break your system while doing so.

You could also try re-installing the "mother" package, but that would be a crippling downgrade in most cases.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#18 2013-07-11 14:29:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: How do you try out an application and keep $HOME clean afterwards

Yes, but wife.service is expensive and proprietary - even the trial version girlfriend.service requires a hefty subscription fee.  While it has far fewer requirements to run, maid.service also requires a regular subscription fee - I've found this one to be the most stable option though.  The free alternatives can get the job done, but just require a lot of work.  I've aliased house-clean.service to systemd-poweroff.service - this works most of the time.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#19 2013-07-11 15:10:46

dag
Member
From: US
Registered: 2013-01-20
Posts: 216

Re: How do you try out an application and keep $HOME clean afterwards

I heard somewwhere on here that what is on home is your responsibility. pacman does not touch it and doesnt even put configs there most(not sure if ever) of the time. with some apps they are put there when you start it or you have to do it manually. I really dont like how invasive DE are in this respect not to mention imo bloat.


--------------------------------------
alcoves wonder creates the wonder unto the ages; never lose that.

Offline

#20 2013-07-11 15:15:12

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: How do you try out an application and keep $HOME clean afterwards

dag wrote:

I heard somewwhere on here that what is on home is your responsibility. pacman does not touch it and doesnt even put configs there most(not sure if ever) of the time. with some apps they are put there when you start it or you have to do it manually. I really dont like how invasive DE are in this respect not to mention imo bloat.

A well-made package shouldn't touch the user's home directory under any circumstances. But yes, applications often generate their own configs/directories on running (which annoys me too).

All the best,

-HG

Offline

#21 2013-07-11 15:31:11

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: How do you try out an application and keep $HOME clean afterwards

HalosGhost wrote:

A well-made package shouldn't touch the user's home directory under any circumstances. But yes, applications often generate their own configs/directories on running (which annoys me too).

It may be annoying, but often applications do need to save user specific data. If only they would all adhere to the XDG standard, then something like "clean_xdg.sh APPNAME" would do the job. In the best case, the each app would provide a .local/share/APPNAME/uninstall.sh if it stores user specific data which will be able to remove all appdata.

Last edited by progandy (2013-07-11 15:34:58)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#22 2013-07-11 18:42:23

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: How do you try out an application and keep $HOME clean afterwards

And some applications outright don't run if they are not on your $HOME so you need really ugly workarounds. One example is eagle, the schematic capture and pcb design program.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB