Small question about /etc/rc.local - Symbolic link question
I was playing around with some run-once startup scripts and I noticed /etc/rc.local links to rc.d/rc.local:
lrwxrwxrwx 1 root root 13 Jun 11 2004 /etc/rc.local -> rc.d/rc.local As you can see this linking works without the full path to the file: /etc/rc.d/rc.local. I did some experimenting and found it will still point to the that file whether you do: ln -s /etc/rc.d/rc.local /etc/rc.local or ln -s rc.d/rc.local /etc/rc.local My question is how does the system know how to point /etc/rc.local to /etc/rc.d/rc.local when it doesn't have the full path to it? Just curious. Thanks! |
did you execute "ln -s rc.d/rc.local /etc/rc.local" from /etc?
rc.d/rc.local means the file rc.local which is in the directory rc.d which is under the current directory. |
Nope, I did the linking from /root. The system still figures out to point rc.d/rc.local to /etc/rc.d/rc.local from /root. Can you try it on your system?
|
Actually I think it has to do with how the links work.
It just creates a link somewhere with a path: It creates the link rc.local in /etc with path to rc.d/rc.local. You don't specify the full path so it just creates a link pointing at the relevant path rc.d/rc.local. Since the link is in /etc the full path for the relevant one IS /etc/rc.d/rc.local. A link just saves a path. Nothing less and nothing more. The path can be relevant or full. The same happens with every link: Code:
root@darkstar:/home/skalkoto# ln -s workspace/hello ~/rc.local |
Ahhh, ic. Thanks for the explanation!
|
All times are GMT -5. The time now is 10:19 PM. |