initlog: command not found ??
Chris Burchell
cburchell at muttart.org
Tue Jun 28 19:07:25 GMT 2005
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}" = "no" ] && exit 0
TMPDIR=/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=`head -1 /usr/mailscanner/var/MailScanner.pid`
alive=`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=`head -1 /usr/mailscanner/var/MailScanner.pid`
alive=`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=`head -1 /usr/mailscanner/var/MailScanner.pid`
alive=`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" != "verbose" ] && echo_success
return 0
}
More information about the freebsd-questions
mailing list