Print this page
XXX Remove nawk(1)


  79 
  80         #
  81         # ETRN_HOSTS should be of the form
  82         # "s1:c1.1,c1.2        s2:c2.1 s3:c3.1,c3.2,c3.3"
  83         # i.e., white-space separated groups of server:client where
  84         # client can be one or more comma-separated names; N.B. that
  85         # the :client part is optional; see etrn(1M) for details.
  86         # server is the name of the server to prod; a mail queue run
  87         # is requested for each client name.  This is comparable to
  88         # running "/usr/lib/sendmail -qRclient" on the host server.
  89         #
  90         # See RFC 1985 for more information.
  91         #
  92         for i in $ETRN_HOSTS; do
  93                 SERVER=`echo $i | /usr/bin/sed -e 's/:.*$//'`
  94                 CLIENTS=`echo $i | /usr/bin/sed -n -e 's/,/ /g' \
  95                     -e '/:/s/^.*://p'`
  96                 /usr/sbin/etrn -b $SERVER $CLIENTS >/dev/null 2>&1 &
  97         done
  98 
  99         if /usr/bin/nawk 'BEGIN{s = 1}
 100             $2 == "/var/mail" && $3 == "nfs" && $4 !~ /actimeo=0/ &&
 101             $4 !~ /noac/{s = 0} END{exit s}' /etc/mnttab; then
 102 
 103                 /usr/bin/logger -p mail.crit "$ERRMSG1"
 104                 /usr/bin/logger -p mail.crit "$ERRMSG2"
 105         fi
 106         ;;
 107 
 108 'stop')
 109         [ -f $SERVER_PID_FILE ] && check_and_kill $SERVER_PID_FILE
 110         # Need to kill the entire service contract to kill all sendmail related
 111         # processes
 112         smf_kill_contract $2 TERM 1 30
 113         ret=$?
 114         [ $ret -eq 1 ] && exit 1
 115 
 116         # Since sendmail spawns user processes out of .forward files, it is
 117         # possible that some of these are not responding to TERM.  If the
 118         # contract did not empty after TERM, move on to KILL.
 119         if [ $ret -eq 2 ] ; then


  79 
  80         #
  81         # ETRN_HOSTS should be of the form
  82         # "s1:c1.1,c1.2        s2:c2.1 s3:c3.1,c3.2,c3.3"
  83         # i.e., white-space separated groups of server:client where
  84         # client can be one or more comma-separated names; N.B. that
  85         # the :client part is optional; see etrn(1M) for details.
  86         # server is the name of the server to prod; a mail queue run
  87         # is requested for each client name.  This is comparable to
  88         # running "/usr/lib/sendmail -qRclient" on the host server.
  89         #
  90         # See RFC 1985 for more information.
  91         #
  92         for i in $ETRN_HOSTS; do
  93                 SERVER=`echo $i | /usr/bin/sed -e 's/:.*$//'`
  94                 CLIENTS=`echo $i | /usr/bin/sed -n -e 's/,/ /g' \
  95                     -e '/:/s/^.*://p'`
  96                 /usr/sbin/etrn -b $SERVER $CLIENTS >/dev/null 2>&1 &
  97         done
  98 
  99         if /usr/xpg4/bin/awk 'BEGIN{s = 1}
 100             $2 == "/var/mail" && $3 == "nfs" && $4 !~ /actimeo=0/ &&
 101             $4 !~ /noac/{s = 0} END{exit s}' /etc/mnttab; then
 102 
 103                 /usr/bin/logger -p mail.crit "$ERRMSG1"
 104                 /usr/bin/logger -p mail.crit "$ERRMSG2"
 105         fi
 106         ;;
 107 
 108 'stop')
 109         [ -f $SERVER_PID_FILE ] && check_and_kill $SERVER_PID_FILE
 110         # Need to kill the entire service contract to kill all sendmail related
 111         # processes
 112         smf_kill_contract $2 TERM 1 30
 113         ret=$?
 114         [ $ret -eq 1 ] && exit 1
 115 
 116         # Since sendmail spawns user processes out of .forward files, it is
 117         # possible that some of these are not responding to TERM.  If the
 118         # contract did not empty after TERM, move on to KILL.
 119         if [ $ret -eq 2 ] ; then