Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

one_env missing data, context.sh missing #84

Closed
tkald opened this issue Sep 20, 2017 · 4 comments
Closed

one_env missing data, context.sh missing #84

tkald opened this issue Sep 20, 2017 · 4 comments

Comments

@tkald
Copy link

tkald commented Sep 20, 2017

On 1st run, context files are not correctly created:
one_env files has only 3 lines on it (instead of 50) and context.sh file is missing.

cat /tmp/one_env
export TOKENTXT=""
export VMID="2580"
export ONEGATE_ENDPOINT="http://1.2.3.4:5030"

After vm reboot (second run), all seems fine though.

One-context 5.4.1 on Ubuntu 16.04 vm, OpenNebula 5.4.1.
All is working as expected with one-context version 5.0.3.

See attached log:
context5.4.1.log.txt

@vholer
Copy link
Contributor

vholer commented Sep 20, 2017

Hi @tkald, in 5.4 the contextualization scripts were split into pre/post networking stages. They are now prefixed with loc- or net-. On a fresh install on the Ubuntu 16.04, the content of /etc/one-context.d should look like:

# ls /etc/one-context.d/
loc-05-grow-rootfs  loc-16-gen-env                net-15-hostname
loc-10-network      loc-20-set-username-password  net-97-start-script
loc-10-network-pci  loc-22-ssh_public_key         net-98-execute-scripts
loc-11-dns          loc-24-ssh_host_key           net-99-report-ready
loc-14-mount-swap   net-11-fix-loopback

Based on your logs, your directory contains also the old unprefixed scripts:

Sep 20 11:34:42 ubuntu one-contextd[1259]: Processing network scripts
Sep 20 11:34:42 ubuntu one-contextd[1261]: Script 05-grow-rootfs: Starting ...
Sep 20 11:34:42 ubuntu one-contextd[1305]: Script 05-grow-rootfs output: NOCHANGE: partition 1 is size 14677983. it cannot be grown
Sep 20 11:34:42 ubuntu one-contextd[1306]: Script 05-grow-rootfs: Finished with exit code 1
...
Sep 20 11:35:07 vm-2580 one-contextd[2321]: Script 99-report-ready: Starting ...
Sep 20 11:35:08 vm-2580 one-contextd[2332]: Script 99-report-ready: Finished with exit code 0
Sep 20 11:35:08 vm-2580 one-contextd[2334]: Script net-11-fix-loopback: Starting ...
Sep 20 11:35:08 vm-2580 one-contextd[2338]: Script net-11-fix-loopback: Finished with exit code 0
Sep 20 11:35:08 vm-2580 one-contextd[2340]: Script net-15-hostname: Starting ...

Unprefixed scripts (if found) are started in the post-networking stage. Also, the location of state files was moved into /var/run/one-context/, you'll find there the one_env generated by the current scripts. Please, clean your image from the old scripts, it should behave.

BTW if you simply upgraded the old package with a new package and the old (unprefixed) scripts left there, I see it as a packaging problem. I'll check if it happens. Thank you.

@tkald
Copy link
Author

tkald commented Sep 20, 2017

Cleaned up old install and reinstalled context 5.4.1 version.
I did miss state files location change - now in /var/run/one-context/ folder everything seems ok.

There're still some errors in the syslog about one-context-reconfigure-delayed service...
context5.4.1.log.txt

YES, I've had serveral older context package installations, always upgraded to newer package version.

@vholer
Copy link
Contributor

vholer commented Sep 21, 2017

Problem with leaving old scripts was caused by the packager, which automatically marked all files in /etc as configuration. I made a change in packaging, thank you.

And, about the problem with failing reconfiguration, it's a known issue. You don't have to be worried about this service if it fails only during the boot. There are multiple services, 2 for boot-only contextualization (one-context-local and one-context), 2 for later reconfiguration (on NIC hotplug and CONTEXT ISO change). Unfortunately, although the reconfiguration services have proper dependencies so they should run after boot-only services, when a machine is booting, NIC cold plugs trigger also the reconfiguration via udev and (don't know why) ignores the service dependencies. The error you see is a very last check in the script to fail if this happens.

@tkald
Copy link
Author

tkald commented Sep 21, 2017

Thank you!

@tkald tkald closed this as completed Sep 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants