Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to setup email notifications for my continuous integration server. I have a script which uses nail to send the email when the build works:

#!/bin/bash
echo "Build Worked!" | nail -A myisp -s 'Build Success' my_email@gmail.com

When I run this from the command line with sh build-worked, it works and I receive the email. However, when I start the continuous integration server which executes the same script, I get the following error:

nail: /opt/bitnami/common/lib/libssl.so.0.9.8: no version information available (required by nail)
nail: /opt/bitnami/common/lib/libcrypto.so.0.9.8: no version information available (required by nail)
Error with certificate at depth: 0
 issuer = /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com
 subject = /C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
 err 20: unable to get local issuer certificate
Continue (y/n)? could not initiate SSL/TLS connection: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
. . . message not sent.

I must be messing some configuration, any ideas?

share|improve this question
    
I've never used nail before but I'd use 'su - ' to become the user that the script runs as and then debug from there. It may be that on the first interactive run it'll ask you to confirm that the ssl certificate is correct and then it'll run ok scripted. –  kaerast Apr 10 '10 at 16:58

1 Answer 1

up vote 1 down vote accepted

Problems where something runs from the shell but won't from cron or init or daemon or some other environment are usually caused by differences in the environment.

  • Use absolute paths to executables and data files
  • Explicitly set your PATH variable to make sure it includes what you need
  • Explicitly set other environment variables that your process needs

Since it looks like nail is complaining about some libraries, it's likely that an environment variable points one way in one environment and another (or not at all) in another.

I'm not familiar with BitNami, but on my system those libraries are in /lib and /usr/lib (and /lib/i586 and similar).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.