Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 5th October 2004, 04:21 PM
OoerictoO Offline
Registered User
 
Join Date: Sep 2004
Posts: 17
Question after su to root: can't find common libs, path is messed up, etc.

fedora core 2

after SUing to root (or from root to any other user for that matter), the PATH and LIBPATH are all messed up (retain that of previous username).
there are some other strange side effects.

i RARELY log in as root, and if i do i demote to runlevel 3 first and turn off my network interface if i can.
so i usually just try to su to root. this works for most things, including yum update
but i always have to type /sbin/reboot, etc (since /sbin isn't in my path). I've tried adding /sbin to my path in root's .profile, but that should been in the default profile to begin with (basically the new user's profile isn't being read, plus some other strange stuff is going on)

this affects things like rebuilding the kernel.
since i don't like logging into X as root i can't do make gconfig to rebuild the kernel.
if i su to root i get:
*
* Unable to find the GTK+ installation. Please make sure that
* the GTK+ 2.0 development package is correctly installed...
* You need gtk+-2.0, glib-2.0 and libglade-2.0.
*
make[1]: *** [scripts/kconfig/.tmp_gtkcheck] Error 1
make: *** [gconfig] Error 2

prolly because the libpath and path are messed up.

[root@notaix linux]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/erict/bin
other interesting vars (when SU'd to root):
HOME=/root
LOGNAME=erict <-!!!!!!!!!
USER=erict <-!!!!!!!!!

when i su to a user (from root), i get things like no permission to write to user's home. WTH?

any ideas on how to make this work properly?
this is a very new install and i haven't used a redhat distro in 5+ years.

TIA
Reply With Quote
  #2  
Old 5th October 2004, 04:40 PM
ilja Offline
Registered User
 
Join Date: Apr 2004
Location: Euregio
Posts: 3,613
use
Code:
su -
__________________
--
http://twitter.com/ik12
Reply With Quote
  #3  
Old 5th October 2004, 05:08 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
OoerectO,
I agree with ilja's suggestion. If you always have the PATH of the previous user then you would always have the same path, not matter how you did su, yes? It would always be the path of the original login. Check that the .bashrc and .bash_profile files are present in each user's home directory, including root's.

If you are continuously on a network, it never hurts to check for a virus. If possible, check the md5sums and file sizes of the common shell commands like /bin/bash and /bin/ls between your machine and another FC2 machine at the same update level.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #4  
Old 5th October 2004, 05:16 PM
hiberphoptik's Avatar
hiberphoptik Offline
Registered User
 
Join Date: Apr 2004
Posts: 1,186
i beleive its set up this way intentionally and has been for some time even on FC1 this was the case.

small annoyance? yes

saves you from yourself? yes
Reply With Quote
  #5  
Old 5th October 2004, 05:35 PM
ilja Offline
Registered User
 
Join Date: Apr 2004
Location: Euregio
Posts: 3,613
It is the way, that su acts. You will see it in every Unix.
refer to man su
Quote:
-l Simulate a full login. The environment is discarded except for
HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified
as above. USER is set to the target login. PATH is set to
``/bin:/usr/bin''. TERM is imported from your current environ-
ment. The invoked shell is the target login's, and su will
change directory to the target login's home directory. This
option is identical to just passing "-", as in "su -".
__________________
--
http://twitter.com/ik12
Reply With Quote
  #6  
Old 5th October 2004, 05:57 PM
OoerictoO Offline
Registered User
 
Join Date: Sep 2004
Posts: 17
Quote:
Originally Posted by ilja
It is the way, that su acts. You will see it in every Unix.
refer to man su

interesting, but i've never seen it before. certainly does not do it on gentoo, and i never saw it do it on debian nor slackware (but i haven't used them in years).

i hate it when distros try to save me from myself. it's nice, since users (including myself) are total morons, but it just limits what i'm doing (as in: all but eliminates the function of su) and as soon as i figure it out i do things like:

alias su="su -"

done and done and i'll never look back (and yeah, i'll prolly delete libc or something a few times, but that's what backups are for!).

thanks for the info.
Reply With Quote
  #7  
Old 5th October 2004, 05:59 PM
ilja Offline
Registered User
 
Join Date: Apr 2004
Location: Euregio
Posts: 3,613
with that alias you can't su to a user != root
su ilja is impossible now. (I think so)
I would use -l instead of just -.
And this is not to safe you from yourself, but it is just the way su is working.
__________________
--
http://twitter.com/ik12
Reply With Quote
Reply

Tags
common, libs, messed, path, root

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Configure script can't find X libs jeffk42 Using Fedora 3 5th October 2006 10:01 PM
Can't find madwifi-kmod-common NetArch Servers & Networking 4 13th June 2006 08:30 AM
how to use 1 common directory path for Apache & VSFTPD xyleo Using Fedora 5 1st June 2006 03:50 PM
Where do I find ndiswrapper-kmod-common reader Servers & Networking 4 9th May 2006 09:37 PM


Current GMT-time: 08:21 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat