2009/4/1 Daed Lee <d...@thoughtsofcode.com>: > After Installing HTTPD, I get the following directory structure in Settings: > > /System/Settings/httpd (this is a symlink pointing to > /Programs/HTTPD/Settings/httpd) > > A problem arises when installing Mod_PHP, which installs the file > mod_php5.conf into the /System/Settings/httpd/conf folder. The issue > is that it doesn't follow the /System/Settings/httpd symlink into > /Programs/HTTPD/Settings/httpd, but rather it replaces the > /System/Settings/httpd symlink with an actual directory, and then > installs mod_php5.conf into the newly created directory. > That's intentional as applications (in this cas mod_php) should not install/inject files into other applications' (this case httpd) /Programs entry. Instead any common directories under /System/{Links,Settings}, that before were symlinks, are made to real directories and the subdirectories or files inside are made to links instead.
> This results in the following duplicate paths: > > /System/Settings/httpd/conf (a directory that contains the mod_php5.conf file) > > and > > /Programs/HTTPD/Settings/httpd/conf (a directory that doesn't contain > anything) > If it's empty this is a bug. > /Programs/HTTPD/Settings/httpd/conf is basically useless, placing > Apache configuration files there doesn't have any effect. The behavior > that I was expecting was for the /System/Settings/httpd symlink to be > followed so that both the > /Programs/HTTPD/Settings/httpd/conf/mod_php5.conf and > /Programs/HTTPD/Settings/httpd/conf/mod_php5.conf paths exist and > refer to the same file. > As we can't have applications placing files inside other applications' directories under /Programs there must be a common structure somehwere where both can read and write files. This is where /System/Settings (Links) comes in. Any third-party httpd module will create links to their own setting under /System/Settings and place links to their own modules under /System/Links/Libraries, so that httpd can find them without having to search multiple paths. If any directory conflicts with a link, that link will be expanded and the contents will be linked instead (which is what you saw). This has the effect that any files placed inside say /Programs/HTTPD/Settings are not automatically linked to the global /System/Settings and therefore not picked up by httpd. Instead one has to run "SymlinkProgram httpd" to place it there (one could probably use Listener to make a rule to make this automatically). > I tracked the issue down to Scripts/2.9.9/bin/LinkOrExpandAll. My C is > a little rusty, so I modified the corresponding Python program in > Scripts/2.9.9/Functions/GoboLinux. Here is a patch that fixes the > issue: > > --- GoboLinux.original 2009-03-31 21:35:03.000000000 -0400 > +++ GoboLinux 2009-03-31 21:35:15.000000000 -0400 > @@ -260,16 +260,11 @@ def Link_Or_Expand(new, conflict, relati > > # 5: name of new was being used by an link to a directory > elif os.path.islink(bn) and os.path.isdir(realold) and > os.path.isdir(realnew) : > - Log_Normal('Creating expanded directory \'%s\'...'%(bn)) > - os.unlink(bn) > - os.makedirs(bn) > + cwd=os.getcwd() > os.chdir(bn) > - Log_Verbose('Linking files from \'%s\' in directory > \'%s\'...'%(realold, bn)) > - for i in os.listdir(realold) : > - oldbn=os.path.basename(i) > - create_single_link(realold+'/'+i, oldbn) > - os.chdir('..') > - link_inside() > + for i in os.listdir(realnew) : > + Link_Or_Expand(realnew+'/'+i, conflict, relative) > + os.chdir(cwd) > > # 6: conflict for a same name > elif not os.path.isdir(realold) and not os.path.isdir(realnew): > > I'd appreciate any feedback on this. Thanks. Links are supposed to be expanded. This patch will place files inside whatever application's /Programs directory that was created and symlinked first. -- /Jonas _______________________________________________ gobolinux-devel mailing list gobolinux-devel@lists.gobolinux.org http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel