- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How do I set up /lib and /bin links correctly?
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
тАО04-16-2011 09:41 AM
тАО04-16-2011 09:41 AM
I also tried using chown after I set up the link but that does nothing.
I'm not sure if this matters, but it would be educational to know how to control the ownership when setting up a new link.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2011 10:27 AM
тАО04-16-2011 10:27 AM
Re: How do I set up /lib and /bin links correctly?
Of what?
uname -a
> I also tried using chown after I set up the
> link but that does nothing.
As usual, showing actual commands with their
actual output can be more helpful than vague
descriptions or interpretations.
man chown
Look for "-h".
You might also wish to look at the link
targets, to see how much "nothing" you did to
them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2011 10:41 AM
тАО04-16-2011 10:41 AM
SolutionFirst, as noted, the permissions and ownership of symbolic links don't matter. What does is the permission and ownership of the target of the link.
If you like, 'chown -h' will change the ownership of a symlink. An undocumented system call 'lchmod()' will allow you to change the permissions of a link.
All said, however, the '/lib' and '/bin' symbolic links have classically been "transition" links since the time of HP-UX 10.0. There is really no difference (at least now) between these so-called transition links and normal symbolic links. At one time, transition links were supposed to be faster. Transition links have disappeared at 11.31.
All said, if you are running prior to 11.31 you can recreate these links with:
# /opt/upgrade/bin/tlinstall
...otherwise manually do so with 'ln -s'. '/bin' points to '/usr/bin' and '/lib' to '/usr/lib'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2011 10:43 AM
тАО04-16-2011 10:43 AM
Re: How do I set up /lib and /bin links correctly?
I did look at the target of the links and they look unaffected.
It appears to me that the "-h" option to chown is what I needed.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2011 10:54 AM
тАО04-16-2011 10:54 AM
Re: How do I set up /lib and /bin links correctly?
James - I did not realize permissions and ownership did not matter on symbolic links. You said these have disappeared in 11.31, but this is 11.31. My associate who deleted them suggested the /bin link was relevant when using ksh. And, I can vouch for the fact the missing link caused one of my Serviceguard packages to fail, being unable to find a number of executables in "/bin".
So, I must be misunderstanding what you meant. Can you please clarify?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2011 11:07 AM
тАО04-16-2011 11:07 AM
Re: How do I set up /lib and /bin links correctly?
> ou said these have disappeared in 11.31, but this is 11.31. My associate who deleted them suggested the /bin link was relevant when using ksh. And, I can vouch for the fact the missing link caused one of my Serviceguard packages to fail, being unable to find a number of executables in "/bin".
No, I said 'transition links' have disappeared at 11.31. The former '/bin' and '/lib' and other symbolic links that were once setup by 'tlinstall()' are now simply standard symbolic links.
At one time, HP made a big deal about the transition links disappearing. Whether or not this was intended to mean only '/usr/bin' would exist and not '/bin' was never clear to me. Obviously, there is a great deal of software that references '/bin' as the top directory in a pathname. Regardless, the continued presence of many of the former transition links as normal symbolic links *does* assist in portability.
In fact, where I would once have written:
#!/usr/bin/sh
...in my HP-UX scripts, I now tend to write simply:
#!/bin/sh
...since on HP-UX either points to the Posix shell. Using the short form allows me to take the script to Linux where '/bin/sh' usually means '/bin/bash' and so, for the most part, I can often run the script without modification.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2011 12:03 PM
тАО04-16-2011 12:03 PM
Re: How do I set up /lib and /bin links correctly?
Is "/" the HOME directory for root? This is so prevalent as the default for Unix-anything installs that it is embarrassing for enterprise level OS's. "/" is the worst possible directory for root to be in, much less for it to be the default. Change all your systems to use a different directory -- I use /root -- and then move all the root droppings (junk files) to /root. A proper / directory have nothing but mountpoints and links. No application directories, no temp (except /tmp which is a mountpoint) or experimental directories.
rm * or the evil cousin rm -r * have destroyed more Unix systems than crackers and worms, all because root logs in to the most dangerous directory in the system. With root's $HOME set to /root, rm -r * will remove a few files in /root, leaving the system safe.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2011 12:02 AM
тАО04-17-2011 12:02 AM
Re: How do I set up /lib and /bin links correctly?
On 10.00, tlinks were introduced to be temporary. But feedback from customers indicated they should be permanent.
So all tlinks (that still made sense) were converted into symlinks and the heavy weight tlink infrastructure was removed.
>JRF: Whether or not this was intended to mean only /usr/bin would exist and not /bin was never clear to me.
This was perfectly clear, only the targets of symlinks are "real". /bin and /lib were goners. :-)
>Using the short form allows me to take the script to Linux
Right.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-18-2011 07:12 AM
тАО04-18-2011 07:12 AM
Re: How do I set up /lib and /bin links correctly?
Bill - I wish that suggestion had been put forth or better yet, offered during inital HP-UX bootup (aka /sbin/set_parms initial) when I set up so many systems with so little knowledge. Unfortunately, even though I know it could very well be worth the time if I have to restore more systems, I do not have the time to spend fixing the root home directory. I think I learned this tidbit of wisdom from you when I went to a class you conducted prior to the Tech Forum in 2006.
Dennis - thank you for your input too!