Description of problem:
Attempting to run `generate-db-password.sh` on sun; the former is more innocuous, the latter appears fatal.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
bash-2.05# ./generate-db-password.sh rhqadmin
./generate-db-password.sh: readlink: not found
./generate-db-password.sh: test: unknown operator ==
Can't remember why we would need readlink in this sort of script, but that's not a terribly big deal I don't think, and we tell people to install readlink on Sun anyway if they think they'll be using the startup scripts for agent and server. That said, we should probably just make readlink from sunfreeware a hard requirement...
But regarding the other issue, this appears fatal to the tool -- it does not successfully run. We do manage to obfuscate in rhq-server.properties, however...?
We've had similar problems with our other scripts iirc, in both the same places. So we should take a look at the existing server/agent scripts, when fixing this.
Fix for the unknown operator is in 48423a9
the issues charles refers to is:
The "==" is due to the shell on solaris - we never use "==" in our scripts
anymore due to this. Always use "=".
readlink issue: they don't HAVE to have readlink - only if they are symlinking
to the script itself. We continue on if readlink isn't available, but if the
script is a symlink it will fail. See:
"For Solaris Admins: Symbolically linking the agent scripts require invocation
of readlink in rhq-agent-wrapper.sh. However, readlink is not supplied by
default in some Solaris installations. Solaris users must either download
readlink from a third party provider, such as Sunfreeware, or refrain from
symbolically linking the agent scripts when using the wrapper script. Note that
if you do not use symbolic links, the agent will not be able to auto-update the
script if it needs to do so in the future."
That's why our scripts do this (notice the || operator):
_DOLLARZERO=`readlink "$0" || echo "$0"`
BTW, my comment regarding any necessity of readlink is the question as to why we would need this in the first place. It makes sense for agent scripts to have to deal with symlinks, since they are service wrappers and may exist in symlinked locations. I don't imagine many people would be doing this sort of thing with the obfuscation script though.
Mass-closure of verified bugs against JON.