da978630d1f0b07bd370e402117d4d9b17bac427John Beck# CDDL HEADER START
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# The contents of this file are subject to the terms of the
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# Common Development and Distribution License (the "License").
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# You may not use this file except in compliance with the License.
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# See the License for the specific language governing permissions
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# and limitations under the License.
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# When distributing Covered Code, include this CDDL HEADER in each
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# If applicable, add the following below this CDDL HEADER, with the
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# fields enclosed by brackets "[]" replaced with your own identifying
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# information: Portions Copyright [yyyy] [name of copyright owner]
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# CDDL HEADER END
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
da978630d1f0b07bd370e402117d4d9b17bac427John Beck# Use is subject to license terms.
da978630d1f0b07bd370e402117d4d9b17bac427John BeckCLIENT_PID_FILE="/var/spool/clientmqueue/sm-client.pid"
da978630d1f0b07bd370e402117d4d9b17bac427John Beck [ -f $CLIENT_PID_FILE ] && kill -1 `head -1 $CLIENT_PID_FILE`
da978630d1f0b07bd370e402117d4d9b17bac427John Beck # * CLIENTQUEUEINTERVAL should be set to some legal value;
da978630d1f0b07bd370e402117d4d9b17bac427John Beck # sanity checks are done below.
da978630d1f0b07bd370e402117d4d9b17bac427John Beck # * CLIENTOPTIONS are catch-alls; set with care.
da978630d1f0b07bd370e402117d4d9b17bac427John Beck submit_path=`svcprop -p config/path_to_submit_mc $SMF_FMRI 2>/dev/null`
da978630d1f0b07bd370e402117d4d9b17bac427John Beck $SENDMAIL -Ac -q$CLIENTQUEUEINTERVAL $CLIENTOPTIONS &
da978630d1f0b07bd370e402117d4d9b17bac427John Beck if [ -f $CLIENT_PID_FILE ]; then
da978630d1f0b07bd370e402117d4d9b17bac427John Beck # Need to kill the entire service contract to kill all sendmail related
da978630d1f0b07bd370e402117d4d9b17bac427John Beck # Sendmail can take its time responding to SIGTERM, as it waits for
da978630d1f0b07bd370e402117d4d9b17bac427John Beck # things like child processes and SMTP connections to clean up. If
da978630d1f0b07bd370e402117d4d9b17bac427John Beck # the contract did not empty after TERM, move on to KILL.
da978630d1f0b07bd370e402117d4d9b17bac427John Beck echo "Usage: $0 { start | stop | refresh }"