In a python script, I am creating a bunch of symbolic links chained together.example: link1->link2->link3->.......->somefile.txtI was wondering how you can change the max number of symlinks to be greater than 20?
How do you increase MAXSYMLINKS
linux;symlink;limit
On Linux (3.5 at least), it's hardcoded to 40 (see follow_link() in fs/namei.c), and note that it's the number of links followed when resolving all the components of a path, you can only change it by recompiling the kernel.$ ln -s . 0$ n=0; repeat 50 ln -s $((n++)) $n$ ls -LdF 3939/$ ls -LdF 40ls: cannot access 40: Too many levels of symbolic links$ ls -LdF 20/18 10/10/10/610/10/10/6/  20/18/$ ls -LdF 20/19 10/10/10/7ls: cannot access 20/19: Too many levels of symbolic linksls: cannot access 10/10/10/7: Too many levels of symbolic links