Will a backgroup job stop after vpn connection fails?
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!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Will a backgroup job stop after vpn connection fails?
Hi:
I want to know whether I need to do something special to run a long running script from vpn terminal. Sometime, the vpn session may fail without a good reason. Will the backgroup job stop when the vpn terminal disconnect? If yes, what can I do to run a script which will run event the vpn session disconnect?
Last edited by ernietam; 05-08-2008 at 12:21 AM.
Reason: fix typo
Another way of achieving it is running the script on screen, if it is installed (usually is):
Code:
screen /path/to/yourscript.sh
Then you can press ^A d (or in other words, hold CTRL, press 'a', release CTRL, press 'd') to detach the screen - it will continue running even if you log out, and whenever you want to get it back onto your display, run
Code:
screen -d -r
The '-d' switch here isn't necessary unless the screen is already attached somewhere else, so you can leave it off if you know it's detached.
It depends on you then, which one is more comfortable for you.
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
Yet another way is "disown" command. You use it after the job is launched, which is a benefit. If you have only jobs you want to keep after disconnect, you just say "disown" until it complains about lack of background jobs. The drawback is that you cannot reconnect disowned jobs to your next session.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.