Date: Tue, 28 Jun 2005 13:07:23 -0600 From: "Chris Burchell" <cburchell@muttart.org> To: <freebsd-questions@FreeBSD.org> Subject: initlog: command not found ?? Message-ID: <AF33154333460E439B317830E50C10490D624B@tmfsrv01.muttart.org>
next in thread | raw e-mail | index | archive | help
Hello:
(FreeBSD 5.3-RELEASE)
I am using the script below to start / stop MailScanner on my system
using Exim. The script appears to work properly, as I can clearly see
from logs and ps -ax that the service does indeed stop and start...
however,
Whenever I try to run '/etc/init.d/MailScanner stop' (start, restart,
etc.) I get the following:
srv01# /etc/init.d/MailScanner stop
Shutting down MailScanner daemons:
MailScanner: /usr/home/installd/functions: line 350:
initlog: command not found
[FAILED]
particluarly, I don't know what the 'initlog: command not found' error
indicates.
(/usr/home/installd/initlog does exist)
Can anyone provide assistance to resolve this error?
Cheers,
Chris
---BEGIN SCRIPT---
srv01# cat /etc/init.d/MailScanner
#!/bin/bash
#
# mailscanner This shell script takes care of starting and stopping
# MailScanner.
#
# chkconfig: 2345 80 30
# description: MailScanner is an open-source E-Mail Gateway Scanner.
# processname: MailScanner
# config: /usr/mailscanner/etc/MailScanner.conf
# pidfile: /usr/mailscanner/var/MailScanner.pid
# Source function library.
# . /etc/init.d/functions
. /usr/home/installd/functions
# Source networking configuration.
#. /etc/sysconfig/network
. /etc/rc.conf
# Check that networking is up.
[ "${NETWORKING}" =3D "no" ] && exit 0
TMPDIR=3D/var/spool/MailScanner
export TMPDIR
# See how we were called.
case "$1" in
start)
# Start daemons.
echo 'Starting MailScanner daemons:'
echo -n ' MailScanner: '
/usr/mailscanner/bin/check_mailscanner >/dev/null
success
echo
;;
stop)
# Stop daemons.
echo 'Shutting down MailScanner daemons:'
echo -n ' MailScanner: '
pid=3D`head -1 /usr/mailscanner/var/MailScanner.pid`
alive=3D`ps ax | awk '{ print $1 }' | grep '^'$pid'$'`
if [ -z "$alive" ] ; then
failure
else
/bin/kill -TERM -- -$pid
success
fi
echo
;;
status)
# Work out if all of MailScanner is running
echo 'Checking MailScanner daemons:'
echo -n ' MailScanner: '
pid=3D`head -1 /usr/mailscanner/var/MailScanner.pid`
alive=3D`ps ax | awk '{ print $1 }' | grep '^'$pid'$'`
if [ -z "$alive" ] ; then failure; else success; fi
echo
;;
reload)
echo 'Reloading MailScanner workers:'
echo -n ' MailScanner: '
pid=3D`head -1 /usr/mailscanner/var/MailScanner.pid`
alive=3D`ps ax | awk '{ print $1 }' | grep '^'$pid'$'`
if [ -z "$alive" ] ; then
failure
echo
$0 start
else
/bin/kill -HUP -- -$pid
success
fi
echo
;;
restart)
$0 stop
sleep 8
$0 start
;;
*)
echo "Usage: service MailScanner
{start|stop|status|restart|reload}"
exit 1
esac
exit
---END SCRIPT---
This is the section from /usr/home/installd/functions that is causing
the error:
# Log that something succeeded
success() {
if [ -z "${IN_INITLOG:-}" ]; then
initlog $INITLOG_ARGS -n $0 -s "$1" -e 1
else
# silly hack to avoid EPIPE killing rc.sysinit
trap "" SIGPIPE
echo "$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21
trap - SIGPIPE
fi
[ "$BOOTUP" !=3D "verbose" ] && echo_success
return 0
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AF33154333460E439B317830E50C10490D624B>
