If you kill rtorrent, does screen die as well? If so, then it's probably
fine to watch the screen pid.
You could write the pid if it starts correctly e.g.
if [[ $? -ne 0 ]]; then
echo "Error: rtorrent failed to start."
exit 1
else
ps -e | grep [r]torrent | awk '$1 ~ /[0-9]+/ {print $1}' >
/var/run/torrent.pid
fi
On Mon, May 16, 2016 at 11:13 AM, Josu Lazkano <[email protected]>
wrote:
> Hello all,
>
> I have a little server running some services that I monitor with
> Monit, it really work great.
>
> Now I have rtorrent service running, but the problem is that it is
> executed inside screen terminal:
>
> https://raw.githubusercontent.com/mjsilva/rtorrent-screen-debian-init-script/master/rtorrent
>
> So I have this:
>
> # ps -e | grep rtorrent
> 22292 pts/1 00:44:39 rtorrent
>
> # ps -e | grep screen
> 22291 ? 00:00:06 screen
>
> # cat /var/run/rtorrent.pid
> 22291
>
> So the PID is associated with screen, not with rtorrent.
>
> How could I manage this situation?
>
> I will really appreciate your help, best regards.
>
> --
> Josu Lazkano
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general