4 # A little daemon that I use to clean links created by the bandwidth
5 # module for Apache when they weren't removed properly by the server.
6 # (Ie: when a httpd process didn't terminated in the usual way.)
8 # Change the value of TIME to how often (in seconds) you want to
15 $LINKDIR="/var/run/apache-mod_bandwidth/link";
19 sleep 1 until getppid == 1;
34 if (($process) =/^\S+\s+(\d+)\s+.+httpd\s/) {
40 opendir(DIR, $LINKDIR);
41 local(@filename)=readdir(DIR);
44 for($i=0; $i <= $#filename; $i++) {
45 if ($filename[$i] =~ /^\d+$/) {
46 if (! $ppid{$filename[$i]}) {
47 unlink("$LINKDIR/$filename[$i]");