[Shipwright] more problems with shipwright-*-wrapper on solaris

Andy Cobaugh phalenor at gmail.com
Wed Jun 30 15:34:48 EDT 2010

2 problems:

1) This line doesn't populate LINK as expected:

     test -h $0 && LINK=`ls -l $0 | awk -F\>  '{print $NF}'

it ends up with a space in fron, like this

     " ../etc/shipwright-script-wrapper"

which of course breaks things further down. To fix this, I've done 
something like this:

     test -h $0 && LINK=`ls -l $0 | awk -F\>  '{print $NF}' | sed -e 's/^ //'`

What I did when we originally saw this on our current installation was use 
the readlink provided with in /opt/sfw, but we can't rely on /opt/sfw 
(provided by the Solaris Companion CD) to exist in the general case.

2) With 'real' /bin/sh, variables must be export'd in order for 
sub-processes to see them, so something like this won't work on solaris:

     PERL5LIB=foo ./myProgram.pl

As a result, solaris doesn't get the correct PERL5LIB set up for it, among 
other things. To fix this, I've made the env variable declarations on 
separate lines, with a final export line, like this:


followed by the exec line.

Most likely, /bin/sh on your system is /bin/bash, which would explain why 
inlining the variable assignments works.

I'm not sure how this is working with our current installation of RT on 
solaris (mailservers are solaris, so they just need rt-mailgate, but even 
rt-mailgate needs things like LWP::UserAgent). I bet I never relocated the 
vessel after building it, so the builtin @INC hasall the right paths.


More information about the Shipwright mailing list