Does creating a symlink to another symlink on a linux box have any side effects (specifically in terms of performance)?
While symlinks are very useful for day to days work, they are prone to spread harvoc when used by malicious users or programs. There are many well-documented cases, where programs running with elevated privileges consume symlinks, that were placed there by other users.
Yes, a symbolic link is a pointer to another location. This means that any changes you make are in fact updating at the target location.
As illustrated, when we create a symbolic link, we create an inode that contains the file name of the file that we want to link to. When we create a hard link, we set the inode number to be the inode of the file that we want to link to. This will increase the link count of that file by one.
We can use the -l option of rsync for copying symlinks. rsync copies the symlinks in the source directory as symlinks to the destination directory using this option. Copying the symlinks is successful in this case.
In general, no. Technically, there will be a very slight performance hit for the indirection, but it won't be noticeable to your application. As an example, most shared libraries are symlinks to symlinks (e.g. libQtCore.so -> libQtCore.so.4 -> libQtCore.so.4.7 -> libQtCore.so.4.7.1).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With