parsed.org

Tips by tag: symlinks

Redhat/Fedora Services by xinu on Jan 18, 2005 01:02 PM

If you have a services script in /etc/rc.d, you can add the service to the various run levels to create the appropriate start/kill symlinks:

# chkconfig --level 345 imap on
# service xinetd restart
bootchkconfigcommandsconfigurationfedoraredhatservicesstartupsymlinks
SCP Symlinks by xinu on Dec 19, 2005 12:05 PM

If you're running scp -r, beware of symlinks; they are followed rather than preserved. This might be favorable behavior if you're referencing files outside what you're copying, but if you're copying symlinks which reference other parts of what you're copying, the referenced files will be duplicated on the destination host.

Take, for example, the following files on host A:

~/myfiles/
  foo/
    a.txt
  bar/ -> foo/

When you run this command on host B:

joe@B:~$ scp -r joe@A:~/myfiles .

The result on host B will be:

~/myfiles/
  foo/
    a.txt
  bar/
    a.txt
commandsgotcharecursivescpshellsymlinks
Tracking Down Symlinks by xinu on Jun 24, 2005 01:41 PM

Make sure you always specify a path free of symlinks. This can be pretty tough, though. An alternative approach is to use namei to track down symlinks:

# namei /usr/X11/bin/xterm
f: /usr/X11/bin/xterm
d /
d usr
l X11 -> X11R6
  d X11R6
d bin
- xterm
commandsdirectorynameipathshellsymlinkstree
RSS