grass icon indicating copy to clipboard operation
grass copied to clipboard

[Feat] Remove run as administrator from startup message in CLI

Open wenzeslaus opened this issue 5 years ago • 6 comments

The message after starting GRASS GIS in CLI contains the following on Linux with Bash:

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

This is caused by a file .sudo_as_admin_successful missing from the "fake" home directory GRASS GIS uses to start the shell in lib/init/grass.py.

One solution would be to reduce the tricks done in grass.py which would than pick up the ~/.sudo_as_admin_successful file. Another much simple is to create this file in the "fake" home.

The "fake" home is the mapset, so maybe probably creating and deleting it later is desired or perhaps some "try create" is the best.

The simpler solution with just creating the file makes this actually a good first issue. No reworking of "fake" home tricks in grass.py is needed to resolve this issue.

wenzeslaus avatar Jul 01 '20 03:07 wenzeslaus

The message after starting GRASS GIS in CLI contains the following on Linux with Bash:

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

I would question this message entirely - no idea what it is for... and it is only valid on selected operating systems.

IMHO it could be just removed.

neteler avatar Jul 01 '20 07:07 neteler

The message after starting GRASS GIS in CLI contains the following on Linux with Bash:

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

I don't even see this. AFAIU, this is Ubuntu specific. I don't really think that GRASS should be responsible for dealing with it.

mlennert avatar Jul 01 '20 09:07 mlennert

I don't see it neither, but I can understand it's annoying. Considering the startup "tricks" overrides what the user would expect to be there – even now it copies from .alias and *bashrc to the new home in $LOCATION – why not consider the eventual existence of this file as well. A solution might be to just copy the file, iff it exists (which it only will do in ubuntu?).

nilason avatar Jul 01 '20 10:07 nilason

Note: there is a ticket that perhaps will lead to changes regarding this file in the future.

nilason avatar Jul 01 '20 10:07 nilason

I agree with @nilason, we do a lot of customization to the shells already as opposed to just using them "as is", so we are kind of committed here to dealing with different platform or shell specific issues. The "copy if it exists" is quite reasonable and simple enough.

wenzeslaus avatar Sep 12 '20 03:09 wenzeslaus

I'll take this on, since I'm already poking at grass.py :)

susi avatar Aug 19 '22 21:08 susi