Jump to content
The mkiv Supra Owners Club

unix shells


paul_y3k

Recommended Posts

just thought I'd give it a whirl here ...

 

I'm currently doing some upgrade work on a unix server. The install program goes off and runs several sql scripts in the background, and given the large size of the database this takes several hours to complete.

 

I'm finding that no matter what i use ... putty, telnet etc that after 2.5 hours just sat in the installer waiting for the next prompt the session timesout or in the case of putty i get a network error disconnect message.

 

it seems that theres some sort of timeout here, but I'm jiggered if i can find it.

Link to comment
Share on other sites

 

it seems that theres some sort of timeout here, but I'm jiggered if i can find it.

 

Are you going through a firewall of some sorts to an external server? That could be a reason for the timeout.

 

I'd have suggested nohup too, but wouldnt be too good if you need to enter values as it goes.. can you not hardcode them into the script?

Link to comment
Share on other sites

I thought with screen if the connection dies the app running stays alive, when you reconnect you run screen to bring back your session.

 

If hes running a SQL script from a SQL prompt, it will die if the session dies, if you nohup it to run in the background it will continue on the server and not rely on the terminal to run.

 

But as he says, he needs to type in values when prompted so he cant nohup it unless he hardcodes the values.

Link to comment
Share on other sites

It's several hours in a noisy cold machine room infront of a console for you! :D

 

There isn't some kind of cron job or something that's killing off sessions after a max time?

 

Just a couple of n00000000by type suggestions spawned by my half quarter-arsed unix knowledge.

Link to comment
Share on other sites

If hes running a SQL script from a SQL prompt, it will die if the session dies, if you nohup it to run in the background it will continue on the server and not rely on the terminal to run.

 

But as he says, he needs to type in values when prompted so he cant nohup it unless he hardcodes the values.

 

Using Screen for Session Management

 

You are logged into your remote server via SSH and happily plucking along at your keyboard and then it happens. Suddenly, the characters stop moving and then you get the dreaded "Connection Closed" message. You have just lost your session. You were halfway through some task and now you have to start over. Ugh. Well you can prevent this from happening by using screen. Screen can not only save you from disconnection disasters, but it also can increase your productivity by using multiple windows within one SSH session.

 

 

What is Screen?

As the man page states, "Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells)." This can be a life saver when working on your dedicated server. Screen has a several great features for helping you administer your server more productively and safely. I am going to discuss the three features (multiple windows, logging, sessions) that I use the most but be sure to see the man page for full details.

Link to comment
Share on other sites

Example, login and type screen, then run something like top and kill your connection.

 

Login again and type screen -ls to list the screens running, it should now have one detached.

 

Type screen -r followed by the screen in the list and it will recover and you should be presented with Top which you started on the previous login.

 

 

Works for me :D

Link to comment
Share on other sites

hmm interesting .. i'll have a play with these screen.

I actually found it to be a problem with both putty and telnet .. that after 2.5 off no foreground activity the session is disconnected. Our unix bods cant answer why though.

I've managed to work around it by using an xwindows client session, on this server, but i dont know if its an option on live as xwin is disabled lol.

ohh what fun.

Link to comment
Share on other sites

Hi again Paul!

 

Wow - a supra owner in swindon who's also a UNIX guy. We definately should meet up. You can see my server room *grin*

 

I use screen on a daily basis, it's great for kicking jobs off at home, and then re-attaching elsewhere, either at work or from my Treo to check progress. Really handy stuff!

 

James

Link to comment
Share on other sites

Paul, just a thought, why not try a VNC server session to your unix box, that way you can connect to the desktop, then if your session dies, you can reconnect and your terminal window will still be there waiting for your responses.

 

Just make sure your profiles are running correctly when you open the terminal windows :)

Link to comment
Share on other sites

Wez, thanks for that, I'll have a nose :) Wez, is that screen a 3rd party program? I've checked one of our HP-UX boxes and a Sun box and theres nothing. :cry:

 

Paul, yeah Putty is nice :)

 

Yeah, but its available for free for most platforms.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. You might also be interested in our Guidelines, Privacy Policy and Terms of Use.