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
#!/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() {
--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 $?
}