Merlijn,
Now that I see more of what you are doing I have an alternate suggestion.
When you are running 'juju init' use the su command to run as the "ubuntu"
user.
su - ubuntu -c 'juju init'
Using the su command in this way gives a "login" environment for the user
"ubuntu". I wrote a charm
Hi
I'm developing a Charm that installs the Juju client, among other things.
I'm having some trouble getting this to work. When I use juju debug-hooks
and manually run the install hook, everything works fine. However, when the
hook is executed by Juju automatically, I get strange errors such as
Hell again Merlijn,
It was nice to see you at the Charmer summit! This is a very interesting
use of Juju.
What you are seeing is what we call a "hook context". Hooks execute with
root authority and have certain environment variables are set. This is so
Juju commands and tools work correctly.