- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Second file /etc/profile ???
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 06:58 PM
03-01-2006 06:58 PM
Second file /etc/profile ???
Is it possible to create a second global profile as /etc/profile2
and have users with certain group go thru
this profile2 and skip the /etc/profile.
Please advice.
Thanks in advance.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:10 PM
03-01-2006 07:10 PM
Re: Second file /etc/profile ???
I do not think it is possible. ANyways what is that which require this?
A variable set in the .profile of the user will override the setting of /etc/profile not requiring this.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:10 PM
03-01-2006 07:10 PM
Re: Second file /etc/profile ???
the idea of /etc/profile is that is a global profile.
I would suggest you change the /etc/profile to include an if statement and split the executaion path by user group.
That way you still maintain the global profile idea, but can customise for your user group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:12 PM
03-01-2006 07:12 PM
Re: Second file /etc/profile ???
I dont think it is possible to do that. Anyways, you have /etc/profile and $HOME/.profile files, you can do the modification with user's profile which is safer .
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:20 PM
03-01-2006 07:20 PM
Re: Second file /etc/profile ???
Otherwise he has to configure the .profile in each of that groups user directories.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:23 PM
03-01-2006 07:23 PM
Re: Second file /etc/profile ???
My purpose is to have different groups connect to different profiles but keep the /etc/profile as is. This is production box and i do not want to mess up this /etc/profile.
please give me advice on how to modify /etc/profile.
at the begining of /etc/profile, i will have if .. else statement.
if the condition met then it would execute the new /etc/profile_new and then execute local user profile.
if not it just continue /etc/profile.
Thanks,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:49 PM
03-01-2006 07:49 PM
Re: Second file /etc/profile ???
Here is the if statement u are looking for..
first create a file say /etc/special_group
Let this file be filled with the name of the users for whom the /etc/profile2 needs to be executed. One user per line.
Now in /etc/profile include this if statement,
if [ `grep -q "$LOGNAME" /etc/special_group`]
then
. /etc/profile2
fi
The character in front of grep is "back quote" used for command substitution not "single qoute". This character appears before the "1" key.
Contact ,if the test fails.
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:57 PM
03-01-2006 07:57 PM
Re: Second file /etc/profile ???
NOTE:
inside the If statement in the above response there is a space between the "." and "/etc/profile2",
this is important, because. this will make sure that the profile2 is executed in the parent process environment, instead of spawing the child shell(which would be useless in this case).
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 07:57 PM
03-01-2006 07:57 PM
Re: Second file /etc/profile ???
I do not want to continue execute the /etc/profile after
. /etc/profile2
should i insert a line
break in here
Thanks,
Tom
if [ `grep -q "$LOGNAME" /etc/special_group`]
then
. /etc/profile2
break
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 08:00 PM
03-01-2006 08:00 PM
Re: Second file /etc/profile ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 08:07 PM
03-01-2006 08:07 PM
Re: Second file /etc/profile ???
Include the if statement at the end of the /etc/profile, thereby it can reinitialize the Variables if it was already initialized by /etc/profile.
Note, before making the change make sure, you make a copy of the actual /etc/profile file somewhere safe,
While testing, include the follwoing command in /etc/profile2
echo "excuting /etc/profile2"
Regards,
Senthil Kumar .A