summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/bitflu/files/bitflu-add-pidfile.patch')
-rw-r--r--net-p2p/bitflu/files/bitflu-add-pidfile.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/net-p2p/bitflu/files/bitflu-add-pidfile.patch b/net-p2p/bitflu/files/bitflu-add-pidfile.patch
new file mode 100644
index 000000000000..23783b253f73
--- /dev/null
+++ b/net-p2p/bitflu/files/bitflu-add-pidfile.patch
@@ -0,0 +1,23 @@
+--- 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);
+ }
+ }