grass
grass copied to clipboard
[Feat] Remove run as administrator from startup message in CLI
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.
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.
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.
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?).
Note: there is a ticket that perhaps will lead to changes regarding this file in the future.
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.
I'll take this on, since I'm already poking at grass.py :)