mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-23 16:49:10 -07:00
net-p2p/rtorrent: Fix init script to ensure PID file is created
By only replacing the PID in the stop action, we can ensure start-stop-daemon had time to create the PID file. Closes: https://bugs.gentoo.org/634852 Package-Manager: Portage-2.3.19, Repoman-2.3.6
This commit is contained in:
committed by
Jason Zaman
parent
e288faf8bd
commit
427400b35f
@@ -21,13 +21,14 @@ 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 $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping 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
|
||||
|
||||
start-stop-daemon --stop --signal 15 \
|
||||
--pidfile /var/run/rtorrentd.pid
|
||||
eend $?
|
||||
|
||||
Reference in New Issue
Block a user