1757284 Members
2835 Online
108860 Solutions
New Discussion юеВ

link file

 
SOLVED
Go to solution
Macho_2
Frequent Advisor

link file

How to link one file to another file.

Example : file name : test1
Place the file "test1" in /sbin/init.d . Then create a link file in /sbin/rc2.d.
5 REPLIES 5
Peter Godron
Honored Contributor
Solution

Re: link file

Hi,
how about:
ln -s /sbin/init.d/test1 /sbin/rc2.d/test1

SANTOSH S. MHASKAR
Trusted Contributor

Re: link file

hi,

go to directory where file test1 is and issue
command,

# cp ./test1 /sbin/init.d

# ln -s /sbin/init.d/test1 /sbin/rc2.d/test1

This will create a symbolic link in file /sbin/init.d with name test1.


-Santosh
Macho_2
Frequent Advisor

Re: link file

Thank you very much. I managed to get it.
Tor-Arne Nostdal
Trusted Contributor

Re: link file

You got the answer on your question already Macho, but I just want to leave you a small note as the path you mentioned to the runlevel directories might be of a bit importancy....

Links in these directories is normally named Kxxx{filename} or Sxxx{filename}

The {filename} is the filename it has in the /sbin/init.d directory.
The xxx is a number which will indicate a sequence of start/stop.
K = Kill
S = Start

So a startup link for your test script could be like this.
ln -s /sbin/init.d/test1 /sbin/rc2.d/S950test1

And a stop link.
ln -s /sbin/init.d/test1 /sbin/rc2.d/K950test1


See man pages for rc
# man rc
or
# man 1M rc

for more details and recommendations if you have dependencies.

/Tor-Arne
I'm trying to become President of the state I'm in...
Macho_2
Frequent Advisor

Re: link file

Thank you again for your help.