Thanks! It's working flawless with -E flag. =)

On Saturday, December 10, 2016 at 8:29:17 PM UTC+1, Dmitri Goutnik wrote:
>
> sudo sanitizes environment, you need to either pass -E option or 
> add GOROOT_BOOTSTRAP to env_keep in /etc/sudoers:
>
> Defaults env_keep += "GOROOT_BOOTSTRAP"
>
> On Sat, Dec 10, 2016 at 1:57 PM, xMudrii <mudrin...@gmail.com 
> <javascript:>> wrote:
>
>> Hi,
>>
>> I have downloaded Go 1.4 binaries and moved it to `/usr/local/go1.4` for 
>> example.
>> Also I defined GOROOT_BOOTSTRAP variable in my users `.profile` file:
>> `export GOROOT_BOOTSTRAP=/usr/local/go1.4`
>>
>> I sourced file and if I run echo $GOROOT_BOOTSTRAP, it'll work correctly.
>>
>> When I run `bash all.bash` it'll detect variable correctly:
>> ##### Building Go bootstrap tool.
>> cmd/dist
>>
>>
>> ##### Building Go toolchain using /usr/local/go1.4.
>>
>>
>> Now example will not work, because if my user doesn't have write 
>> privileges in folder with
>> go1.4, it'll error. That's normal, so in cases like that I run script 
>> with root privileges:
>> `sudo bash all.bash`
>>
>> But it doesn't detect variable:
>> ##### Building Go bootstrap tool.
>> cmd/dist
>>
>>
>> ERROR: Cannot find /home/vtest/go1.4/bin/go.
>> Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.
>>
>>
>> It is trying to find default location instead one set in profile.
>>
>> I added it to roots `~/.profile` but no avail. Also tried `~/.bashrc` on 
>> both users
>> and it doesn't work. (I used source on files).
>>
>> Some details for reference:
>> lsb_release -a:
>> No LSB modules are available.
>> Distributor ID: Ubuntu
>> Description: Ubuntu 16.04.1 LTS
>> Release: 16.04
>> Codename: xenial
>> uname -a:
>> Linux vtest 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 
>> x86_64 x86_64 x86_64 GNU/Linux
>>
>>
>> Is it possible to run `all.bash` with sudo or it's not recommended?
>> Sometimes when I place sources in `/usr/local` (because of GOROOT for 
>> example), I need to run `all.bash` with sudo.
>> Same applies if I only place Go 1.4 there.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to