Gentoo Archives: gentoo-commits

From: "Anthony G. Basile (blueness)" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-p2p/bitflu/files: bitflu.config bitflu.initd bitflu-add-pidfile.patch
Date: Thu, 30 Jun 2011 16:02:54
Message-Id: 20110630160244.83F9A20054@flycatcher.gentoo.org
1 blueness 11/06/30 16:02:44
2
3 Added: bitflu.config bitflu.initd bitflu-add-pidfile.patch
4 Log:
5 Initial commit
6
7 (Portage version: 2.1.9.42/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-p2p/bitflu/files/bitflu.config
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitflu/files/bitflu.config?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitflu/files/bitflu.config?rev=1.1&content-type=text/plain
14
15 Index: bitflu.config
16 ===================================================================
17 # Written by Bitflu::Configuration@2835 on Thu Jun 30 07:53:38 2011
18 autocancel = 1.5
19 autocommit = 1
20 autoload_dir = /var/lib/bitflu/autoload
21 autoload_scan = 300
22 chdir =
23 checkversion = 1309395241
24 completed_downloads = /var/lib/bitflu/seeding
25 downspeed = 0
26 history = 1
27 http_autoloadtorrent = 1
28 http_maxthreads = 10
29 incomplete_downloads = /var/lib/bitflu/unfinished
30 ipv6 = 1
31 kademlia_idseed = 0
32 logfile = /var/log/bitflu/bitflu.log
33 loglevel = 5
34 min_free_mb = 0
35 pidfile = /var/run/bitflu/bitflu.pid
36 plugindir = /usr/lib/bitflu/plugins
37 pluginexclude =
38 renice = 8
39 storage = StorageVFS
40 telnet_bind = 127.0.0.1
41 telnet_maxhist = 20
42 telnet_port = 4001
43 telnet_view = type,name=25,hash,peers,pieces,bytes,percent,ratio,up,down,eta,note
44 torrent_bind = 0
45 torrent_gcpriority = 5
46 torrent_importdir = /var/lib/bitflu/import
47 torrent_maxpeers = 80
48 torrent_maxreq = 6
49 torrent_port = 6688
50 torrent_totalpeers = 400
51 torrent_tracker_autoudp = 1
52 torrent_tracker_udpport = 6689
53 torrent_trackerblacklist =
54 torrent_upslots = 10
55 unshared_downloads = /var/lib/bitflu/removed
56 upspeed = 35
57 vfs_use_fallocate = 0
58 webgui_bind = 127.0.0.1
59 webgui_port = 4081
60 workdir = /var/lib/bitflu
61 # EOF #
62
63
64
65 1.1 net-p2p/bitflu/files/bitflu.initd
66
67 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitflu/files/bitflu.initd?rev=1.1&view=markup
68 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitflu/files/bitflu.initd?rev=1.1&content-type=text/plain
69
70 Index: bitflu.initd
71 ===================================================================
72 #!/sbin/runscript
73 # Copyright 1999-2011 Gentoo Foundation
74 # Distributed under the terms of the GNU General Public License v2
75 # $Header: /var/cvsroot/gentoo-x86/net-p2p/bitflu/files/bitflu.initd,v 1.1 2011/06/30 16:02:44 blueness Exp $
76
77 DAEMON=/usr/sbin/bitflu.pl
78 PIDDIR=/var/run/bitflu
79 PIDFILE=${PIDDIR}/bitflu.pid
80 CONFFILE=/etc/bitflu/bitflu.config
81
82 depend() {
83 need net
84 }
85
86 checkconfig() {
87 if [ ! -f ${CONFFILE} ]; then
88 eerror "No config file ${CONFFILE}"
89 return 1
90 fi
91
92 if [ ! -d ${PIDDIR} ] && ! mkdir -p ${PIDDIR}; then
93 eerror "Failed to create ${PIDDIR}"
94 return 1
95 fi
96
97 chown bitflu:bitflu ${PIDDIR}
98 }
99
100 start() {
101 checkconfig || return 1
102 ebegin "Starting bitflu"
103 start-stop-daemon --start --pidfile "${PIDFILE}" --user bitflu:bitflu \
104 --exec "${DAEMON}" -- --config="${CONFFILE}" --daemon -q >/dev/null 2>&1
105 eend $?
106 }
107
108 stop() {
109 ebegin "Stoping bitflu"
110 start-stop-daemon --stop --pidfile "${PIDFILE}" --exec "${DAEMON}"
111 eend $?
112 }
113
114 restart() {
115 svc_stop
116 sleep 2
117 svc_start
118 }
119
120
121
122 1.1 net-p2p/bitflu/files/bitflu-add-pidfile.patch
123
124 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitflu/files/bitflu-add-pidfile.patch?rev=1.1&view=markup
125 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitflu/files/bitflu-add-pidfile.patch?rev=1.1&content-type=text/plain
126
127 Index: bitflu-add-pidfile.patch
128 ===================================================================
129 --- bitflu.pl.orig 2011-06-30 10:47:13.000000000 -0400
130 +++ bitflu.pl 2011-06-30 10:50:21.000000000 -0400
131 @@ -442,6 +442,10 @@
132 }
133 elsif($child != 0) {
134 $self->debug("Bitflu is running with pid $child");
135 + open(PIDFILE, ">", $self->Configuration->GetValue('pidfile'))
136 + or die("Unable to create $self->Configuration->GetValue('pidfile'): $!\n");
137 + print PIDFILE $child ;
138 + close(PIDFILE);
139 exit(0);
140 }
141
142 @@ -2816,7 +2820,8 @@
143 $self->{conf}->{history} = 1;
144 $self->{conf}->{ipv6} = 1;
145 $self->{conf}->{storage} = 'StorageVFS';
146 - foreach my $opt qw(ipv6 renice plugindir pluginexclude workdir logfile storage chdir) {
147 + $self->{conf}->{pidfile} = '/var/run/bitflu/bitflu.pid';
148 + foreach my $opt qw(pidfile ipv6 renice plugindir pluginexclude workdir logfile storage chdir) {
149 $self->RuntimeLockValue($opt);
150 }
151 }