net-p2p/rtorrent: Update init.d script to use correct PID
authorStephen Shkardoon <ss23@ss23.geek.nz>
Tue, 16 Jan 2018 17:50:49 +0000 (06:50 +1300)
committerJason Zaman <perfinion@gentoo.org>
Fri, 19 Jan 2018 12:02:27 +0000 (20:02 +0800)
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

index 9672759a7bf407880702e147de54b0cc6165cf8c..06fab7d20846c08968c190d3f94f923667af5274 100644 (file)
@@ -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 $?
 }