Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wenzeslaus opened this issue Jul 1, 2020 · 6 comments · Fixed by #2532
Closed

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

wenzeslaus opened this issue Jul 1, 2020 · 6 comments · Fixed by #2532
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers linux Linux specific
Milestone

Comments

@wenzeslaus
Copy link
Member

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 wenzeslaus added enhancement New feature or request good first issue Good for newcomers linux Linux specific labels Jul 1, 2020
@neteler
Copy link
Member

neteler commented Jul 1, 2020

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.

@mlennert
Copy link
Contributor

mlennert commented Jul 1, 2020

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.

@nilason
Copy link
Contributor

nilason commented Jul 1, 2020

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
Copy link
Contributor

nilason commented Jul 1, 2020

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

@wenzeslaus
Copy link
Member Author

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 wenzeslaus added this to the 8.4.0 milestone Jan 21, 2022
@susi
Copy link
Contributor

susi commented Aug 19, 2022

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

@susi susi self-assigned this Aug 19, 2022
susi added a commit to susi/grass that referenced this issue Aug 20, 2022
susi added a commit to susi/grass that referenced this issue Aug 27, 2022
wenzeslaus pushed a commit that referenced this issue Oct 7, 2022
Create <mapset>/.sudo_as_admin_successful when $HOME/.sudo_as_admin_successful exists to avoid message about sudo for the a Bash instance for each session.

Contains several unrelated Black changes.

Fixes #753.
ninsbl pushed a commit to ninsbl/grass that referenced this issue Oct 26, 2022
Create <mapset>/.sudo_as_admin_successful when $HOME/.sudo_as_admin_successful exists to avoid message about sudo for the a Bash instance for each session.

Contains several unrelated Black changes.

Fixes OSGeo#753.
ninsbl pushed a commit to ninsbl/grass that referenced this issue Feb 17, 2023
Create <mapset>/.sudo_as_admin_successful when $HOME/.sudo_as_admin_successful exists to avoid message about sudo for the a Bash instance for each session.

Contains several unrelated Black changes.

Fixes OSGeo#753.
marisn pushed a commit to marisn/grass that referenced this issue Jun 2, 2023
Create <mapset>/.sudo_as_admin_successful when $HOME/.sudo_as_admin_successful exists to avoid message about sudo for the a Bash instance for each session.

Contains several unrelated Black changes.

Fixes OSGeo#753.
neteler pushed a commit to nilason/grass that referenced this issue Nov 7, 2023
Create <mapset>/.sudo_as_admin_successful when $HOME/.sudo_as_admin_successful exists to avoid message about sudo for the a Bash instance for each session.

Contains several unrelated Black changes.

Fixes OSGeo#753.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers linux Linux specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants