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

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH



On Tue, Feb 07, 2023 at 02:20:25PM +0000, Ottavio Caruso wrote:
> Am 07/02/2023 um 12:12 schrieb Greg Wooledge:
> > On Tue, Feb 07, 2023 at 10:30:22AM +0000, Ottavio Caruso wrote:
> > > The reason I cannot just ssh into LAP2 and then run hibernate.sh from the
> > > shell is because, if I do, I get a dangling zombie ssh shell that freezes my
> > > LAP1.
> > 
> > https://mywiki.wooledge.org/BashFAQ/063
> 
> But then I lose confirmation the command executed successfully, don't I?

Without knowing what your hibernate.sh script does, it's quite difficult
to advise you on how to improve it.

Also bear in mind, I'm probably not the best person to give advice
on laptop-specific issues such as hibernation.  I don't use a Linux
laptop, and I've never hibernated a system in my life.

Generally speaking, though -- if your ssh client is hanging, it's because
some process with stdout and/or stderr opened to the ssh client is
still running.  That *one* process might need to have its output
redirected.  The rest of the script can be left alone.

If that single process is the one that's causing the laptop to hibernate,
and doesn't end until the laptop is re-awakened, then you won't know
whether it "executed successfully" until the laptop is re-awakened.
Not seeing that process's exit status seems acceptable.

It's also conceivable that you're using the wrong command(s) to invoke
the hibernation.  That part is 100% outside my experience, though.


Reply to: