Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] RHEL - modify system path with script in profile.d - only works for root not users



Hello Edward,
    This is new ground for me. With the help of others I determined that the script was created in Bash while the test user and customer were using the csh shell.. I changed the shell of my test user to bash and it worked correctly...


Do you have experience creating a .csh script??

Can you suggest the .csh version..

This was my effort based in Bash ..

[root@ profile.d]# more addpath.csh
setenv PATH=$PATH:/usr/local/sratoolkit.2.1.7-centos_linux64
export PATH



This is the bash script ..


host profile.d]# vi addpath.sh

 $PATH:/usr/local/sratoolkit.2.1.7-centos_linux64    
export PATH


Thanks!,
Stephen


What is your shell?  If you want csh to behave this way, you have to create
> addpath.csh in there too.
> 






Stephen Goldman 
System Administrator
Department of Biology
Massachusetts Institute of Technology
31 Ames Street, 68-316e
Cambridge, Ma. 02139
617-452-2595- sgoldman at mit.edu
----- Original Message ----- 
From: "Edward Ned Harvey" <blu at nedharvey.com>
To: "'stephen goldman'" <sgoldman at MIT.EDU>; <discuss at blu.org>
Sent: Sunday, November 20, 2011 9:35 AM
Subject: RE: [Discuss] RHEL - modify system path with script in profile.d - only works for root not users


>> From: discuss-bounces+blu=nedharvey.com at blu.org [mailto:discuss-
>> bounces+blu=nedharvey.com at blu.org] On Behalf Of stephen goldman
>> 
>> Hello All,
>>         Request assistance on modifying the system path .. on a REHL box.
>> 
>> The change works for root but not for any of the users???
>> 
>> 
>> Host OS = 2.6.18-274.el5 #1 SMP Fri Jul 8 17:36:59 EDT 2011 x86_64 x86_64
>> x86_64 GNU/Linux
>> 
>> Based on this :
>> 
>> /etc/profile - and link below creating a script in /etc/profile.d
>> 
>> 
>> http://serverfault.com/questions/102932/adding-a-directory-to-path-in-
>> centosIt's
>> 
>> 
>> 
>> 
>> Created script in /etc/profile.d - addusers:   to add the path..
>> 
>> host profile.d]# vi addpath.sh
>> export PATH=$PATH:/usr/local/sratoolkit.2.1.7-centos_linux64
>> 
>> 
>> 
>> Permissions of script.
>> 
>> drwxr-xr-x   2 root root      4096 Nov 19 11:45 .
>> drwxr-xr-x 100 root root     12288 Nov 18 17:49 ..
>> -rwxr-xr-x   1 root saeijlab    61 Nov 19 11:45 addpath.sh
>> 
>> This works for root but not for other users .. Why
>> 
>> Open to ideas
>> 
>> I am testing as a standard user and it does not work.
> 
> What is your shell?  If you want csh to behave this way, you have to create
> addpath.csh in there too.
> 
> Why don't you stick a couple of echo statements into that script too.  So
> you can see if the script is ever getting called.
> 
> Check to see if selinux is running by running sestatus.  If it is enabled,
> temporarily disable it with setenforce 0 temporarily, see if it works, and
> then setenforce 1
> 
> I wonder if you have something else in your login scripts, such as ~/.bashrc
> which clobbers this setting later.
> 
> How are you testing it?  You know, the scripts that get processed are
> different based on whether it's a login shell (that gets launched when you
> ssh into the machine) or just another spawned shell (like if you just type
> "bash" on the command prompt or something).  So make sure you're testing it
> the same way each time.
> 
> 
>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org