LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-12-2006, 08:35 PM   #1
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 123

Rep: Reputation: 17
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!
 
Old 05-12-2006, 08:40 PM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
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.
 
Old 05-12-2006, 08:44 PM   #3
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 123

Original Poster
Rep: Reputation: 17
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?

Last edited by Arodef; 05-12-2006 at 08:47 PM.
 
Old 05-12-2006, 09:06 PM   #4
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
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
root@darkstar:/home/skalkoto# cd ~
root@darkstar:~# ls -l rc.local
lrwxrwxrwx 1 root root 15 2006-05-13 05:10 rc.local -> workspace/hello/
root@darkstar:~#
 
Old 05-13-2006, 02:29 AM   #5
Arodef
Member
 
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 123

Original Poster
Rep: Reputation: 17
Ahhh, ic. Thanks for the explanation!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
symbolic link between mozilla plugins and /usr/local/java TSynergy Linux - Newbie 3 04-15-2006 03:17 PM
question about symbolic links supersucker Linux - Newbie 3 01-06-2006 08:27 AM
symbolic link question vpv Linux - Newbie 6 10-25-2005 04:02 AM
java symbolic link question MRDucks Mandriva 4 09-26-2005 09:57 PM
symbolic link question nalkinburgh Linux - General 2 12-20-2002 12:56 PM


All times are GMT -5. The time now is 07:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration