/sbin/rc0,rc5 and rc6 having same inode numbers

Hi All,

While going through the old SUN docs, it occured to me that the run level initiating scripts /sbin/rc0,rc5 and rc6 have the same inode number. I understand they perform the same fuction (call /etc/rc0.d/K* and S* scripts) but still they are three different files and not linked to each other. They all also lie in the same partition. So, how come three different files in the same partition use the same inode number?? Am I missing something here?

# ls -li /sbin/rc?
     33682 -rwxr--r--   3 root     sys         1983 Jan 21  2005 /sbin/rc0
     33683 -rwxr--r--   1 root     sys         2242 Jan 21  2005 /sbin/rc1
     33684 -rwxr--r--   1 root     sys         2536 Jan 21  2005 /sbin/rc2
     33685 -rwxr--r--   1 root     sys         2567 Jan 21  2005 /sbin/rc3
     33682 -rwxr--r--   3 root     sys         1983 Jan 21  2005 /sbin/rc5
     33682 -rwxr--r--   3 root     sys         1983 Jan 21  2005 /sbin/rc6
     33686 -rwxr--r--   1 root     sys         5125 Jan 21  2005 /sbin/rcS

Observe that rc0, rc5 and rc6 have the same inode number 33682 and the link count is 3.

I have never used Solaris. But, those seem like hard links. Hard links will have the same inode number. All those 3 names will be referring to the same physical location on disk. Basically, you use the 3 names to refer to the same thing. This is esp. used when you want something (script,etc.) to do different things and these "different" things do not differ much and so it does not warrant creation of separate scripts for the "different" things. So, you use only 1 copy and do these "different" things depending on the name the script is called with.

:o Correct! Forgot that.. that is why the link counter is 3