--- bitflu.pl.orig	2011-06-30 10:47:13.000000000 -0400
+++ bitflu.pl	2011-06-30 10:50:21.000000000 -0400
@@ -442,6 +442,10 @@
 		}
 		elsif($child != 0) {
 			$self->debug("Bitflu is running with pid $child");
+			open(PIDFILE, ">", $self->Configuration->GetValue('pidfile'))
+				or die("Unable to create $self->Configuration->GetValue('pidfile'): $!\n");
+			print PIDFILE $child ;
+                        close(PIDFILE);
 			exit(0);
 		}
 		
@@ -2816,7 +2820,8 @@
 		$self->{conf}->{history}         = 1;
 		$self->{conf}->{ipv6}            = 1;
 		$self->{conf}->{storage}         = 'StorageVFS';
-		foreach my $opt qw(ipv6 renice plugindir pluginexclude workdir logfile storage chdir) {
+		$self->{conf}->{pidfile}         = '/var/run/bitflu/bitflu.pid';
+		foreach my $opt qw(pidfile ipv6 renice plugindir pluginexclude workdir logfile storage chdir) {
 			$self->RuntimeLockValue($opt);
 		}
 	}