Unix Technical Forum

vmstat execution via ssh don't go background

This is a discussion on vmstat execution via ssh don't go background within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hello, I have a problem with ssh and vmstat on AIX. I want to run a vmstat from a ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 09:31 AM
Denis Valdenaire
 
Posts: n/a
Default vmstat execution via ssh don't go background

Hello,

I have a problem with ssh and vmstat on AIX.
I want to run a vmstat from a client like this :

user@client> ssh -l user server " vmstat -t 60 10 > /tmp/vmstat.log & "

Problem is : the ssh don't terminate. In fact, the commande itself
seems to go in background,
when i hit Ctrl-C it stays alive (so i don't need a nohup);

But if i start this command with a crontab entry, it will hang
forever...

Any ideas ?

version of AIX is 5.3 on pSeries, but i'm pretty sure it ... well IT IS
the same on Solaris, i tested it. (Except that the -t option don't
work on Solaris)

Thanks in advance

Denis Valdenaire

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 09:31 AM
Darren Tucker
 
Posts: n/a
Default Re: vmstat execution via ssh don't go background

On 2006-05-12, Denis Valdenaire <dvaldenaire@gmail.com> wrote:
> user@client> ssh -l user server " vmstat -t 60 10 > /tmp/vmstat.log & "
>
> Problem is : the ssh don't terminate. In fact, the commande itself
> seems to go in background,
> when i hit Ctrl-C it stays alive (so i don't need a nohup);


sshd is waiting for the descriptors attached to the vmstat to close (you
redirected stdout, but stdin and stderr are still there). Try:
ssh server "vmstat -t 60 10 >/tmp/vmstat.log </dev/null 2>/dev/null &"

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 09:31 AM
Denis Valdenaire
 
Posts: n/a
Default Re: vmstat execution via ssh don't go background

Thanks, it works perfectly.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:40 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com