Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jul 2020 14:53:41 -0700
From:      bob prohaska <fbsd@www.zefox.net>
To:        "Janky Jay, III" <jankyj@unfs.us>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Gracefully killing and restarting a port build....
Message-ID:  <20200708215341.GB52503@www.zefox.net>
In-Reply-To: <25c3b51c-6fa2-4d69-cb39-5ac7802fc658@unfs.us>
References:  <20200708034703.GA50491@www.zefox.net> <941930819.28.1594197843269@localhost> <20200708153013.GA52503@www.zefox.net> <25c3b51c-6fa2-4d69-cb39-5ac7802fc658@unfs.us>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 08, 2020 at 09:34:53AM -0600, Janky Jay, III wrote:
> In the future, if you can, try using "screen" or "tmux" to run these
> large builds in so you don't take the risk of losing the
> terminal/console. Or, maybe I'm completely off-base as to how it was
> lost to begin with.
> 

AIUI, screen runs until the session terminates and then stops. In my case
the controlling terminal was lost when the ssh connection broke. Thus, I
think screen would have quit as well. Just why ssh connections keep breaking
is a mystery of long standing. I've been blaming it on feeble wifi between
my workstation (a Pi3B+) and WAP (D-Link DI524)  but have no persuasive evidence.
Not usually a big deal. 

The build was started using something like
make [options] > make.log &
so it kept beavering away after ssh gave up and still existed when I looked
for it with ps -a. There were still other ssh connections open and running
at the same time. Is there some way to re-attach a running background job to
a new controlling terminal? 

Thanks for writing!

bob prohaska

> On 7/8/20 9:30 AM, bob prohaska wrote:
> > On Wed, Jul 08, 2020 at 10:44:03AM +0200, Ronald Klop wrote:
> >>
> >> Kill the leaf nodes of the process tree. So kill the c++ processes. Or type ctrl-c if you have control of the terminal.
> > In this case I'd lost control of the controlling terminal and didn't 
> > know how to recover it.  After kill -9 <pid> of the initial make process 
> > I left the system standing overnight, to see if killing the original make 
> > process would eventually propagate down to the leaf nodes. It didn't. 
> >
> > Then I used killall c++, and again, it killed the named processes, but other things,
> > notably pkg, kept running. After waiting a few minutes they were killall-ed.
> > A notation from ninja eventually showed up in the logfile saying "interrupted
> > by user", so maybe ninja was the place to start shutting things down.
> >
> >> If you are running the compile in a jail (like poudriere) you might use "killall -j <jail> c++" or something similar.
> > No room for a jail on a Pi, alas....
> >> Pkill can be usable also.
> > Thank you, I didn't know about it.
> >> BTW: How graceful a restart works is outside of the scope of the ports framework and depends a lot on the structure of the chromium build process itself.
> >>
> > Understood. This is the first time I've ever needed to kill a port build.
> > Usually they die prematurely of natural causes!
> >
> > Thanks for your help
> >
> > bob prohaska
> >  
> > _______________________________________________
> > freebsd-ports@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"
> 
> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200708215341.GB52503>