2

I have a program that runs on Ubuntu (14.04) whether I am in the terminal or not. This program relies on a vpn connection, for which I am using vpnc (cisco).

I have added vpnc to my reboot and start up processes, and my program works fine when I reboot (and soon thereafter log in to the terminal). But when I exit the terminal, I lose the vpn connection and the program throws an exception.

Can anyone help me figure out how to keep the vpn connection running even after I log out of the terminal?

2 Answers2

1

You need to start vpnc using nohup. See this question.

For example to start command and to redirect its output to command.log use:

nohup command > command.log &

If you want to see the output use:

tail -f command.log
sergej
  • 660
1

Try with Byobu:

Byobu is a light, powerful, text-based window manager based on GNU Screen . Using Byobu, you can quickly create and move between different windows over a single SSH connection or TTY terminal, monitor dozens of important statistics about your system, detach and reattach to sessions later while your programs continue to run in the background.

Just open byobu

byobu

In this new terminal start vpnc or what you need

press F6 to detach from this session

If you need this session you just need to run byobu again with

byobu

This session will "survive" your logout :)

For more shortcuts see the link in the first line...

IMPORTANT:

Don't forget that if you want this session to stay active you must leave the session with F6

Wolfy
  • 8,050