3649N/A# The contents of this file are subject to the terms of the 3649N/A# Common Development and Distribution License (the "License"). 3649N/A# You may not use this file except in compliance with the License. 3649N/A# See the License for the specific language governing permissions 3649N/A# and limitations under the License. 3649N/A# When distributing Covered Code, include this CDDL HEADER in each 3649N/A# If applicable, add the following below this CDDL HEADER, with the 3649N/A# fields enclosed by brackets "[]" replaced with your own identifying 3649N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3649N/A# Copyright (c) 1991, 2013, Oracle and/or its affiliates. All rights reserved. 3649N/A # Need to upgrade Berkeley DB version 3649N/A # Part 1: blow away aliases DB files; we will recreate them 3649N/A # Part 2: keyed maps are handled further below. 3649N/A # * MODE should be "-bd" or null (MODE= or MODE="") or 3649N/A # left alone. Anything else and you're on your own. 3649N/A # * QUEUEOPTION should be "p" or null (as above). 3649N/A # * QUEUEINTERVAL should be set to some legal value; 3649N/A # sanity checks are done below. 3649N/A # * OPTIONS are catch-alls; set with care. 3649N/A # Find the Keyed map lines, extract the arguments, run 3649N/A # makemap to create the maps with the upgraded DB version. 3649N/A $1 ~ /^K/ && $2 ~ /^(hash|btree|dbm)$/ { 3649N/A echo "Failed to update keyed map files." 3649N/A echo "Run makemap manually." 3649N/A # Finally, update the service property. 3649N/A # We refresh the service to get the above property setting 3649N/A # into the running snapshot. This will result in SMF 3649N/A # invoking this script with $1 set to "refresh" immediately 3649N/A # upon completion of this "start" invocation. But since 3649N/A # sendmail sets up its SIGHUP handler before it writes 3649N/A # its PID file, this should be OK: either the PID file 3649N/A # will not yet exist, in which case, the "refresh" will 3649N/A # do nothing (beyond getting the property setting into the 3649N/A # running snapshot), or the PID file will exist, in which 3649N/A # case the SIGHUP handler will have already been set up, 3649N/A # and sendmail will catch the SIGHUP and re-exec itself. 3649N/A # ETRN_HOSTS should be of the form 3649N/A # "s1:c1.1,c1.2 s2:c2.1 s3:c3.1,c3.2,c3.3" 3649N/A # i.e., white-space separated groups of server:client where 3649N/A # client can be one or more comma-separated names; N.B. that 3649N/A # the :client part is optional; see etrn(1M) for details. 3649N/A # server is the name of the server to prod; a mail queue run 3649N/A # is requested for each client name. This is comparable to 3649N/A # See RFC 1985 for more information. 3649N/A # Need to kill the entire service contract to kill all sendmail related 3649N/A # Since sendmail spawns user processes out of .forward files, it is 3649N/A # possible that some of these are not responding to TERM. If the 3649N/A # contract did not empty after TERM, move on to KILL. 3649N/A echo "Usage: $0 { start | stop | refresh }"