- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to source in .profile automatically upon l...
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
Discussions
Discussions
Forums
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
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
тАО11-08-2016 10:54 AM
тАО11-08-2016 10:54 AM
How to source in .profile automatically upon login?
HP-UX 11.31
A user uses /usr/bin/sh and when the user logs in, the $HOME/.profile should be sourced in automatically instead of manually, such as . ./.profile
How to automate this process?
I know bash does with .bash_profile but it's not an option at this point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-08-2016 01:23 PM
тАО11-08-2016 01:23 PM
Re: How to source in .profile automatically upon login?
If you are using the POSIX shell, /usr/bin/sh, the the ~/.profile file should be sourced automatically when you login.
What are the permissions on the file? If the user logging in does not have read, and possibly execute, permission on the file then it won't work. The user logging in should also own the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-08-2016 04:21 PM
тАО11-08-2016 04:21 PM
Re: How to source in .profile automatically upon login?
Is .profile an ordinary file in the user's $HOME directory (not symlink, not a file from an NFS source)?
Do you see items from /etc profile? Any error messages after /etc/profile has run? You can place an echo line at the start of .profile to see if it is actually being run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2016 03:47 AM
тАО11-09-2016 03:47 AM
Re: How to source in .profile automatically upon login?
.profile is set to octal 740 and the ownership is set to user:users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2016 04:53 PM
тАО11-09-2016 04:53 PM
Re: How to source in .profile automatically upon login?
What happens when the user logs in after adding a "set -x" line at the beginning of the ".profile" file ?
--
ranga
[i work for hpe]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2016 05:19 AM
тАО11-10-2016 05:19 AM
Re: How to source in .profile automatically upon login?
I put the line I wanted to be run in /etc/profile and it sourced when a user logged in. I don't know why each individual's user .profile does not get sourced at all, I've always had to do it manually, like this.
There are no solutions in this thread other than editing global /etc/profile.
. ./.profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2016 09:06 AM - edited тАО11-10-2016 09:08 AM
тАО11-10-2016 09:06 AM - edited тАО11-10-2016 09:08 AM
Re: How to source in .profile automatically upon login?
...There are no solutions in this thread...
It is really difficult to help when there are no answers to the questions or suggestions already given.
Can you answer these questions?
Is .profile an ordinary file in the user's $HOME directory (not symlink, not a file from an NFS source)?
(hint: ls -l $HOME/.profile)
Any error messages after /etc/profile has run?
Place an echo line at the start of .profile to see if it is actually being run.
(hint: echo "just started .profile")
Or even better, debug .profile as suggested above by inserting set -x at the top of .profile
One other thought: Is there something strange at the end of /etc/profile like starting another shell?
It would help to see the results from the questions above.
What you are describing is not normal so resolving the problem will not be a simple solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2016 03:09 PM
тАО11-10-2016 03:09 PM
Re: How to source in .profile automatically upon login?
> I don't know why each individual's user .profile does not get sourced
> at all, I've always had to do it manually, like this.
I have never seen it fail.
> There are no solutions in this thread other than editing global
> /etc/profile.
Perhaps that is because, never having seen it themselves, no one can
guess how you managed to obtain this behavior.
> .profile is set to octal 740 and the ownership is set to user:users
And responses like this don't help. As usual, showing actual
commands with their actual output can be more helpful than vague
descriptions or interpretations.
Around here, for example:
rux$ uname -a
HP-UX rux B.11.31 U ia64 1678555272 unlimited-user license
rux$ who am i
sms pts/ta Nov 9 13:22
rux$ grep sms /etc/passwd
sms:x:50:20:Steven M. Schweda:/usr/users/sms:/usr/bin/sh
rux$ echo $HOME
/usr/users/sms
rux$ ls -ld $HOME
drwxr-xr-x 2 sms sys 8192 Nov 9 13:22 /usr/users/sms
rux$ pwd
/usr/users/sms
rux$ ls -lA .profile
-rw-r--r-- 1 sms users 2391 Nov 9 13:22 .profile
In this case, I own my home directory and my ".profile", I can read
both of them, and I'm the only one with write permission on both of
them. Some of those things may be significant.
And, from a convenient Mac:
pro3$ rsh rux
Password:
Last successful login: Thu Nov 10 16:42:35 CST 2016
pro3.antinode.info
Please wait...checking for disk quotas
[.profile]
Value of TERM has been set to "xterm".
rux$
That "[.profile]" line comes from a line near the top of that
".profile" file:
echo '[.profile]'
> What you are describing is not normal so resolving the problem will
> not be a simple solution.
The solution might be simple, but it's not immediately obvious, so
answering questions accurately and precisely will probably be even more
important than usual. You might try that.