1 |
ssuominen 09/06/06 10:21:54 |
2 |
|
3 |
Added: transmission-daemon.initd.1 |
4 |
transmission-daemon.confd.1 |
5 |
Log: |
6 |
Version bump. Use system libevent instead of bundled copy wrt #269082. Update init.d and conf.d files wrt #269655. |
7 |
(Portage version: 2.1.6.13/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-p2p/transmission/files/transmission-daemon.initd.1 |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-p2p/transmission/files/transmission-daemon.initd.1?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-p2p/transmission/files/transmission-daemon.initd.1?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: transmission-daemon.initd.1 |
16 |
=================================================================== |
17 |
#!/sbin/runscript |
18 |
# Copyright 1999-2009 Gentoo Foundation |
19 |
# Distributed under the terms of the GNU General Public License v2 |
20 |
# $Header: /var/cvsroot/gentoo-x86/net-p2p/transmission/files/transmission-daemon.initd.1,v 1.1 2009/06/06 10:21:54 ssuominen Exp $ |
21 |
|
22 |
# Read options from conf.d file, or set sensible defaults |
23 |
allowed=${allowed:-127.0.0.1} |
24 |
blocklist=${blocklist:-no} |
25 |
watch_dir=${watch_dir:-} |
26 |
config_dir=${config_dir:-/var/transmission/config} |
27 |
port=${port:-9091} |
28 |
auth=${auth:-no} |
29 |
username=${username:-} |
30 |
password=${password:-} |
31 |
download_dir=${download_dir:=/var/transmission/downloads} |
32 |
peerport=${peerport:-51413} |
33 |
portmap=${portmap:-no} |
34 |
peerlimit_global=${peerlimit_global:-240} |
35 |
peerlimit_torrent=${peerlimit_torrent:-60} |
36 |
encryption=${encryption:-preferred} |
37 |
bind_address_ipv4=${bind_address_ipv4:-} |
38 |
bind_address_ipv6=${bind_address_ipv6:-} |
39 |
rpc_bind_address=${rpc_bind_address:-} |
40 |
|
41 |
# Misc options |
42 |
pidfile=${pidfile:-/var/run/transmission.pid} |
43 |
logfile=${logfile:-} |
44 |
runas_user=${runas_user:-} |
45 |
|
46 |
|
47 |
# Convert settings into stuff that transmission-daemon can grok as arguments |
48 |
allowed_opt="--allowed ${allowed}" |
49 |
|
50 |
blocklist_opt="--no-blocklist" |
51 |
if [ "x${blocklist}" = "xyes" ]; then |
52 |
blocklist_opt="--blocklist" |
53 |
fi |
54 |
|
55 |
watch_dir_opt="--no-watch-dir" |
56 |
if [ -n "${watch_dir}" ]; then |
57 |
watch_dir_opt="--watch-dir ${watch_dir}" |
58 |
fi |
59 |
|
60 |
config_dir_opt="--config-dir ${config_dir}" |
61 |
|
62 |
port_opt="--port ${port}" |
63 |
|
64 |
auth_opt="--no-auth" |
65 |
username_opt="" |
66 |
password_opt="" |
67 |
if [ "x${auth}" = "xyes" ]; then |
68 |
auth_opt="--auth" |
69 |
# Set username and password also |
70 |
username_opt="--username ${username}" |
71 |
password_opt="--password ${password}" |
72 |
fi |
73 |
|
74 |
download_dir_opt="--download-dir ${download_dir}" |
75 |
|
76 |
peerport_opt="--peerport ${peerport}" |
77 |
|
78 |
portmap_opt="--no-portmap" |
79 |
if [ "x${portmap}" = "xyes" ]; then |
80 |
portmap_opt="--portmap" |
81 |
fi |
82 |
|
83 |
peerlimit_global_opt="--peerlimit-global ${peerlimit_global}" |
84 |
|
85 |
peerlimit_torrent_opt="--peerlimit-torrent ${peerlimit_torrent}" |
86 |
|
87 |
case "${encryption}" in |
88 |
'required') encryption_opt="--encryption-required" ;; |
89 |
'tolerated') encryption_opt="--encryption-tolerated" ;; |
90 |
*) encryption_opt="--encryption-preferred" ;; |
91 |
esac |
92 |
|
93 |
bind_address_ipv4_opt="" |
94 |
if [ -n "${bind_address_ipv4}" ]; then |
95 |
bind_address_ipv4_opt="--bind-address-ipv4 ${bind_address_ipv4}" |
96 |
fi |
97 |
|
98 |
bind_address_ipv6_opt="" |
99 |
if [ -n "${bind_address_ipv6}" ]; then |
100 |
bind_address_ipv6_opt="--bind-address-ipv6 ${bind_address_ipv6}" |
101 |
fi |
102 |
|
103 |
rpc_bind_address_opt="" |
104 |
if [ -n "${rpc_bind_address}" ]; then |
105 |
rpc_bind_address_opt="--rpc_bind-address ${rpc_bind_address}" |
106 |
fi |
107 |
|
108 |
# Note: works only on systems with sys-apps/openrc |
109 |
logfile_opt="" |
110 |
if [ -n "${logfile}" ]; then |
111 |
logfile_opt="--stdout ${logfile} --stderr ${logfile}" |
112 |
fi |
113 |
|
114 |
# Note: works only on systems with sys-apps/openrc |
115 |
# This could be done in baselayout-1 with --chuid, but since |
116 |
# openrc detection is vague at best (b.g.o #270646), just ignore it. |
117 |
runas_user_opt="" |
118 |
if [ -n "${runas_user}" ]; then |
119 |
runas_user_opt="--user ${runas_user}" |
120 |
fi |
121 |
|
122 |
# Actual init script stuff below this line |
123 |
|
124 |
opts="start stop" |
125 |
description="Transmission is a fast, easy and free bittorrent client" |
126 |
description_start="Start transmission-daemon server and web interface" |
127 |
description_stop="Stop transmission-daemon server and web interface" |
128 |
|
129 |
depend() { |
130 |
need net |
131 |
} |
132 |
|
133 |
start() { |
134 |
ebegin "Starting transmission daemon" |
135 |
start-stop-daemon --start --quiet --background --make-pidfile \ |
136 |
--pidfile ${pidfile} ${runas_user_opt} \ |
137 |
${logfile_opt} --exec \ |
138 |
/usr/bin/transmission-daemon -- --foreground ${allowed_opt} \ |
139 |
${blocklist_opt} ${watch_dir_opt} ${config_dir_opt} ${port_opt} \ |
140 |
${auth_opt} ${username_opt} ${password_opt} ${download_dir_opt} \ |
141 |
${peerport_opt} ${portmap_opt} ${peerlimit_global_opt} \ |
142 |
${peerlimit_torrent_opt} ${encryption_opt} \ |
143 |
${bind_address_ipv4_opt} ${bind_address_ipv6_opt} ${rpc_bind_address_opt} |
144 |
eend $? |
145 |
} |
146 |
|
147 |
stop() { |
148 |
ebegin "Stopping transmission daemon" |
149 |
start-stop-daemon --stop --quiet --retry TERM/45/QUIT/15 \ |
150 |
--pidfile ${pidfile} |
151 |
eend $? |
152 |
} |
153 |
|
154 |
|
155 |
|
156 |
1.1 net-p2p/transmission/files/transmission-daemon.confd.1 |
157 |
|
158 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-p2p/transmission/files/transmission-daemon.confd.1?rev=1.1&view=markup |
159 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-p2p/transmission/files/transmission-daemon.confd.1?rev=1.1&content-type=text/plain |
160 |
|
161 |
Index: transmission-daemon.confd.1 |
162 |
=================================================================== |
163 |
# This is the transmission-daemon config file |
164 |
# Default settings are commented, uncomment and adapt as needed |
165 |
|
166 |
# Allowed IP addresses. |
167 |
#allowed=127.0.0.1 |
168 |
|
169 |
# Enable peer blocklists (yes or no) |
170 |
#blocklist=no |
171 |
|
172 |
# Directory to watch for new .torrent files (empty string to disable) |
173 |
#watch_dir= |
174 |
|
175 |
# Where to look for configuration files |
176 |
#config_dir=/var/transmission/config |
177 |
|
178 |
# RPC port |
179 |
#port=9091 |
180 |
|
181 |
# Require authentication (yes or no) |
182 |
#auth=no |
183 |
|
184 |
# Set username for authentication (only used when auth=yes) |
185 |
#username= |
186 |
|
187 |
# Set password for authentication (only used when auth=yes) |
188 |
#password= |
189 |
|
190 |
# Where to save downloaded data |
191 |
#download_dir=/var/transmission/downloads |
192 |
|
193 |
# Port for incoming peers |
194 |
#peerport=51413 |
195 |
|
196 |
# Enable portmapping via NAT-PMP or UPnP (yes or no) |
197 |
#portmap=no |
198 |
|
199 |
# Maximum overall number of peers |
200 |
#peerlimit_global=240 |
201 |
|
202 |
# Maximum number of peers per torrent |
203 |
#peerlimit_torrent=60 |
204 |
|
205 |
# How to encrypt peer connections (required, preferred, tolerated) |
206 |
#encryption=preferred |
207 |
|
208 |
# Where to listen for peer connections (ipv4 address) |
209 |
#bind_address_ipv4= |
210 |
|
211 |
# Where to listen for peer connections (ipv6 address) |
212 |
#bind_address_ipv6= |
213 |
|
214 |
# Where to listen for RPC connections |
215 |
#rpc_bind_address= |
216 |
|
217 |
# Misc. settings |
218 |
|
219 |
|
220 |
# Location of pidfile |
221 |
#pidfile=/var/run/transmission.pid |
222 |
|
223 |
# Location of logfile |
224 |
# (Note: works only on systems with sys-apps/openrc, leave unset otherwise) |
225 |
#logfile= |
226 |
|
227 |
# Run daemon as another user (username or username:groupname) |
228 |
# (Note: works only on systems with sys-apps/openrc, leave unset otherwise) |
229 |
#runas_user= |