FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 10-25-2011, 07:05 PM
gautamc
 
Default "reloading" /etc/login.defs ENV_PATH without restarting

Hi,

1. I need a certain directory on my debian squeeze machine ( /var/lib/
gems/1.8/bin/ ) to be in the PATH when i run a sudo command. Hence, I
appended this dir to the ENV_PATH item in /etc/login.defs

2. Is there is a way to get /etc/login.defs "re-evaluated" without
rebooting. I put an export PATH in ~/.profile and have the path set
for the non-root user. However, a sudo command doesn't see the new dir
in $PATH.

thnx - Gautam
( May the source stay with GNU)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 643cbfe4-fa80-4abb-b2f4-92779978cf47@j36g2000prh.googlegroups.com">http://lists.debian.org/643cbfe4-fa80-4abb-b2f4-92779978cf47@j36g2000prh.googlegroups.com
 
Old 10-25-2011, 09:22 PM
gautam chekuri
 
Default "reloading" /etc/login.defs ENV_PATH without restarting

Hi,

1. I need a certain directory on my debian squeeze machine ( /var/lib/
gems/1.8/bin/ ) to be in the PATH when i run a sudo command. Hence, I
appended this dir to the ENV_PATH item in /etc/login.defs

2. Is there is a way to get /etc/login.defs "re-evaluated" without
rebooting. *I put an export PATH in ~/.profile and have the path set
for the non-root user. However, a sudo command doesn't see the new dir
in $PATH.

thnx - Gautam
( May the source stay with GNU)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CA+3hb7j07eBXXPENdEj4qXUT5JCBtfpBMcy=K+WR4zsLeVBaK w@mail.gmail.com">http://lists.debian.org/CA+3hb7j07eBXXPENdEj4qXUT5JCBtfpBMcy=K+WR4zsLeVBaK w@mail.gmail.com
 
Old 10-25-2011, 10:35 PM
Bob Proulx
 
Default "reloading" /etc/login.defs ENV_PATH without restarting

gautamc wrote:
> 1. I need a certain directory on my debian squeeze machine ( /var/lib/
> gems/1.8/bin/ ) to be in the PATH when i run a sudo command. Hence, I
> appended this dir to the ENV_PATH item in /etc/login.defs

Two comments:

First comment: If you need that for sudo then instead of changing
login.defs I think you should set the change in /etc/sudoers and add
that path to the secure_path variable. Here is the default:

Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Add your path to that path and place it in the sudoers file and then
it will always be activated for each use of sudo.

Second comment: You might want to subscribe to debian-ruby and discuss
your ruby environment there. It is really a tragedy that the upstream
Ruby community has taught everyone that you must use root to smash
installations over the top of systems. It is a shame that Ruby
couldn't have learned from the trail blazed by Perl. That is a very
long discussion however.

> 2. Is there is a way to get /etc/login.defs "re-evaluated" without
> rebooting. I put an export PATH in ~/.profile and have the path set
> for the non-root user. However, a sudo command doesn't see the new dir
> in $PATH.

The /etc/login.defs and ~/.profile and /etc/profile all are sourced
when the user logs into the account. Therefore in order to source
those again you either need to manually source the files (with "source
~/.profile or ". ~/.profile")), OR exec a new login shell on top of
the current shell (with "exec bash -l"), OR log out and log back in
again. You do NOT need to reboot.

However none of those options are very appealing to me. On a
Unix-like system such as Debian you should always be able to install
something and have it be immediately available. It is a tragedy when
that paradigm is broken by misguided processes such as one my peeves
/etc/profile.d/ and others. Setting up sudo's secure_path takes
immediate affect and does not require any manual sourcing or logging
out and back in.

Bob
 

Thread Tools




All times are GMT. The time now is 08:12 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org