Closed mrVanDalo closed 9 years ago
I never intended for the script to run as the root user... When you su -
and invoke modprobed-db your output suggests that it is reading the palo user database which I cannot reproduce on my system. On my system:
% su -
# modprobed-db
Modprobed-db v2.33
129 modules currently loaded per /proc/modules
131 modules are in /root/.config/modprobed.db
...
EDIT: Ah, you are using a pretty old version. Can you try with 2.33
yeah that's true, the version is very, old. (I'm using funtoo, so I will have to update the ebuild my-self, 2.24 is the newest
version), give me a sec
Hmm still that problem ? Looks like there is something wrong with my su
root@iron [~]# modprobed-db
Modprobed-db v2.33
191 modules currently loaded per /proc/modules
199 modules are in /home/palo/.config/modprobed.db
/usr/bin/modprobed-db [option]
list Show all modules currently in the database.
store Store any new module(s) to the database.
storesilent Store any new module(s) to the database more quietly.
debug Diff loaded modules from the database (show what did not get loaded).
recall Modprobe to load all modules in the database. MUST be called from sudo!
See manpage for additional details
Very odd behavior... what shell are you using? Same from a tty (console) or from a xterm (graphical)? Again, on my box, it points to /root/.config/modprobed.db
Same on a tty, when I login as palo
and use su -
. But it is correct if I use login as root
. I'm maybe not the only one with that problem http://community.hpe.com/t5/System-Administration/Wrong-user-logname/td-p/2792340 but it looks I don't have /etc/utmp
or some thing, no idea about this. ----> reading.
Why are you interesting in running the tool as root? If you have your crontab (palo) run the in store mode it should be fine to recall your (palo) database when invoked as sudo modprobed-db r
... at least, that is how I designed it to work.
Ok, /var/run/utmp
is the place where this stuff is saved.
Same problem for using sudo
. I'm interested in what should be the proper behavior of logname.
palo@iron [mydistro-overlay]$ sudo modprobed-db
Modprobed-db v2.33
191 modules currently loaded per /proc/modules
199 modules are in /home/palo/.config/modprobed.db
/usr/bin/modprobed-db [option]
list Show all modules currently in the database.
store Store any new module(s) to the database.
storesilent Store any new module(s) to the database more quietly.
debug Diff loaded modules from the database (show what did not get loaded).
recall Modprobe to load all modules in the database. MUST be called from sudo!
See manpage for additional details
I mean it's not a very big problem for me, I can live by having the db
in my home folder,
but one last question: "why don't u use whoami
instead of logname
in the script to find out $USER
?"
I will find out what's the correct behavior of logname
(according to sudo
).
Here some shell output
palo@iron [mydistro-overlay]$ logname ; whoami ; echo $USER ; echo $LOGNAME
palo
palo
palo
palo
palo@iron [mydistro-overlay]$ su -
Password:
root@iron [~]# logname ; whoami ; echo $USER ; echo $LOGNAME
palo
root
root
root
looks like logname
should be used to find out the original username.
Anyway, you can close the ticket if you want. If you change it to make it run-able as root or not. As I wrote I'm fine with that stuff to be stored in my home folder.
Thanks for the quick response.
Cheers Ingolf
Yeah, I don't want to modify the behavior. Glad you got it working.
I have problems using this script with
su -
You use
logname
to find out the username.I think my personal user is safe but, it makes it harder (have to use a console) for me to look in the database my cronjob is creating (and to load when building a kernel).