# Internet connection lost while performing update



## Grafula (Jun 11, 2013)

Hi,

This is a hypothetical question: I have *F*reeBSD 9.1 installed on a VPS to which I connect from my office via SSH. I keep my installed programs updated using portmaster. Normally I just update the ports and then run `portmaster -Bda`. What would happen if I lose my internet connection here in my office? Would the update finish or not?

Thanks.


----------



## wblock@ (Jun 11, 2013)

portmaster(8) checks that all the distfiles are available in /usr/ports/distfiles before it starts building.  So it should be able to finish.

Please make sure you read new entries in /usr/ports/UPDATING and do all that apply to your system before using -a with portmaster(8).


----------



## ShelLuser (Jun 11, 2013)

Grafula said:
			
		

> Normally I just update the ports and then run `portmaster -Bda`. What would happen if I lose my internet connection here in my office? Would the update finish or not?


That heavily depends on your shell and if it has the nohup option set or not. For example, on the Korn shell this option provides this functionality:


```
Do not kill running jobs with a HUP signal when a login shell exists.
```
To my knowledge this is on by default on most shells, but I'm not sure.

But when in doubt simply use sysutils/tmux. It will allow you to generate a virtual console in which you can do anything you want. The moment your connection drops then any processes you started will remain active.

Better yet: when you logon again you can simply re-attach to the virtual console (using `$ tmux attach` for example) and you're fully back in control, even get to see the last lines of output which were generated (which is very handy with portmaster since you'll see in one moment whether the update was successfully completed or not).


----------



## wblock@ (Jun 11, 2013)

D'oh.  Once again I answer the wrong question.  @ShelLuser is right, sysutils/tmux is the answer.


----------

