clean_whiteouts_daemon: A Daemon to Clean Whiteout File
Posted: Tue 03 Mar 2009, 22:02
I noticed that yet another person was hurt by the whiteout files resulting from Opera's cache activity, so I figured: "someone should add the cleanup once and for all to the Puppy shutdown script".
But then I thought, "But why do we need to reboot for them to be cleaned? This isn't Windows, right?"
So I wrote this daemon, to take care of the whiteout files.
What it does is sleep for some time (default is 30 minutes), then wake up and go cleaning. Then go to sleep again. And so on.
It doesn't just delete whatever it finds -- it makes sure they don't cover files in any union layer.
By default it checks all the filesystem for whiteout files, but if you want it to only look at some directories (e.g. /root), you have a config option.
There's also an option to have /tmp cleaned (since a lot of whiteout files can be created there when compiling), but I think Barry reinstated making /tmp a tmpfs, so it might not be necessary.
You can make it verbose and it will list every file it deletes in the log file (/var/log/clean_whiteouts.log).
There are some more config options, all explained in the config file (/etc/clean_whiteouts.conf).
In case anybody is worried about performance (i.e. it bloating Puppy), I don't think that should be much of a problem, as the script renices itself so it runs at a low priority and should not steal the cpu when other apps want it.
It comes with a startup file in /etc/init.d, so it will be started at bootup and stopped at shutdown (the dotpet will also start it when it installs).
It should also help make shutdown faster for people running off flash drives (PUPMODE 3/7/13), as snapmergepuppy will have less files to handle...
I haven't tested it much, but similar code was in the shutdown script for 2.14R... maybe people should test it a bit (keeping an eye on the log file) and report here if it works ok or not.
(In case anyone wonders why the script name is strangely shorter that it's title, that's because killall is stupid and can't handle long names...)
But then I thought, "But why do we need to reboot for them to be cleaned? This isn't Windows, right?"
So I wrote this daemon, to take care of the whiteout files.
What it does is sleep for some time (default is 30 minutes), then wake up and go cleaning. Then go to sleep again. And so on.
It doesn't just delete whatever it finds -- it makes sure they don't cover files in any union layer.
By default it checks all the filesystem for whiteout files, but if you want it to only look at some directories (e.g. /root), you have a config option.
There's also an option to have /tmp cleaned (since a lot of whiteout files can be created there when compiling), but I think Barry reinstated making /tmp a tmpfs, so it might not be necessary.
You can make it verbose and it will list every file it deletes in the log file (/var/log/clean_whiteouts.log).
There are some more config options, all explained in the config file (/etc/clean_whiteouts.conf).
In case anybody is worried about performance (i.e. it bloating Puppy), I don't think that should be much of a problem, as the script renices itself so it runs at a low priority and should not steal the cpu when other apps want it.
It comes with a startup file in /etc/init.d, so it will be started at bootup and stopped at shutdown (the dotpet will also start it when it installs).
It should also help make shutdown faster for people running off flash drives (PUPMODE 3/7/13), as snapmergepuppy will have less files to handle...
I haven't tested it much, but similar code was in the shutdown script for 2.14R... maybe people should test it a bit (keeping an eye on the log file) and report here if it works ok or not.
(In case anyone wonders why the script name is strangely shorter that it's title, that's because killall is stupid and can't handle long names...)