public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: thegeezer <thegeezer@thegeezer.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Again some "headless" stuff/question
Date: Sun, 05 Oct 2014 13:33:03 +0100	[thread overview]
Message-ID: <54313A7F.9050404@thegeezer.net> (raw)
In-Reply-To: <20141005043455.GA3856@solfire>

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2231 bytes --]

  reply	other threads:[~2014-10-05 12:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-05  4:34 [gentoo-user] Again some "headless" stuff/question meino.cramer
2014-10-05 12:33 ` thegeezer [this message]
2014-10-05 14:10   ` meino.cramer
2014-10-07 11:45 ` Neil Bothwick
2014-10-07 16:46   ` meino.cramer
2014-10-07 20:16     ` Neil Bothwick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54313A7F.9050404@thegeezer.net \
    --to=thegeezer@thegeezer.net \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox