earthenterprise icon indicating copy to clipboard operation
earthenterprise copied to clipboard

Set PATH in fusion/server installer without opening a new shell

Open tst-lsavoie opened this issue 7 years ago • 7 comments

It would be helpful if the fusion installer updated the PATH environment variable to include /opt/google/bin. This will allow users to run fusion instead of /opt/google/bin/fusion.

tst-lsavoie avatar Apr 28 '17 18:04 tst-lsavoie

This should be optional, since it risks changing the expected version of some key system tools - GDAL/OGR, postgresql, LDAP and OpenSSL.

bradh avatar Apr 29 '17 02:04 bradh

I think it may be more portable to add symlinks to the predefined system-wide executables directories on POSIX and UNIX systems, rather than trying to modify the PATH variables. Modifying the PATH is more or less standard on Windows.

If we want to support multiple versions of software installed along-side each other on the same machine, we may want to support the Debian and Red Hat alternatives mechanisms.

tst-ppenev avatar Apr 30 '17 18:04 tst-ppenev

I like the idea of adding symbolic links to fusion and some other selected tools in /opt/google/bin to the /usr/bin directory. We'll need to do more with alternatives in Debian and Red Hat when the follow-up package tasks are done, so I don't think we'll have to worry about that right now. But, this would allow the user to configure their PATH variable as they wish. But, perhaps we should provide some instructions.

tst-ccamp avatar May 02 '17 15:05 tst-ccamp

Lee,

This is in fact done by the GEE installers. PATH is set to '/opt/google/bin' . This is done by adding files 'ge-fusion.csh', 'ge-server.sh', 'ge-fusion.csh', 'ge-fusion.sh' to /etc/profile.d .

Please see below the o/p from such files on my local GEE install.

Hope that helps.,

Thanks., Datta M

sun@tintin:/etc/profile.d$ ls -la total 56 drwxrwxr-x 2 root root 4096 Mar 26 15:11 . drwxr-xr-x 143 root root 12288 Apr 13 14:30 .. -rw-r--r-- 1 root root 40 Apr 15 2014 appmenu-qt5.sh -rw-r--r-- 1 root root 101 Apr 28 2016 apps-bin-path.sh -rw-r--r-- 1 root root 663 Apr 7 2014 bash_completion.sh -rw-r--r-- 1 root root 1003 Dec 29 2015 cedilla-portuguese.sh -rwxrwxr-x 1 root root 259 Nov 16 14:11 ge-fusion.csh -rwxrwxr-x 1 root root 255 Nov 16 14:11 ge-fusion.sh -rwxrwxr-x 1 root root 126 Nov 16 14:11 ge-server.csh -rwxrwxr-x 1 root root 125 Nov 16 14:11 ge-server.sh -rw-r--r-- 1 root root 1941 Mar 16 2016 vte-2.91.sh -rw-r--r-- 1 root root 1947 Nov 22 2013 vte.sh

sun@tintin:/etc/profile.d$ cat ge-fusion.csh

Copyright 2008 Google Inc. All Rights Reserved.

Keyhole initialization script (csh)

don't re-add /opt/google/bin to the path if Keyhole Server is installed

if ( ! -f "/etc/profile.d/ge-server.csh" ) then setenv PATH "${PATH}:/opt/google/bin" endif sun@tintin:/etc/profile.d$ cat ge-fusion.sh

Copyright 2008 Google Inc. All Rights Reserved.

Keyhole initialization script (sh)

don't re-add /opt/google/bin to the path if Keyhole Server is installed

if [ ! -f "/etc/profile.d/ge-server.sh" ]; then export PATH="${PATH}:/opt/google/bin" fi sun@tintin:/etc/profile.d$ cat ge-fusion.csh

Copyright 2008 Google Inc. All Rights Reserved.

Keyhole initialization script (csh)

don't re-add /opt/google/bin to the path if Keyhole Server is installed

if ( ! -f "/etc/profile.d/ge-server.csh" ) then setenv PATH "${PATH}:/opt/google/bin" endif sun@tintin:/etc/profile.d$ cat ge-fusion.sh

Copyright 2008 Google Inc. All Rights Reserved.

Keyhole initialization script (sh)

don't re-add /opt/google/bin to the path if Keyhole Server is installed

if [ ! -f "/etc/profile.d/ge-server.sh" ]; then export PATH="${PATH}:/opt/google/bin" fi sun@tintin:/etc/profile.d$

=====================

On Tue, May 2, 2017 at 8:11 AM, Chris Camp [email protected] wrote:

I like the idea of adding symbolic links to fusion and some other selected tools in /opt/google/bin to the /usr/bin directory. We'll need to do more with alternatives in Debian and Red Hat when the follow-up package tasks are done, so I don't think we'll have to worry about that right now. But, this would allow the user to configure their PATH variable as they wish. But, perhaps we should provide some instructions.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/earthenterprise/issues/110#issuecomment-298664842, or mute the thread https://github.com/notifications/unsubscribe-auth/AYC3U5n0rwN059knQxlN1SazCs_LuOKZks5r10eVgaJpZM4NL1uO .

dattapm avatar May 03 '17 00:05 dattapm

My experience with Ubuntu 14.04 is that the path is added if you ssh in, but not if you're logged in locally.

bradh avatar May 03 '17 03:05 bradh

Thanks for the help @dattapm. The confusion here is that you have to reboot (or do something similar) for the path to be set. So if you install fusion and then try to run it right away, you have to use the full path. If you reboot, you don't.

It still might be worth doing something to ensure that fusion is in the path right after installing, but it's not as big of an issue.

tst-lsavoie avatar May 03 '17 16:05 tst-lsavoie

In that case, if it's just temporary, then I don't see any harm in adding the /opt/google/bin directory at the end of the PATH environment variable in the current terminal and maybe a warning that you'll need to reboot (I think logging out and back in would also work) before the path is updated permanently. I just didn't think we should be trying to edit someone's .bashrc file.

tst-ccamp avatar May 03 '17 17:05 tst-ccamp