Re: Wierd problem with a script that calls nail
Kevin Mark wrote:
On Sat, Dec 30, 2006 at 01:49:12PM +0100, Brian wrote:
I have a Debian Sarge box and an NSLU2 (Unslung) that I have setup to
send me mails when they startup, reboot, and do various other things,
they use Nail to sned the emails to me. I tried to setup my mothers PC
to do the same, no way I can get it to work. If I run the scripts by
hand all works OK.
So I have a script /usr/sbin/mailtext.sh, that calls Nail with 2
parameters. In RC.0, RC.3 and RC.5 is have symbolic links to a script
in /etc/init.d that calls mailtext.sh.
Mailtext gets called, and I have inserted logger statements in the
script, those messages appear in my /var/log/messages, so I know that my
script is called when it should be.
But, I never get the mails. If I run the script by hand as root then I
get the mail. So I thought maybe something else needs to be started
beforehand, but this runs as last in rc.3 amd rc.5, so network is up by
Just wondering how to debug this further, how can I get any error
messages from nail into my logs? All I tried up till now doesn't seem to
try adding some logging to the script at the beginning and the end to a
echo "starting my script" >> mylogfile.log
just FYI here is the script:
/bin/logger "/opt/sbin/mailtext Sending "$1" to Brian"
echo "$2" | nail -v -s Slug1:"$1" email@example.com
That gives plenty of output, just can't figure out a way to capture it yet.
1Help 2Save 3Mark 4Replac 5Copy 6Move 7Search 8Delete 9PullDn