* F #227: Update network context
- Rework support for DHCP and DHCP6
- Support new context ETH?_METHOD and ETH?_IP6_METHOD
- Add new loc-10-network netcfg interface: initialize_network
- Wipe out stale netcfg configs to avoid conflicts
- Add reference links for some workarounds
- Fix shellcheck
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Let networkd to use default for IPv6
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Improve cleanup in initialize_network
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Fix Network Manager reconfiguration
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* M #-: Update systemd service descriptions
* F #227: Adapt FreeBSD, support live reconfiguration
* B #239: Use systemctl --no-block in udev on Debian-like
* F #227: Fix unmanaged-devices with NM on ubuntu
Instead of touching 10-globally-managed-devices.conf during netcfg-nm
script we are shipping the file as part of the package. The reason is
that this file must be in place *BEFORE* Network Manager daemon is
started and reload is not sufficiant (read: it does not work). Other
option would be to restarting NM instead of reloading but that would
ifup/down all interfaces which is not a desired behavior especially if
those are in use (recontextualization).
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Improve cleanup for NM
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Fix initialize_network usage and cleanup
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Workaround FreeBSD emul. NIC attach, manage rtsold
* F #227: Fix is_true argument usage
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Improve NM reconfigure
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Fix NM and networkd reconfiguration
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #227: Fix netplan's issue with empty stanzas
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* B #239: Use abs. path /bin/systemctl in Debian-like udev
Closes#239
Co-authored-by: Vlastimil Holer <vholer@opennebula.io>
Periodically runs one-context-reconfigure to poll for changes
in vCenter context metadata to apply. Implemented via:
- systemd timer conditionally started only on vCenter
- cron job which checks for vmware and triggers service on non-systemd
Closes#185
- Use one script loc-10-network for all systems
- Deduplicate and cleanup the code
- Create a source file with functions
- Remove usage of global variables while using shared functions
- Add support for different network configuration via new context
parameter: CONTEXT_NETCFG_TYPE
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
The default 'awk' _alternative_ on the Debian is an old mawk of version
1.3.3 with plenty of bugs and problems. One of them is the lack of
support for POSIX regex character classes which old mawk does not know
despite the fact that it does advertise a support for extended regex (as
egrep for example).
This was reported and fixed in 2009 with version of 1.3.4 but Debian is
still using the old unfixed version 1.3.3:
https://bugs.launchpad.net/ubuntu/+source/mawk/+bug/69724
This commit workaround this issue by simple test and possible abort if
the usage of an incompatible awk implementation is unreasonable - user
choice.
Note: Currently just only two optional (non-default) tests are skipped
due to this issue.
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
Because MOUNT_DIR can be different than real MOUNT_DIR,
so we would need to pass it to realpath. Which is not on
some legacy systems like RHEL 6 or Ubuntu 14.04.
- In case the CD-ROM is not mounted "glabel status | grep CONTEXT | awk '{print $3}'"
will have a null string which will eventually assign the value "/dev/" to "dev_context"
variable. In later occasions while existence of "dev_context" is checked it will
always return true and no elif conditions will be executed. Add additional glabel check
for BSD.
- In case the CD-ROM is not mounted and used there is nothing to unmount and eventually
trying to unmount will throw error. So add an additional check to see if "MOUNT_DIR" is
used as any mount points or not.
Introduce new OpenNebula directory /var/lib/one-context where a new tmp
directory is located. This new one will not be mounted with noexec
option on any system by default.
Add cleanup handler on the script exit and ensure the correct return
code for the init scripts (if one or more fail then return non-zero).
Update onesysprep and set its version by generate.sh script.
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
We must make sure "one-context-force.service" is not run during boot
disk detection but on hotplug events.
When booting with a swap partition on the disk, the udev rules will
start the "one-context-force" service long before "one-context-local"
and "one-context".
This results in the system being in "degraded" state as reported by
"systemctl is-system-running".
* src/usr/lib/systemd/system/one-context-force.service##systemd.one:
add conditions to run only on hotplug events.
Signed-off-by: Daniel Dehennin <daniel.dehennin@ac-dijon.fr>
* F #964: Allow FILES_DS for vCenter
* F #964: Move code to one-contextd
* F #964: Use arithmetic expansion instead of let
* F #964: Decrease used vars
* BSD context
* BSD service scripts
* Added ToDo
* Add context scripts
* Freebsd packaging
* Freebsd packaging finished
* Rollback OS detection
* Fix bug with default gateway configuration
* Add services for pfsense
* Remove bsd context script
* Replace /bin/bash with /usr/bin/env bash
* Remove /bin/bash symlink creation
* Fix service naming
* Replace /bin/bash for /bin/sh on BSD service scripts
* Fix hardcoded cdrom drive
* Fix service start on boot bug on pfsense
* Fix bug when creating new users
* Fix bud with sudo
* Fix bug with crypted passwords
* Fix bug with hostname
* Fix sed bug related to hostname
* Fix bug with domains
* Fixed bug: variable should be local