commit:     d978fda5625ae8ce70c59898734775beca572c5f
Author:     Stephen Shkardoon <ss23 <AT> ss23 <DOT> geek <DOT> nz>
AuthorDate: Tue Jan 16 17:50:49 2018 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Fri Jan 19 12:02:27 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d978fda5

net-p2p/rtorrent: Update init.d script to use correct PID

Overwrites the start-stop-daemon created PID file with the child PID
obtained by searching for children of screen.

Closes: https://bugs.gentoo.org/634852
Package-Manager: Portage-2.3.13, Repoman-2.3.3

 net-p2p/rtorrent/files/rtorrentd.init | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net-p2p/rtorrent/files/rtorrentd.init 
b/net-p2p/rtorrent/files/rtorrentd.init
index 9672759a7bf..06fab7d2084 100644
--- a/net-p2p/rtorrent/files/rtorrentd.init
+++ b/net-p2p/rtorrent/files/rtorrentd.init
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 depend() {
@@ -21,6 +21,8 @@ start() {
                        --env HOME="${PWHOME:-/home/$USER}" \
                        --name rtorrent \
                        --exec /usr/bin/screen -- -D -m -S rtorrentd 
/usr/bin/rtorrent
+       # Because we've daemonized with screen, we need to replace the PID file 
with the real PID of rtorrent
+       pgrep -P $(cat /var/run/rtorrentd.pid) > /var/run/rtorrentd.pid
        eend $?
 }
 

Reply via email to