screen-users
[Top][All Lists]
Advanced

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

Re: need help to design screen fail-over


From: J. Bakshi
Subject: Re: need help to design screen fail-over
Date: Thu, 24 Dec 2009 16:36:27 +0530
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

J. Bakshi wrote:
> Hello list,
>
> I am using expect command to do auto ssh login. It is working well with
> screen like
>
> ` ` `
> spawn ssh  '$ssh_Server'  -t  "screen -aUS  '$ssh_Server'  -dR bash -l"
> expect "*assword:"
> send '$PASSWORD'
> send "\r"
> interact'
> ` ` `
> All OK.
>
> Now I am trying to do a screen fail over, so that if the remote server
> does not have screen then it will do just ssh login. I have tried with
>
> ` ` `
> spawn ssh " '$ssh_Server' -t  screen -aUS  '$ssh_Server' -dR bash -l ||
> '$ssh_Server' "
> ` ` `
>
> and it reports error as
>
> ` ` `
> send: spawn id exp4 not open
>     while executing
> "send testpassword"
> ` ` `
>
> What might be wrong here ? Any clue ?
> Thanks
>
>   

I have enabled the debug inside expect and found my earlier
configuration is taking the

" '$ssh_Server' -t screen -aUS '$ssh_Server' -dR bash -l ||  '$ssh_Server' "

as hostname which cretes the problem. So I ahve modified the config as

spawn ssh '$ssh_Server' -t  "screen -aUS '$ssh_Server' -dR bash -l ||ssh
'$ssh_Server'"

Now the server installed screen there has no problem. I can simply login
there. But the server does not have screen installed is asking for
pasword. expect should provide the password. I don't know where I have
messed the things. Any clue please ?




-- 
জয়দীপ বক্সী





reply via email to

[Prev in Thread] Current Thread [Next in Thread]