Ubuntu 14 context

(Florian Heigl) #1

I’m having a lot of trouble with an image that used to have the 4.x ONE context installed.
I have uninstalled it, using apt-get remove (no purge, sadly).
By now I’ve reinstalled and purged and reinstalled both versions, leaving only the 5.6.x ONE context.
I’ve also fully udpated the VM.
It seemed to work after that but on second glance, no. it doesn’t even update the NIC config.
I would like to reproduce whats happening but most of the context upstart scripts just tell me they’d need to run at boot time. That’s not helping :wink:
Is there a way I can re-run this manually and in the same exact manner as it should happen on boot?
to see what happens?

But, worse, I also still got some problems with onegate.

Doesn’t seem to matter if I source the context or not, it’ll always through some ruby error.

root@svc-ubuntu14:~# . /var/run/one-context/context.sh.network 
root@svc-ubuntu14:~# onegate
/usr/lib/ruby/1.9.1/uri/common.rb:176:in `split': bad URI(is not URI?):  (URI::InvalidURIError)
	from /usr/lib/ruby/1.9.1/uri/common.rb:211:in `parse'
	from /usr/lib/ruby/1.9.1/uri/common.rb:747:in `parse'
	from /usr/bin/onegate.rb:370:in `initialize'
	from /usr/bin/onegate.rb:541:in `new'
	from /usr/bin/onegate.rb:541:in `<main>'

The only other odd thing I notice is the path itself:
I get this /var/run/one-context/context.sh.network instead of /var/run/one-context/one_env like on the other OS. Is it normal?

(Florian Heigl) #2

just found that “no networking” also happens if i take a debian8 image with 5.0 version of context, purge that one and install the 5.6 one. wish i knew why :slight_smile:

(Sergio) #3

Hi, there are two main services you will have to keep an eye for:

  • one-context
  • one-context-local

If you restart this scripts, context will try to reconfigure itself. Both of this services basically call /usr/sbin/one-contextd with an argument: network or local, depending on the case. The network argument basically launches all the scripts on /etc/one-context.d that start with the prefix net, while local starts the scripts with the loc prefix. In your case, you are interested in loc-10-network script, so you should use one-context-local service.

For debugging, you can manually execute:

bash -x /usr/sbin/one-contextd local

That is the same than calling the service with the advantage of debug information. Before executing that command, manually delete the folder /var/run/one-context. If the script detects it it will assume that it was already executed and it won’t launch (you can see that on the debug output). If it calls correctly loc-10-network script, then the issue could be there. Simply add -x argument at the beginning of loc-10-network (/bin/bash -x), run one-contextd again and you should also be seeing the debug of the network contextualization script.

Hope this helps