|
From: Leif M. <le...@ta...> - 2003-04-21 13:48:55
|
The bash and sh scripts which have been released with the Wrapper up until this point were written by another of the founding members of the project. Historically, I have been mainly focussed on the Windows side but over the last year have been taking over the management of all platforms. While looking into Jim's recent problems getting the wrapper scripts to work on system startup and shutdown. I found that they did not seem to be working when referenced as symbolic links. As I had understood it, the purpose of using the realpath binary, included with the wrapper, was to work around this problem. But the problem is that as is, the scripts are not able to locate the realpath binary when referenced as a symbolic link. This is because the scripts were looking in the directory containing the script. But in the case of symbolic links, this location resolves to the location of the symbolic link, rather than that of the script itself. Kind of a chicken and the egg problem!! Anyway. I reworked the initialization of these scripts to test whether or not the script is being referenced directly or via a symbolic link. In the case of direct a reference, the directory of the script can be resolved using `dirname $0` and so realpath is no longer needed or used. However, when the script is referenced as a symbolic link, `dirname $0` will return the location of the symlink and not the script so realpath is needed. The scripts I am including for you to look over, look for the realpath command on the path. If it is not available, then the user is asked to copy it to the /usr/bin directory. (Is this the best choice) I would really like to be able to have the script locate the realpath binary in the same directory as the script. But if that was possible then I would not need the realpath binary in the first place. Like I said, "Chicken and the egg problem." One possibility would be to try and parse the output of `ls -al $0` as it always includes the target of the symbolic link, which is the location that is provided by realpath. Unfortunately, my script skills are lacking, so I would appreciate any help in getting that working. Any other feedback on these scripts would also be appreciated. Once these new scripts are finalized, I am hoping to get a section written up on how to install the scripts on the various platforms so that the Wrapper will be started and stopped cleanly when the system is started up and shutdown. The only UNIX systems that I am able to actually reboot for testing are Debian Linux systems. So I will need some info from Red Hat, Solaris, HP-UX. AIX and Max OS X users about the procedures involved. Thanks in advance. Cheers, Leif |