-
-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a backup of network/interfaces before overwriting it #50
Comments
Not priority. Please make a PR. :) Thanks for you issue! |
@oparoz Now when thinking about it, the VM scripts are designed to be installed on a clean system, and we overwrite it to get the correct variables for example $IFACE. So why save it? |
It's true that, because I didn't want everything to be managed by the script, I used it on a fresh install of Ubuntu server and that part of the script did not work and left the VM disconnected from the network. |
Please explain further about the bug you found so that we can fix it. The VM is designed to fit ALL systems, but at the same time you have to mount it correctly (Bridged mode i.e.) for it to work. Example: The VM uses ens33 as IFACE (network interface) when created by us, then you as a user downloads it and have another interface (let's say eth0), the script will fail with the ens33 IFACE so that's why we change it. In the install script we only check that the network is OK without changing anything as you probably use the install script to install the VM for the first time. In the startup script though (the one that is pre installed and run when the user boots the released VM for the first time) we do change the interfaces file becuase of the reason above and then test that the network is OK here: https://github.com/nextcloud/vm/blob/master/nextcloud-startup-script.sh#L42-L61 The "correct interface" is just the original interface on Ubuntu 16.04 with new IFACE, so that it breaks seems unlikley, and even if it did, you are not able to continue as we will stop you before any scripts are downloaded. That's by design. The scripts are fetching all the latest scripts from Github and it will break without them, but again - we test if your network connection is OK before running anything. So where did it break? |
Maybe we should add more checks? @oparoz |
The interface was configured with a static IP and the script replaced the config with one which uses DHCP and that didn't work. That's how it broke. I guess I could also write something which makes a backup of these files before trying to install NC... |
So you setup static IP address before you ran the script? Yeah, that won't work as that is not intentioned by design. Don't really know how to come around that issue as (again) the scripts installs on a completely fresh VM with no changes prior to the scripts are run. Ofc, you can always make changes afterwards. Any ideas on how to fix this? |
I think the easiest thing to do would be to simply ask.
You could take it further by showing a diff, but it's probably not worth it at this stage |
In 99% of the cases the IFACE is different than the one on the host that created the VM. What is your proposal, to ditch the fix we added some months back so that users don't have to retype the IP address in the interfaces file if they already set up static IP? Sorry I'm not following here. Are you good in bash? Please make me a proposal :) |
JFTR: Just as a few examples where we have have struggled with getting the correct IFACE and IP address in the past to fit as many of the useecases as possible. Right now I think it works great. |
Thanks for the references :) For now, I'm just suggesting to make this step optional, just like the let's encrypt step. Some sysadmins will have the networking components under control and will only want to install Nextcloud. |
Problem is that requires more skills than I have right now, many if statements in each other.
Where to you propose for the fix to go in? |
Hmmm.... The steps which kill the network happened a lot earlier https://github.com/nextcloud/vm/blob/master/nextcloud-startup-script.sh#L42-L46 But thinking about it, this will never work when using a remote console. So maybe there isn't any issues if the script runs until the end. |
Still it would be nice if those 2 steps could be grouped and made optional, like you did this step: |
Actually, that's another issue. Using a remote console will actually work as the IP isn't changed until the VM is rebooted even if you change it manually. In other words. if you started with an IP that IP will continue to server the VM until you reboot. Scenario 1:
Scenario 2:
So, resetting the connection won't matter even if you set a static IP to begin with, as you will get prompted with the interfaces file a second time, and then have the chance to recover your static IP. And as the IP doesn't change until you reboot anyway (service network restart doesn't work always, and not even ifdown and ifup sometimes), same goes for DHCP. Also, the scripts wouldn't download at all without a working internet connection and you would be stopped before the script would even continue here: https://github.com/nextcloud/vm/blob/master/nextcloud-startup-script.sh#L48-L61 Are you following :) |
Point 4 makes the Let's Encrypt script fail if you manually edit any settings before the script is run. |
But sure, I could add a copy of the original interfaces file before the script make any changes, but after all it's just about adding like 6 numbers in the interfaces file as you are prompted here:https://github.com/nextcloud/vm/blob/master/nextcloud-startup-script.sh#L294 and have the possibility to add you specific IP again ...if that's what you mean? |
But then again, why make a backup if the user isn't even aware of that happening... Or are you thinking something like
|
ping @oparoz --^ ? |
No I get what you mean. If you install on a VPS as root, you don't get promoted and the script starts instantly, and the first thing it does is to overwrite the interfaces file. I will change this behaviour. |
It would be a good idea to make a backup of /etc/network/interfaces before overwriting it, because sometimes the scripts are used outside the VM because not everything needs to be installed, etc. and overwriting an existing config can break things.
The text was updated successfully, but these errors were encountered: