monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check process inside screen terminal


From: Russell Simpkins
Subject: Re: Check process inside screen terminal
Date: Mon, 16 May 2016 11:34:33 -0400

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 <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]