2018-07-04 21:00 GMT+03:00 Jack <[email protected]>:
> On 2018.07.04 13:38, gevisz wrote:
>>
>> 2018-07-03 16:22 GMT+03:00 Mart Raudsepp <[email protected]>:
>> > Ühel kenal päeval, T, 03.07.2018 kell 14:00, kirjutas gevisz:
>>>>
>>>> Are you, by any chance, running this command through something like
>>>> lxc-attach or ssh?
>>>>>
>>>>> I had the exact same problem two days ago and it turned out to be
>>>>> something about the environment being passed to the remote system. 
>>>>> Sourcing
>>>>> /etc/profile did the trick.
>>>>
>>>> No, I do it on my desktop staying just in front of me. So, no need for
>>>> ssh (and I do not know what lxc-attach is at all).
>>
>> >>
>> >> Still, sourcing /etc/profile somehow helped:
>> >
>> > How do you obtain root privileges for the command?
>>
>> su
>>
>>> If you use su, you should be using "su -" (or "su -l" or "su --login"),
>>> not "su".
>>
>>
>> I have used only "su" for already 3 years, since switched to Gentoo from
>> Ubuntu and never had any problems with it.
>>
>> Could you explain a little bit more why "su -" should be used instead.
>
> It's not so much needing the root environment, it's that sometimes things in
> your own environment cause problems if not removed when emerge runs.  There
> is another recent thread about emerge (nodejs) failing because of sandbox
> violations due to some XDG variable causing an install script to try writing
> to somewhere it would not have it the environment had been properly
> sanitized.  Note I consider this a general precaution, it may or may not be
> relevant for the subject of this thread.  The problems caused by this issue
> are indeed infrequent and sporadic, so it's not surprising that you have not
> run into any of them.  It seems to be related to the details in some
> ebuilds.

Ok, got it. Thank you for the explanation.

>> From the man page I've got the following:
>>
>> -, -l, --login
>>     Provide an environment similar to what the user would expect had
>> the user logged in directly.
>>
>> But I cannot see why I need the original root environment, especially if I
>> never set it up.
>
> That's partly the point - the root environment is generally much more empty
> than that of your usual user.
>
>> > If you use sudo, you might need to pass -i (--login) option to it.
>>
>> I hate using sudo since I have been forced to use it in Ubuntu.
>
> I almost never used sudo when I used Ubuntu.  I used su or logged in as root
> when necessary.

It is quite strange because, when I used Ubuntu, it had no root account,
and so, everybody was forced to use sudo to get root privileges.

Reply via email to