Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am connected to a remote server via ssh, and am compiling software with the traditional configure, make, and make install method. My internet is 4g hotspot created by my phone, and during the make, I lost connection when train went through tunnel.
Will make still continue on the remote server? If I reconnect is there a way to view the old process? Or, if I wait long enough, can I assume it finished, reconnect, and proceed with make install?
Thanks for answering. I was compiling a kernel, and the bzImage appeared, so I thought maybe it had completed. But I don't want to go through a lot of hoops and have it panic in the end; which is why I asked.
Thanks for both suggestions! Both seem like promising solutions. I'm going to try them in order, if running make in background as daemon doesn't do it. While waiting for a response, I tried this:
root@myhost# make bzImage > makeout &
A file called makeout appeared, and I tailed a few lines, and later again, and the lines changed so I know the file is filling up with the output. Hopefully, if my connection drops, the process 13385 will continue. I'll reconnect in the morning once I wake up, and tail the end of makeout to see if it looks like it completed. If not I will try screen and mosh, which look like things to try anyways.
When you first log in, you should run tmux. It will keep your session running even when disconnected.
Then if the ssh connection breaks, you can log in again and reattach tmux to join your session in progress.
If you are on a train, or in another situation, where the connection breaks a lot, you can use a loop to reconnect. Just add your key to the agent and it works:
while ! ssh -t -p 22 -i ~/.ssh/somekey server.example.com 'tmux a || tmux';do sleep 2;done
Again, tmux will keep your session running so if there is a lot of output while you were gone, you will have to roll back in the tmux buffer as opposed to the terminal window itself. tmux has a lot of improvements over screen, but screen could be used in a similar manner though the options are different.
I haven't tried mosh yet, as it wasn't included with slackware. Screen and Tmux are, and they both worked, and so I guess it doesn't matter--like emacs and vi--just pick one and go. As soon as I reached a prompt after ssh into remote server, I typed
and new prompt appeared; Everything looked the same, and I typed
root@myhost# nohup make bzImage > makeout-bzimage &
The process ID appeared, and eventually finished with no hickups. Then I exited, and it said I exited screen. I exited again and closed ssh session.
I started a new session, and this time typed
and new prompt appeared, as well as a green status bar that visually let me know I was in tmux. Then I typed
root@myhost# nohup make modules > makeout-modules &
and I did have an interrupt in connectivity during this session. When I reconnected, I did the
root@myhost# tmux a
and the same window with green status bar appeared, with the command still running. It finished. I configured my system to use the new kernel, rebooted, and crossed my fingers. A few minutes later, I was into my system running a new kernel. Yeah!
If you're running inside of screen or tmux then you don't need to use nohup. Both are designed to maintain the tty when you get disconnected. So you can just reattach to the session when you log in again.