java not working in chrooted environment

Maarten Ectors maarten.ectors at canonical.com
Fri Oct 11 10:59:17 UTC 2013


Hi Saurabh,

Are you able to access the server manually, e.g. "ssh -i yourkey user at ip"?

thanks,
Maarten

Thanks,
Maarten Ectors
Senior Cloud Strategist
Changing the Future of Cloud
Ubuntu <http://ubuntu.com> / Canonical <http://canonical.com> UK LTD
maarten.ectors at canonical.com
Fixed: +44 (0) 207 630 2435
Mobile: +44 (0) 791 860 8145


On Fri, Oct 11, 2013 at 1:36 AM, David Cheney <david.cheney at canonical.com>wrote:

> Hi Saurabh,
>
> I think you may be hitting a number of issues simultaneously.
>
> 1. precise and the local provider is not expected to work unless you
> running the raring 3.8 HWE kernel, even then I'm not super confident
> on that combination.
> 2. if juju ssh fails, there might be a problem with the key that you
> are using, i can't really be more descriptive than that, but juju will
> sniff out your id_{rsa,dsa}.pub and pass that into the machine via
> cloud init as the key for the ubuntu user. machines do not allow
> password authentication, you must use a key.
> 3. The original issue with java, if the hook is failing, can you
> please post the source of the hook or charm.
>
> Cheers
>
> Dave
>
> On Thu, Oct 10, 2013 at 7:37 PM, Saurabh <saurabh.kumar at techblue.co.uk>
> wrote:
> > Hi Andrew,
> > Thanks for your time, but juju ssh <unit> does not run in my setup. It
> gives
> > the following error.
> >
> > "Warning: Permanently added '10.0.3.236' (ECDSA) to the list of known
> hosts.
> > Permission denied (publickey).
> > error: exit status 255"
> >
> > And yes I know that the machines that gets created by juju are lxc
> > containers, and my concern is when they have proc already mounted then
> why
> > does the install hook fails to load java?
> >
> >
> > Thanks
> > Saurabh.
> >
> >
> > On 10/10/13 08:39, Andrew Wilkins wrote:
> >
> > On Wed, Oct 9, 2013 at 11:04 PM, Saurabh <saurabh.kumar at techblue.co.uk>
> > wrote:
> >>
> >> Hi everybody,
> >
> >
> > Hi Saurabh,
> >
> >>
> >> I have Installed juju on my ubuntu 12.04 machine in a local environment.
> >> I am writing a charm for an application development server, but It could
> >> not get java.
> >> I have written the install hook to install open_jdk via apt.
> >> Java gets installed, when I manually chroot to the location of this
> >> machine (chroot /var/lib/lxc/saurabh-local-machine-1/rootfs) and do a
> "which
> >> java" command It says "/usr/bin/java". But when I do "java -version" it
> says
> >> "java: error while loading shared libraries: libjli.so: cannot open
> shared
> >> object file: No such file or directory "
> >
> >
> > You probably don't want to chroot into the filesystem. If you want to run
> > java from the context of the charm, then you can run "juju ssh <unit>" to
> > get into the machine where the charm is installed.
> >
> > For example, I just bootstrapped a local environment and deployed
> apache2. I
> > now have the unit "apache2/0" running on machine 1. I can log into that
> > machine by doing "juju ssh apache2/0". In your example, you'll "juju ssh
> > $servicename/0", and then you should be able to execute java.
> >
> >> On googling a bit I found that I will have to mount proc in the chrooted
> >> environment. I tried to mount proc using the install hook by adding a
> line "
> >> mount -t proc none /proc" but it could not mount /proc as in logs it
> says
> >> proc already mounted still the application could not get java.
> >> When I manually mount the proc in the chrooted environment and start the
> >> app server it runs fine and java also starts working.
> >>
> >> So my question is how to mount proc using a hook in the chrooted
> >> environment.
> >> If any body has any idea please help.
> >
> >
> > The charm does not run in a chroot, which is why you get the error. The
> > charm runs in an LXC container, which already has a /proc. Consider it
> as a
> > lightweight VM. You can read a little more about LXC here, if you're
> > interested: http://lxc.sourceforge.net/
> >
> > Hope this helps.
> >
> > Cheers,
> > Andrew
> >
> >>
> >> Here is the log of that server unit.
> >>
> >>
> >>
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:369 committing
> >> "install" hook
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:387 committed
> >> "install" hook
> >> 2013-10-09 14:20:56 DEBUG juju.worker.uniter modes.go:410 ModeContinue
> >> exiting
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter modes.go:408 ModeContinue
> >> starting
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter modes.go:79 continuing after
> >> "install" hook
> >> 2013-10-09 14:20:56 DEBUG juju.worker.uniter modes.go:410 ModeContinue
> >> exiting
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter modes.go:408
> ModeConfigChanged
> >> starting
> >> 2013-10-09 14:20:56 DEBUG juju.worker.uniter.filter filter.go:407
> >> discarded config event
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:354 running
> >> "config-changed" hook
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter context.go:203 skipped
> >> "config-changed" hook (not implemented)
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:362 ran
> >> "config-changed" hook
> >> 2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:369 committing
> >> "config-changed" hook
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:387 committed
> >> "config-changed" hook
> >> 2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410
> >> ModeConfigChanged exiting
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeContinue
> >> starting
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:79 continuing after
> >> "config-changed" hook
> >> 2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410 ModeContinue
> >> exiting
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeStarting
> >> starting
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:354 running
> "start"
> >> hook
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter context.go:234 "HOOK mount:
> >> proc already mounted"
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:362 ran "start"
> hook
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:369 committing
> >> "start" hook
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:387 committed
> >> "start" hook
> >> 2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410 ModeStarting
> >> exiting
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeContinue
> >> starting
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:79 continuing after
> >> "start" hook
> >> 2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410 ModeContinue
> >> exiting
> >> 2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeAbide
> >> starting
> >> 2013-10-09 14:20:57 DEBUG juju.worker.uniter.filter filter.go:382 want
> >> forced upgrade false
> >> 2013-10-09 14:20:57 DEBUG juju.worker.uniter.filter filter.go:486 no new
> >> charm event
> >>
> >>
> >>
> >> Thanks
> >> saurabh.
> >>
> >> --
> >> Juju mailing list
> >> Juju at lists.ubuntu.com
> >> Modify settings or unsubscribe at:
> >> https://lists.ubuntu.com/mailman/listinfo/juju
> >>
> >
> >
> >
> > --
> > Saurabh Kumar
> >
> > (RHCSA,RHCE,RHCVA)
> >
> >
> > System Administrator
> > FOR AND ON BEHALF OF:
> >
> > Technology Blueprint Ltd
> > 23 Clemens Street
> > Royal Leamington Spa
> > Warwickshire CV31 2DW
> >
> > E: saurabh.kumar at techblue.co.uk W: www.technologyblueprint.co.uk
> > www.propco.co.uk
> >
> > The contents of this email are confidential and may be privileged, and
> are
> > intended only for the use of the person or company named herein. Any
> views
> > or opinions presented are solely those of the author and do not
> necessarily
> > represent those of Technology Blueprint Limited. If you are not the
> intended
> > recipient of this email or a person responsible for delivering it to the
> > intended recipient, you are hereby notified that any distribution,
> copying
> > or dissemination of the information herein is strictly prohibited
> >
> >
> > --
> > Juju mailing list
> > Juju at lists.ubuntu.com
> > Modify settings or unsubscribe at:
> > https://lists.ubuntu.com/mailman/listinfo/juju
> >
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20131011/8fd9dd79/attachment-0001.html>


More information about the Juju mailing list