screen-users
[Top][All Lists]
Advanced

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

Re: is there a keepalive/retry/restart feature?


From: abez
Subject: Re: is there a keepalive/retry/restart feature?
Date: Thu, 31 Mar 2005 19:01:30 -0800 (PST)

I don't think that feature is needed in screen. 

Here's an alternative solution:

#!/usr/bin/perl
#exponrun.pl
my $wait  = 1;
for(;;) {
        system(@ARGV);
        $wait = ($?)?($wait*2):1;
        sleep $wait;
}

screen -t mutt exponrun.pl mutt

On Thu, 31 Mar 2005, Mordechai T. Abzug wrote:

> 
> Say I have the following in my .screenrc:
> 
> screen -t mutt mutt
> 
> If I accidentally exit my mutt process, I need to go through several
> steps to recreate the window, rename it, and create a new mutt
> process.
> 
> One fix is to do something like this:
> 
> screen -t mutt sh -c "while true; do mutt; sleep 1; done"
> 
> But I don't much like that.  For example, if the command is "ssh host"
> and host isn't defined, the command might fail many, many times before
> I noticed.  I would want some kind of exponential backoff, respawn
> limits, and the like.
> 
> Is there a better solution?  Preferably a flag to the screen command
> that automatically respawns the command if it exits, with configurable
> backoff behaviour.
> 
> Thanks!
> 
> - Morty
> 
> 
> _______________________________________________
> screen-users mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/screen-users
> 

-- 
abez ------------------------------------------
http://www.abez.ca/ Abram Hindle (address@hidden)
------------------------------------------ abez





reply via email to

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