public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Again some "headless" stuff/question
@ 2014-10-05  4:34 meino.cramer
  2014-10-05 12:33 ` thegeezer
  2014-10-07 11:45 ` Neil Bothwick
  0 siblings, 2 replies; 6+ messages in thread
From: meino.cramer @ 2014-10-05  4:34 UTC (permalink / raw
  To: Gentoo

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Again some "headless" stuff/question
  2014-10-05  4:34 [gentoo-user] Again some "headless" stuff/question meino.cramer
@ 2014-10-05 12:33 ` thegeezer
  2014-10-05 14:10   ` meino.cramer
  2014-10-07 11:45 ` Neil Bothwick
  1 sibling, 1 reply; 6+ messages in thread
From: thegeezer @ 2014-10-05 12:33 UTC (permalink / raw
  To: gentoo-user

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Again some "headless" stuff/question
  2014-10-05 12:33 ` thegeezer
@ 2014-10-05 14:10   ` meino.cramer
  0 siblings, 0 replies; 6+ messages in thread
From: meino.cramer @ 2014-10-05 14:10 UTC (permalink / raw
  To: gentoo-user

thegeezer <thegeezer@thegeezer.net> [14-10-05 14:36]:
> 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

Best!
I dont wanted to experiment (and fail)...there were chances to get no
access to the system anymore...

THX!
Best regards,
mcc




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Again some "headless" stuff/question
  2014-10-05  4:34 [gentoo-user] Again some "headless" stuff/question meino.cramer
  2014-10-05 12:33 ` thegeezer
@ 2014-10-07 11:45 ` Neil Bothwick
  2014-10-07 16:46   ` meino.cramer
  1 sibling, 1 reply; 6+ messages in thread
From: Neil Bothwick @ 2014-10-07 11:45 UTC (permalink / raw
  To: gentoo-user

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

On Sun, 5 Oct 2014 06:34:55 +0200, meino.cramer@gmx.de wrote:

> 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?

I have this in ~/.zshrc.

if [[ "${TERM}" != "screen" ]] && [[ -z "${STY}" ]] && [[ ! -f ~/.noscreen ]]; then
    screen -xRR && exit
    fi


-- 
Neil Bothwick

Last words of a Windows user: = Where do I have to click now? - There?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Again some "headless" stuff/question
  2014-10-07 11:45 ` Neil Bothwick
@ 2014-10-07 16:46   ` meino.cramer
  2014-10-07 20:16     ` Neil Bothwick
  0 siblings, 1 reply; 6+ messages in thread
From: meino.cramer @ 2014-10-07 16:46 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick <neil@digimed.co.uk> [14-10-07 17:24]:
> On Sun, 5 Oct 2014 06:34:55 +0200, meino.cramer@gmx.de wrote:
> 
> > 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?
> 
> I have this in ~/.zshrc.
> 
> if [[ "${TERM}" != "screen" ]] && [[ -z "${STY}" ]] && [[ ! -f ~/.noscreen ]]; then
>     screen -xRR && exit
>     fi
> 
> 
> -- 
> Neil Bothwick
> 
> Last words of a Windows user: = Where do I have to click now? - There?

Hi Neil,

this logs me out instantly....

If executed directly from the commandline it works.
Is there any other settings, which may effect screen?
...there is no .screenrc...

Best regards,
mcc






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Again some "headless" stuff/question
  2014-10-07 16:46   ` meino.cramer
@ 2014-10-07 20:16     ` Neil Bothwick
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Bothwick @ 2014-10-07 20:16 UTC (permalink / raw
  To: gentoo-user

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

On Tue, 7 Oct 2014 18:46:58 +0200, meino.cramer@gmx.de wrote:

> > > 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?  
> > 
> > I have this in ~/.zshrc.
> > 
> > if [[ "${TERM}" != "screen" ]] && [[ -z "${STY}" ]] && [[ ! -f
> > ~/.noscreen ]]; then screen -xRR && exit
> >     fi

> this logs me out instantly....
> 
> If executed directly from the commandline it works.
> Is there any other settings, which may effect screen?
> ...there is no .screenrc...

Not that I'm aware of, but it "just works"[tm] for me.

I don't have a .screenrc either and /etc/screenrc is standard apart from
changing the command key and caption bar.

Check what $TERM is set to both in and out of screen. Whenver this has
not worked as exected in the past it has been because of changes to
environment variables.


-- 
Neil Bothwick

Very funny Scotty.. now beam down my pants!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-07 20:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-05  4:34 [gentoo-user] Again some "headless" stuff/question meino.cramer
2014-10-05 12:33 ` thegeezer
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox