Startup script

Julian Field mailscanner at ecs.soton.ac.uk
Tue Nov 5 17:03:50 GMT 2002


At 16:31 05/11/2002, you wrote:
>On Tue, 2002-11-05 at 16:44, Andrew G Allen wrote:
> > Does your installation therefore require that the MailScanner & sendmail
> > init scripts both have to be started? If this is the case, the only
> > problem is that on reboot, only MailScanner will start, since when it was
> > installed, sendmail was 'switched off' with chkconfig.
>
>Yes, both need to be run at startup,
>do a 'chkconfig --level 345 sendmail on'

NO THEY DON'T (it's my list, and I'll shout if I want to :-)
Please see my posting of a minute ago.

> > > hi,
> > >
> > > I modified the sendmail init script to use the "queue delivery mode" :
> > > daemon /usr/sbin/sendmail -bd -OQueueDirectory=/var/spool/mqueue.in
> > > -ODeliveryMode=queueonly
> > >
> > > and modified the mailscanner init script and comented out every thing
> > > about sendmail ...
> > >
> > > i found some very usefull explanation on the rackshack forum
> > > (http://forum.rackshack.net), you should give look...
> > >
> > > i you want, i can send my modified startup scripts ...
> > >
> > > hth
> > >
> > > fred
> > >
> > > PS sorry for my poor english :(
> > >
> > > On Tue, 2002-11-05 at 14:35, Andrew G Allen wrote:
> > >> No luck :( I've tried doing this in the MailScanner.conf and in the
> > >> MailScanner startup script. There are no errors produced this time,
> > >> but no bandwidth is recorded.
> > >>
> > >> Is there anyway to decompile the shared library
> > >> (/lib/libensimvwhbw.so)? I've attached the whole sendmail init script
> > >> incase you can see something that can be copied/added to the
> > >> MailScanner script. Is there someway of running MailScanner, but call
> > >> sendmail using it's own init script? Just looking for ideas...
> > >>
> > >> Andrew G Allen
> > >> email: mail at projectandrew.com | voice: +44 (0) 7958 540596
> > >>
> > >> --- Disclaimer ---
> > >> This e-mail and any files transmitted with it are confidential and
> > >> intended solely for the use of the individual or entity to whom they
> > >> are addressed. If you have received this email in error, please notify
> > >> the system manager.
> > >>
> > >> > I'm not at all convinced this will work, but give it a try:
> > >> > Write a very short script that sets these variables and then calls
> > >> sendmail, something like this
> > >> >
> > >> > #!/bin/sh
> > >> > export LD_PRELOAD=/lib/libensimvwhbw.so
> > >> > export ENSIMVWH_BWSVCID=1
> > >> > /usr/sbin/sendmail "$@"
> > >> >
> > >> > and then call this script in MailScanner instead of directly
> > >> invoking sendmail. You should just edit the "Sendmail =" setting in
> > >> > MailScanner.conf  to refer to your script instead of sendmail
> > >> itself.
> > >> >
> > >> > See what happens with this setup.
> > >> >
> > >> > At 18:42 04/11/2002, you wrote:
> > >> >>I am still trying to get MailScanner fully working with Ensim
> > >> >> WEBppliance - the only part that is not working is a piece of
> > >> custom ensim code that is normally called from the sendmail startup
> > >> script. The two lines are:
> > >> >>
> > >> >>         export LD_PRELOAD=/lib/libensimvwhbw.so
> > >> >>         export ENSIMVWH_BWSVCID=1
> > >> >>
> > >> >>If I add these to the MailScanner startup script, MailScanner will
> > >> >> accept mail, but will not deliver it to any chrooted site. I also
> > >> get file not found errors thrown to the console. It seems to me
> > >> then, to be something that must be passed from the sendmail config
> > >> for this module to work, which is not passed by MailScanner - it is
> > >> supposed to track the size of each mail passed through sendmail, so
> > >> a monthly 'bandwidth allowance' can be applied to each virtual site
> > >> within Ensim. I don't really know where to go next, and wondered if
> > >> anybody who knows sendmail in more detail might have any ideas
> > >> where to look?
> > >> >>
> > >> >>Does MailScanner refer to all the same sendmail config files that
> > >> >> sendmail would if it was called using its own startup script?
> > >> >>
> > >> >>Andrew G Allen
> > >> >>email: mail at projectandrew.com | voice: +44 (0) 7958 540596
> > >> >>
> > >> >>--- Disclaimer ---
> > >> >>This e-mail and any files transmitted with it are confidential and
> > >> >> intended solely for the use of the individual or entity to whom
> > >> they are addressed. If you have received this email in error,
> > >> please notify the system manager.
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>--
> > >> >>This message has been scanned for viruses and dangerous
> > >> >>content by MailScanner, and is believed to be clean.
> > >> >
> > >> > --
> > >> > Julian Field                Teaching Systems Manager
> > >> > jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
> > >> Tel. 023 8059 2817          University of Southampton
> > >> >                              Southampton SO17 1BJ
> > >> >
> > >> >
> > >> > --
> > >> > This message has been scanned for viruses and dangerous
> > >> > content by MailScanner, and is believed to be clean.
> > >>
> > >>
> > >>
> > >> --
> > >> This message has been scanned for viruses and dangerous
> > >> content by MailScanner, and is believed to be clean.
> > >>
> > >> ----
> > >>
> > >
> > >> #!/bin/bash
> > >> #
> > >> # sendmail      This shell script takes care of starting and stopping
> > >> #               sendmail.
> > >> #
> > >> # chkconfig: 2345 80 30
> > >> # description: Sendmail is a Mail Transport Agent, which is the
> > >> program \ #              that moves mail from one machine to another.
> > >> # processname: sendmail
> > >> # config: /etc/sendmail.cf
> > >> # pidfile: /var/run/sendmail.pid
> > >>
> > >> # Source function library.
> > >> . /etc/init.d/functions
> > >>
> > >> # Source networking configuration.
> > >> . /etc/sysconfig/network
> > >>
> > >> # Source sendmail configureation.
> > >> if [ -f /etc/sysconfig/sendmail ] ; then
> > >>         . /etc/sysconfig/sendmail
> > >> else
> > >>         DAEMON=no
> > >>         QUEUE=1h
> > >> fi
> > >>
> > >> # Check that networking is up.
> > >> [ ${NETWORKING} = "no" ] && exit 0
> > >>
> > >> [ -f /usr/sbin/sendmail ] || exit 0
> > >>
> > >> RETVAL=0
> > >> prog="sendmail"
> > >>
> > >> start() {
> > >>         # Start daemons.
> > >>
> > >>         echo -n $"Starting $prog: "
> > >>         /usr/bin/newaliases > /dev/null 2>&1
> > >>         for i in virtusertable access domaintable ; do
> > >>             if [ -f /etc/mail/$i ] ; then
> > >>                 makemap hash /etc/mail/$i < /etc/mail/$i
> > >>             fi
> > >>         done
> > >>         mailertables=
> > >>         if [ -f /etc/mail/mailertable.virtual_domains ]; then
> > >>             mailertables="/etc/mail/mailertable.virtual_domains"
> > >>         fi
> > >>         if [ -f /etc/mail/mailertable ]; then
> > >>             mailertables="$mailertables /etc/mail/mailertable"
> > >>         fi
> > >>         if [ -n "$mailertables" ]; then
> > >>             cat $mailertables | makemap hash /etc/mail/mailertable.db
> > >>         fi
> > >>         genericstables=
> > >>         if [ -f /etc/mail/genericstable.siteadmins ]; then
> > >>             genericstables="/etc/mail/genericstable.siteadmins"
> > >>         fi
> > >>         if [ -f /etc/mail/genericstable ]; then
> > >>             genericstables="$mailertables /etc/mail/genericstable"
> > >>         fi
> > >>         if [ -n "$genericstables" ]; then
> > >>             cat $genericstables | makemap hash
> > >> /etc/mail/genericstable.db
> > >>         fi
> > >>         export LD_PRELOAD=/lib/libensimvwhbw.so
> > >>         export ENSIMVWH_BWSVCID=1
> > >>         daemon /usr/sbin/sendmail $([ "$DAEMON" = yes ] && echo -bd) \
> > >>                                   $([ -n "$QUEUE" ] && echo -q$QUEUE)
> > >>         RETVAL=$?
> > >>         echo
> > >>         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail
> > >>         return $RETVAL
> > >> }
> > >>
> > >> start-fast() {
> > >>         # Start daemons.
> > >>
> > >>         echo -n $"Starting $prog: "
> > >>         /usr/bin/newaliases > /dev/null 2>&1
> > >>         for i in virtusertable access domaintable ; do
> > >>             if [ -f /etc/mail/$i ] ; then
> > >>                 makemap hash /etc/mail/$i < /etc/mail/$i
> > >>             fi
> > >>         done
> > >>         export LD_PRELOAD=/lib/libensimvwhbw.so
> > >>         export ENSIMVWH_BWSVCID=1
> > >>         daemon /usr/sbin/sendmail $([ "$DAEMON" = yes ] && echo -bd) \
> > >>                                   $([ -n "$QUEUE" ] && echo -q$QUEUE)
> > >>         RETVAL=$?
> > >>         echo
> > >>         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail
> > >>         return $RETVAL
> > >> }
> > >>
> > >> stop() {
> > >>         # Stop daemons.
> > >>         echo -n $"Shutting down $prog: "
> > >>         killproc sendmail
> > >>         RETVAL=$?
> > >>         echo
> > >>         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
> > >>         return $RETVAL
> > >> }
> > >>
> > >> # See how we were called.
> > >> case "$1" in
> > >>   start)
> > >>         start
> > >>         ;;
> > >>   start-fast)
> > >>         start-fast
> > >>         ;;
> > >>   stop)
> > >>         stop
> > >>         ;;
> > >>   restart|reload)
> > >>         stop
> > >>         start
> > >>         RETVAL=$?
> > >>         ;;
> > >>   condrestart)
> > >>         if [ -f /var/lock/subsys/sendmail ]; then
> > >>             stop
> > >>             start
> > >>             RETVAL=$?
> > >>         fi
> > >>         ;;
> > >>   status)
> > >>         status sendmail
> > >>         RETVAL=$?
> > >>         ;;
> > >>   restart-fast)
> > >>         stop
> > >>         start-fast
> > >>         RETVAL=$?
> > >>         ;;
> > >>   *)
> > >>         echo $"Usage: $0
> > >> {start|stop|restart|condrestart|status|start-fast|restart-fast}"
> > >> exit 1
> > >> esac
> > >>
> > >> exit $RETVAL
> > >>
> > >>
> > >
> > > --
> > > This message has been scanned for viruses and dangerous
> > > content by MailScanner, and is believed to be clean.
> >
> >
> >
> >
> > --
> > This message has been scanned for viruses and dangerous
> > content by MailScanner, and is believed to be clean.
>
>

--
Julian Field                Teaching Systems Manager
jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
Tel. 023 8059 2817          University of Southampton
                             Southampton SO17 1BJ



More information about the MailScanner mailing list