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";
23 if (($process) =/^\S+\s+(\d+)\s+.+httpd\s/) {
29 opendir(DIR, $LINKDIR);
30 local(@filename)=readdir(DIR);
33 for($i=0; $i <= $#filename; $i++) {
34 if ($filename[$i] =~ /^\d+$/) {
35 if (! $ppid{$filename[$i]}) {
36 unlink("$LINKDIR/$filename[$i]");