Operating System - HP-UX
1834150 Members
2195 Online
110064 Solutions
New Discussion

make link /usr/lib to /lib

 
piyut_1
Frequent Advisor

make link /usr/lib to /lib

hp-ux version is B 11.11. I want to make link /usr/lib to /lib.but why the permission change???

#cd /usr
#ls -l|grep lib
drwxr-xr-t 39 bin bin 16384 Feb 26 02:45 lib
#cd /
#ln -s /usr/lib /lib
#ls -l|grep lib
lrwxrwxrwx 1 root sys 8 Feb 27 00:27 lib -> /usr/lib

permission for /usr/lib is changed.why????
# ls -l|grep usr/lib
lrwxrwxrwx 1 root sys 8 Feb 27 00:27 lib -> /usr/lib

any thoughts???


12 REPLIES 12
Biswajit Tripathy
Honored Contributor

Re: make link /usr/lib to /lib

I'm note sure I understand the question as I don't
see where the permission has changed. Can you
show the permission change by posting the output of
the following:

# ls -ld /usr/lib
and
# ls -ld /lib

- Biswajit
:-)
piyut_1
Frequent Advisor

Re: make link /usr/lib to /lib

sir,
when i make link /usr/lib to /lib with command :
#ln -s /usr/lib /lib
,the permission for /usr/lib changed.
before i make link:
#cd /usr
#ls -l|grep lib
drwxr-xr-t 39 bin bin 16384 Feb 26 02:45 lib

and after i made link:
# ls -l|grep usr/lib
lrwxrwxrwx 1 root sys 8 Feb 27 00:27 lib -> /usr/lib
# ls -l|grep usr/lib
lrwxrwxrwx 1 root sys 8 Feb 27 00:27 lib -> /usr/lib

and after about 5 miniutes, /lib is losed.

Biswajit Tripathy
Honored Contributor

Re: make link /usr/lib to /lib

Can you post the output of
# ls -ld /usr/lib
and
# ls -ld /lib

- Biswajit
:-)
piyut_1
Frequent Advisor

Re: make link /usr/lib to /lib

ls -ld /usr/lib befor I make link:
# ls -ld usr/lib
drwxr-xr-t 39 bin bin 16384 Feb 26 02:45 usr/lib

after make link:
# ls -l|grep usr/lib
lrwxrwxrwx 1 root sys 8 Feb 27 00:27 lib -> /usr/lib
Biswajit Tripathy
Honored Contributor

Re: make link /usr/lib to /lib

Piyut wrote:
> ls -ld /usr/lib befor I make link:
> # ls -ld usr/lib
> drwxr-xr-t 39 bin bin 16384 Feb 26 02:45 usr/lib

Okay. Now that you have already made the link,
check the permission of /usr/lib by running
# ls -ld /usr/lib

Use absolute path (i.e /usr/lib instead of usr/lib)

> after make link:
> # ls -l|grep usr/lib
> lrwxrwxrwx 1 root sys 8 Feb 27 00:27 lib -> /usr/lib

Now lrwxrwxrwx is the permission of /lib. Permission
of /usr/lib would still be drwxr-xr-t. Don't do grep
and don't use relative path. Just simply type

# ls -ld /lib
#ls -ld /usr/lib
and you will see the difference.

- Biswajit

:-)
Henk Geurts
Esteemed Contributor

Re: make link /usr/lib to /lib

hi Piyut
check this thread about ln and umask.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=541998
it wil provide your answer.
regards.
piyut_1
Frequent Advisor

Re: make link /usr/lib to /lib

sir, u can see this:

# ls -ld /usr/lib
drwxr-xr-x 39 bin bin 16384 Feb 26 02:45 /usr/lib
# pwd
/
# ln -s /usr/lib /lib
# ls -ld /usr/lib
drwxr-xr-x 39 bin bin 16384 Feb 26 02:45 /usr/lib
# ls -ld /lib
lrwxrwxrwx 1 root sys 8 Feb 27 02:55 /lib -> /usr/lib

when I want to change permission /lib with chmod, there is no changes.
Biswajit Tripathy
Honored Contributor

Re: make link /usr/lib to /lib

piyut wrote:
> when I want to change permission /lib with
> chmod, there is no changes.

Yes. And explanation for that is in Henk's post (see
the link he provided).

Your original post said that the permission of
/usr/lib got automatically changed after you created
the sym link. I was merely trying to point out that it
did not. The permission of /usr/lib remained same
after the sym link was created . Permission of /lib
was determined by the umask which was different
from permission of /usr/lib.

- Biswajit
:-)
Geoff Wild
Honored Contributor

Re: make link /usr/lib to /lib

symbolic links inherit permissions from the original file/directory.

Don't worry about the permissions on the link - effective permissions are on the "real" - IE /usr/lib

From man ln

Symbolic links are created with the ownership of the creator and the
permissions are of the creator's current umask. Once created, the
symbolic link ownership and permissions will not change, since the
mode and ownership of the symbolic link is ignored by the system.


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
piyut_1
Frequent Advisor

Re: make link /usr/lib to /lib

thanks all,

i just make link like this:
#cd /
#ln -s /usr/lib /lib
#ls -ld /usr/lib
drwxr-xr-x 39 bin bin 16384 Feb 27 03:23 /usr/lib
# ls -ld /lib
lrwxr-xr-x 1 root sys 8 Feb 27 03:25 /lib -> /usr/lib

permission for /lib is lrwxr-xr-x, i want to change to lrwxr-xr-t.like permission for /bin that link to /usr/bin

how??
piyut_1
Frequent Advisor

Re: make link /usr/lib to /lib

now,

/lib is losed.why ???
dirk dierickx
Honored Contributor

Re: make link /usr/lib to /lib

you shouldn't be linking /usr/lib to /lib unless you know _exactly_ what you are doing, and judging by the question you asked (re. link permissions) you don't.