What a strange problem...
1) No such file or directory:
This might be due to lack of permissions. /var/spool/mail might be
unaccessible or unreadable by BB. On any properly configured mail server the
maildir is protected because it is supposed to contain private mail. The
requested shell might be unaccessible too...
2)
: command not found
: command not found
: command not found
'/test.sh: line 76: syntax error near unexpected token `in
'/test.sh: line 76: `case "$MAILSERVER" in
I usually get this kind of errors when there is a problem with quotation
and/or parentheses. I would count the quotation marks etc...
It is strange that the "command not found" message appears at the few first
EMPTY LINES. I would apply an esc-d-d in vi-editor to remove those troubling
"empty" lines and then add them back. The shell seems to try to use the ":"
(no-operation) built-in command. Why? I cannot see it in the script. Does
your shell even support it?
Misc
Editing files in a telnet session is bad - unless the keys are correctly
remapped of course. The backspace/del is often the problem and it leaves
some unwanted control characters (nonprintable) in the file. These sometimes
cause trouble. I would download the script again from deadcat and edit it
maybe on a console session.
Note that the bbdef.sh script is INCLUDED in the mailq.sh script. Is the
bbdef.sh correct?
There must be a typo or some nonprintable characters in the script. I cannot
find any bugs in the script from deadcat...
What shell are you using? Bash? Use a Bourne shell instead: the "ash" shell
should work. If you insist on using bash (/bin/sh in Linux) then at least
use it in compatibility mode, "set -B" I think.
-----Original Message-----
From: trichard [mailto:trichard@hypermall.net]
Sent: 26. elokuuta 2004 0:56
To: bb@bb4.com
Subject: Re: {bb} bb-mailq.sh - No such file or directory ???
Thanks for the assistance Adam. The results inline below:
Try this:
echo \#\!/bin/sh > test.sh
echo echo test >> test.sh
chmod 755 test.sh
./test.sh
If you see the work "test" then continue, else post back
the results of
"ls -l /bin/bash" and "ldd /bin/bash"
This worked. I saw "test"
continue here:
cat bb-mailq.sh >> test.sh
./test.sh
Post the results of that
[root@moe ext]# cat bb-mailq.sh >> test.sh
[root@moe ext]# ./test.sh
test
: command not found
: command not found
: command not found
'/test.sh: line 76: syntax error near unexpected token `in
'/test.sh: line 76: `case "$MAILSERVER" in
BTW, you *did* chmod 755 bb-mailq.sh didn't you?? Maybe
post the results
of "ls -l bb-mailq.sh"
Yes sir, I sure did.
[root@moe ext]# ls -l bb-mailq.sh
-rwxr-xr-x 1 bb bin 4229 Aug 25 15:45 bb-mailq.sh
Any other ideas?
Thanks so much for the help!
-trichard
On Wed, 2004-08-25 at 15:07, trichard wrote:
Well, unfortunately:
# file bb-mailq.sh
bb-mailq.sh: Bourne shell script text executable
Any other ideas? I've spent a good many hours on this and
am really at
a loss...I have tried emailing the author of the script to
see if he has
any ideas.
Thanks for the help Adam...I was hopeful it was going to work. :-)
Adam Goryachev wrote:
Type "file bb-mailq.sh" and you will probably find that
it is a dos type
file. You will need to convert it to a unix format file,
or, just open
it up in vi, and delete the first line, then re-type it,
save and quit.
Hope that helps.
Regards,
Adam
On Wed, 2004-08-25 at 08:12, trichard wrote:
Thanks for your help Barbara. The line appears as follows:
#!/bin/sh
#whereis sh
sh: /bin/sh
What's odd is that this script is directly off of
Deadcat. Any other
ideas?
Thanks!!
trichard
I seen similar type oddness when the first line isn't correct.
Is whatever there, something like "#!/bin/sh", correct?
No extra
spaces? Does /bin/sh exist?
Barbara
-----Original Message-----
From: owner-bb@bb4.com [mailto:owner-bb@bb4.com]On
Behalf Of trichard
Sent: Tuesday, August 24, 2004 2:20 PM
To: bb@bb4.com
Cc: trichard@hypermall.net
Subject: Re: {bb} bb-mailq.sh - No such file or directory ???
A follow-up based on more troubleshooting:
When I try and run this bb-mailq.sh script manually from the
/etc/bb/bbc1.9e-btf/ext directory I get the following:
bash: ./bb-mailq.sh: No such file or directory
Well, the file is certainly there and permissions look
correct (see
below). I believed this to be a misleading error with the script
possibly. To test this theory I ran:
sh --verbose ./bb-mailq.sh
The script runs then gives me the following output and
then stops with
the error you see at bottom:
===============================================
BEGIN ERROR
===============================================
#
VERSION="1.1"
: command not found
#
# CONFIGURE REQUIRED VARIABLES
#
TEST="mailq" # THE NAME OF OUR TEST
(displayed in BB table)
MAILSERVER="postfix" # SERVER USED :
postfix or
sendmail? QUEUEDIR="/var/spool/postfix" #
QUEUE DIRECTORY
MAILQ="/usr/bin/mailq"
GREP="/bin/grep"
TAIL="/usr/bin/tail"
ECHO="/bin/echo"
WC="/usr/bin/wc"
DC="/usr/bin/dc"
DU="/usr/bin/du"
CUT="/bin/cut"
LS="/bin/ls"
: command not found
NBWARN="10" # NB MAIL
WARNING LEVEL (yellow)
NBPANIC="50" # NB MAIL PANIC
LEVEL (red)
SIZEWARN="4000" # KB SIZE MAIL
WARNING LEVEL
(yellow) SIZEPANIC="10000" # KB
SIZE MAIL PANIC
LEVEL (red) #
# END OF CONFIGURATION
#
: command not found
if test "$BBHOME" = ""
then
echo "BBHOME is not set... exiting"
exit 1
fi
if test ! "$BBTMP" # GET
DEFINITIONS IF NEEDED then
# echo "*** LOADING BBDEF ***"
. $BBHOME/etc/bbdef.sh # INCLUDE
STANDARD DEFINITIONS
fi
# THE hostname COMMAND MUST RETURN THE FULL MACHINE NAME
# Normaly not required : value returned by bbdef.sh
# MACHINE=`hostname | $SED 's/\./,/g'`
#
# NB MAIL IN QUEUE
# SIZE OF THE MAIL QUEUE
#
case "$MAILSERVER" in
'/bb-mailq.sh: line 75: syntax error near unexpected token `in
'/bb-mailq.sh: line 75: `case "$MAILSERVER" in
===============================================
END ERROR
===============================================
You can see the various ": command not found" and then
the "syntax error
near unexpected token" problem.
Any idea on why this is happening? This is an
unmodified script from
Deadcat so I don't understand why it would have these
errors nor do I
know enough about scripts to correct it (yet...still learning!).
Thanks for any help...
trichard
Hello,
I have two questions please:
1. I have obtained bb-mailq.sh from deadcat. I have
placed it on my
client in the /etc/bb/bbc1.9e-btf/ext directory. I
have set perms to
be 755 as suggested. I have also configured my
bb-bbexttab to run
this script by adding:
localhost: : bb-mailq.sh
When I execute bbrun.sh I get the following error in BBOUT:
--
Tue Aug 24 13:25:34 MDT 2004: Starting Big Brother...
Starting external scripts
Starting external script bb-mailq.sh
Starting Local tests (bb-local)...
Big Brother 1.9e started
Tue Aug 24 13:25:34 2004 bb-mailq.sh sh:
/etc/bb/bbc1.9e-btf/ext/bb-mailq.sh: No such file or directory
--
Here are permissions and ownership:
drwxr-xr-x 2 bb root 4096 Aug 24 13:25 ext
-rwxr-xr-x 1 bb bin 4212 Aug 24 13:25
bb-mailq.sh
Any ideas on what is causing this? I have tried just
about everything
I can think of at this point...
2. In the bb-mailq.sh script it asks for a postfix mailqueue
directory.
I have specified the following since I am running Postfix:
QUEUEDIR="/var/spool/postfix" # QUEUE DIRECTORY
Is this correct or should it be something else? As you
know there are
several directories under /var/spool/postfix (i.e.
deferred, incoming,
etc.). However, my main.cf in postfix states this as the root
directory for the queue.
Thanks for any help or assistance!
-trichard
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=
-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the
bb-digest list
send e-mail to mailto:majordomo@bb4.com with
unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-
=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the
bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe
bb -and/or-
subscribe bb-digest in the BODY of the message.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-
=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the
bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe
bb -and/or-
subscribe bb-digest in the BODY of the message.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=
-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the
bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe
bb -and/or-
subscribe bb-digest in the BODY of the message.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.
--
--
Adam Goryachev
Website Managers
Ph: +61 2 8304 0000
adam@websitemanagers.com.au
Fax: +61 2 9345 4396 www.websitemanagers.com.au
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.