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: Josu Lazkano
Subject: Re: Check process inside screen terminal
Date: Mon, 16 May 2016 21:52:51 +0200

Thanks again,

I try with this script:
https://gist.githubusercontent.com/russellsimpkins-nyt/fd917de3131d5938a8c3529bdae27a79/raw/b9a466c6899c365b02fa76f68e04bc114850e8ac/rtorrent

But same happens:

address@hidden:/etc/init.d# /etc/init.d/rtorrent start
Starting rtorrent.
rtorrent started successfully.
address@hidden:/etc/init.d# ps -e | grep rtorrent
26488 pts/1    00:00:00 rtorrent
address@hidden:/etc/init.d# ps -e | grep screen
26484 ?        00:00:00 screen
address@hidden:/etc/init.d# cat /var/run/torrent.pid
26481
address@hidden:/etc/init.d# cat /var/run/rtorrent.pid
26484
address@hidden:/etc/init.d# ps -e | grep torrent
26488 pts/1    00:00:00 rtorrent

Regards.

2016-05-16 20:58 GMT+02:00 Russell Simpkins <address@hidden>:
> I was suggesting you edit your rtorrent start script:
>
> https://gist.github.com/russellsimpkins-nyt/fd917de3131d5938a8c3529bdae27a79#file-rtorrent-L68
>
> However, there seems no reason to watch the rtorrent pid if it's death kills
> the screen pid.
>
>
> On Mon, May 16, 2016 at 11:58 AM, Josu Lazkano <address@hidden>
> wrote:
>>
>> Thanks Russell,
>>
>> I don't understand your code, where must I add this? in the init
>> script or in the monit script?
>>
>> I normally configure this way:
>>
>> check process rtorrent with pidfile /var/run/rtorrent.pid
>>   start program = "/etc/init.d/rtorrent start"
>>   stop program  = "/etc/init.d/rtorrent stop"
>>
>> And yes, If I kill the rtorrent, the screen process disappear:
>>
>> address@hidden:~# ps -e | grep rtorrent
>> 17523 pts/1    00:00:00 rtorrent
>> address@hidden:~# ps -e | grep screen
>> 17521 ?        00:00:00 screen
>> address@hidden:~# killall rtorrent
>> address@hidden:~# ps -e | grep screen
>> address@hidden:~# ps -e | grep rtorrent
>>
>> 2016-05-16 17:34 GMT+02:00 Russell Simpkins <address@hidden>:
>> > 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
>> >
>> >
>> >
>> > --
>> > To unsubscribe:
>> > https://lists.nongnu.org/mailman/listinfo/monit-general
>>
>>
>>
>> --
>> Josu Lazkano
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general



-- 
Josu Lazkano



reply via email to

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