In Diego (maybe DEA also) why is $HOME /home/vcap/app and not /home/vcap?


Mike Youngstrom <youngm@...>
 

Thanks for doing that research Eric. So, it appears to be some requirement
for Heroku compatibility. So, I guess I have 2 issues I'd like to dig
further on that might help other from repeating the issue I experienced
above:

1. Should ssh home be /home/vcap/app also to match application running
environment?
2. Why is Java's "user.home" system property "/home/vcap". I would think
that java's user.home should always match the HOME environment variable.

Mike

On Mon, May 9, 2016 at 2:38 PM, Eric Malm <emalm(a)pivotal.io> wrote:

Hey, Mike,

HOME is also `/home/vcap/app` on the DEAs, and Diego has replicated that
execution contract for buildpack apps (the buildpack-app-lifecycle's
launcher sets HOME to that value before exec'ing the start command).
Spelunking through the DEA codebase, it seems to have been that way since
buildpack support was introduced:
https://github.com/cloudfoundry/dea_ng/commit/43ea42bcbff09175cafa65c2e84bd36fd505be07
is the earliest reference I could find to it. Since /home/vcap/app is also
symlinked to /app, this may be to keep compatibility with Heroku
conventions around the HOME env var. Someone who was around in March 2013
(or who knows Heroku better! :) ) might be able to answer that more
definitively, though.

Best,
Eric

On Thu, May 5, 2016 at 10:00 AM, Mike Youngstrom <youngm(a)gmail.com> wrote:

This burned me today because I was attempting to put fonts into the home
directory identified by the java system property "user.home" (which is
/home/vcap) instead of the environment variable $HOME which is
/var/vcap/app.

This is especially confusing because SSH home is "/home/vcap".

Anyone have any context into why $HOME for the app is /var/vcap/app and
not /var/vcap?

Thanks,
Mike


Eric Malm <emalm@...>
 

Hey, Mike,

HOME is also `/home/vcap/app` on the DEAs, and Diego has replicated that
execution contract for buildpack apps (the buildpack-app-lifecycle's
launcher sets HOME to that value before exec'ing the start command).
Spelunking through the DEA codebase, it seems to have been that way since
buildpack support was introduced:
https://github.com/cloudfoundry/dea_ng/commit/43ea42bcbff09175cafa65c2e84bd36fd505be07
is the earliest reference I could find to it. Since /home/vcap/app is also
symlinked to /app, this may be to keep compatibility with Heroku
conventions around the HOME env var. Someone who was around in March 2013
(or who knows Heroku better! :) ) might be able to answer that more
definitively, though.

Best,
Eric

On Thu, May 5, 2016 at 10:00 AM, Mike Youngstrom <youngm(a)gmail.com> wrote:

This burned me today because I was attempting to put fonts into the home
directory identified by the java system property "user.home" (which is
/home/vcap) instead of the environment variable $HOME which is
/var/vcap/app.

This is especially confusing because SSH home is "/home/vcap".

Anyone have any context into why $HOME for the app is /var/vcap/app and
not /var/vcap?

Thanks,
Mike


Mike Youngstrom <youngm@...>
 

This burned me today because I was attempting to put fonts into the home
directory identified by the java system property "user.home" (which is
/home/vcap) instead of the environment variable $HOME which is
/var/vcap/app.

This is especially confusing because SSH home is "/home/vcap".

Anyone have any context into why $HOME for the app is /var/vcap/app and not
/var/vcap?

Thanks,
Mike