Provide details when seeking assistance


#21

@AlManja Could you advise people to create a ~/.bashrc alias that calls your program with sudo su

I used to do that with the allservers script in its early days to bypass the need for password input.

These days though due to the major upgrade of pacman sometime back, allservers now needs to request the input of the user password.


#22

@handy Yes that works, but probably not that useful for what script is intended when someone register for this forum and writes: “Can’t boot, help me please”

My plan with the script is to be able that new user with problem would be guided with these simple steps:

  • log to tty
  • from AUR install ‘logs
  • run the script and copy/paste everything here

I have an idea. There will be two ‘cli’ versions, logs and logsp (p for “password required”) this second one will not need to be used most of the time but when it will be, it will provide even more info, such as: show all un-commented lines from /etc/mkinitcpio.conf and some other that generally need password to be able to see it. And user will just need to be fore warned, run the script but you will also need to enter password.

But for every day use, if someone just want to quickly check different logs for errors from time to time, there will be version that will not require the password. problem solved :slight_smile:


#23

If you want to ensure the script is run as root then

snippet from pacman-mirrors.py

import os

    if os.getuid() != 0:
        print("{}: {}".format("Error", "Script must run as root"))
        exit(1)


#24

Thank you, will check this out! :slight_smile:


#25

@AlManja You could get your script & the ~/.bashrc alias included in the official releases. Could even have a menu option on the desktop that calls it.

I was using the following to check for root access early in the allservers script:

if [ "$EUID" != 0 ]; then err "Must use 'sudo su' before you run this script." exit 1 fi

Which is all but the same thing that fhdk quoted above.


#26

@handy

Thank you, will check this out. While my script is in python, it probably does not matter if it is properly packaged before uploaded to AUR is my guess? I will look into this, thank you very much!


#27

@AlManja there is another bash script of mine floating around with the terrible name of mhwd-kern it has a little python in it courtesy of Joshua. I don’t think you’ll have any problems mixing them up. It is a rare machine where the owner has removed python (I think).


#28

@handy
Thank you, I will check it out.
All this may be way above my head, I’m just starting with small baby steps, clueless about Linux, bash, just starting with python, but maybe I can figure it out. If not, I will leave it on to-do list for some later time :wink:


#29

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.