From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4796913838B for ; Sun, 5 Oct 2014 12:33:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A541E0904; Sun, 5 Oct 2014 12:33:16 +0000 (UTC) Received: from uberouter3.guranga.net (unknown [81.19.48.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E518AE08E6 for ; Sun, 5 Oct 2014 12:33:14 +0000 (UTC) Received: from [192.168.1.2] (unknown [86.47.74.195]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by uberouter3.guranga.net (Postfix) with ESMTPSA id D4F36417 for ; Sun, 5 Oct 2014 13:33:12 +0100 (BST) Message-ID: <54313A7F.9050404@thegeezer.net> Date: Sun, 05 Oct 2014 13:33:03 +0100 From: thegeezer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Again some "headless" stuff/question References: <20141005043455.GA3856@solfire> In-Reply-To: <20141005043455.GA3856@solfire> Content-Type: multipart/alternative; boundary="------------000708090205090907050001" X-Archives-Salt: 3ef0e2d6-93de-4440-b282-4ebd6bd1f571 X-Archives-Hash: c71a202e89b04c8607f020822448ec00 This is a multi-part message in MIME format. --------------000708090205090907050001 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 05/10/14 05:34, meino.cramer@gmx.de wrote: > Hi, > > for starting and running a script on a headless system for me "nohup" > works perfectly. > For interactive session via ssh screen/tmux turned out to be the > solution to detach from jobs started from the commandline. > Both are hints/help I received from the community here. :) > Thank you very much !!! :))) > > Since the screen/tmux thingie is THAT convenient I would like to start > this as the default when logging in via ssh. > I could write a script which is started by the shell (zsh) which in > turn is started as part of the login process. > Screen would start another shell and TADA!... > But this is an embedded system... > > The result should be a running screen session right after login via > ssh. > > Is there any "shorter path" to what I am trying to do -- without the > cascade of shells which do nothing but waiting of the child process to > end? > > Thank you very much in advance for any help! Have a nice Sunday! > > Best regards, > mcc > > you can auto-start a program of your choice directly from an ssh command. for example: $ ssh -t myhost screen -R -d will connect over ssh and then run screen to auto detach then reattach a running a screen or start a new one if not. you can of course name your screens so you can connect to mycompilewindow or mycleverideasvimwindow alternatively, and if you tend to use a mobile device for ssh you can but something like in your .bashrc if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then screen -R -d fi which would check to see if ssh variables are set by openssh i.e. it is an ssh session and then run screen for you hth --------------000708090205090907050001 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 05/10/14 05:34, meino.cramer@gmx.de wrote:
Hi,

for starting and running a script on a headless system for me "nohup"
works perfectly.
For interactive session via ssh screen/tmux turned out to be the
solution to detach from jobs started from the commandline.
Both are hints/help I received from the community here. :)
Thank you very much !!! :)))

Since the screen/tmux thingie is THAT convenient I would like to start
this as the default when logging in via ssh.
I could write a script which is started by the shell (zsh) which in 
turn is started as part of the login process.
Screen would start another shell and TADA!...
But this is an embedded system...

The result should be a running screen session right after login via
ssh.

Is there any "shorter path" to what I am trying to do -- without the
cascade of shells which do nothing but waiting of the child process to
end?

Thank you very much in advance for any help! Have a nice Sunday!

Best regards,
mcc



you can auto-start a program of your choice directly from an ssh command. for example:
$ ssh -t myhost screen -R -d
will connect over ssh and then run screen to auto detach then reattach a running a screen or start a new one if not.
you can of course name your screens so you can connect to mycompilewindow or mycleverideasvimwindow

alternatively, and if you tend to use a mobile device for ssh you can but something like in your .bashrc
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
  screen -R -d
fi

which would check to see if ssh variables are set by openssh i.e. it is an ssh session and then run screen for you

hth
--------------000708090205090907050001--