summaryrefslogtreecommitdiff
blob: 9672759a7bf407880702e147de54b0cc6165cf8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/sbin/openrc-run
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
	use net ypbind nis
	after slapd mysqld postgresql
}

start() {
	PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')"

	ebegin "Starting rtorrent"
	env TERM="xterm" \
		start-stop-daemon \
			--start \
			--make-pidfile \
			--pidfile /var/run/rtorrentd.pid \
			--background \
			--user $USER \
			--env HOME="${PWHOME:-/home/$USER}" \
			--name rtorrent \
			--exec /usr/bin/screen -- -D -m -S rtorrentd /usr/bin/rtorrent
	eend $?
}

stop() {
	ebegin "Stopping rtorrent"
	start-stop-daemon --stop --signal 15 \
			--pidfile /var/run/rtorrentd.pid
	eend $?
}