/usr/sbin/eximon is in eximon4 4.82-3ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | #!/bin/sh
# From OS/eximon.conf-Default
EXIMON_BINARY="/usr/lib/exim4/${EXIMON_BINARY-${0##*/}.bin}"
WINDOW_TITLE=${EXIMON_WINDOW_TITLE-'"${hostname} eximon"'}
ACTION_OUTPUT=${EXIMON_ACTION_OUTPUT-no}
ACTION_QUEUE_UPDATE=${EXIMON_ACTION_QUEUE_UPDATE-yes}
BODY_MAX=${EXIMON_BODY_MAX-20000}
LOG_DEPTH=${EXIMON_LOG_DEPTH-300}
LOG_WIDTH=${EXIMON_LOG_WIDTH-${EXIMON_WIDTH-950}}
LOG_BUFFER=${EXIMON_LOG_BUFFER-20K}
LOG_FONT=${EXIMON_LOG_FONT--misc-fixed-medium-r-normal-*-14-140-*-*-*-*-iso8859-1}
LOG_STRIPCHARTS='/ <= /in/
/ => /out/
/ => .+ R=local/local/
/ => .+ T=[^ ]*smtp/smtp/'
MENU_EVENT=${EXIMON_MENU_EVENT-'Shift<Btn1Down>'}
MIN_HEIGHT=${EXIMON_MIN_HEIGHT-162}
MIN_WIDTH=${EXIMON_MIN_WIDTH-103}
QUEUE_DEPTH=${EXIMON_QUEUE_DEPTH-200}
QUEUE_WIDTH=${EXIMON_QUEUE_WIDTH-${EXIMON_WIDTH-950}}
QUEUE_FONT=${EXIMON_QUEUE_FONT-${LOG_FONT}}
QUEUE_MAX_ADDRESSES=${EXIMON_QUEUE_MAX_ADDRESSES-10}
QUEUE_INTERVAL=${EXIMON_QUEUE_INTERVAL-300}
QUEUE_STRIPCHART_NAME=${EXIMON_QUEUE_STRIPCHART_NAME-queue}
SIZE_STRIPCHART=${EXIMON_SIZE_STRIPCHART}
SIZE_STRIPCHART_NAME=${EXIMON_SIZE_STRIPCHART_NAME}
START_SMALL=${EXIMON_START_SMALL-no}
STRIPCHART_INTERVAL=${EXIMON_STRIPCHART_INTERVAL-60}
TEXT_DEPTH=${EXIMON_TEXT_DEPTH-200}
# End of OS/eximon.conf-Default
# From Local/eximon.conf
# End of Local/eximon.conf
# Base source of start-up shell script for the Exim Monitor. Used to set the
# required environment variables before running the program. Using script
# rather than a configuration file means that computation can be done.
# The build process concatenates on the front of this various settings from
# os-specific files and from the user's configuration file.
# Copyright (c) 2004 - 2012 University of Cambridge.
# See the file NOTICE for conditions of use and distribution.
# Except when they appear in comments, the following placeholders in this
# source are replaced when it is turned into a runnable script:
#
# CONFIGURE_FILE_USE_NODE
# CONFIGURE_FILE
# BIN_DIRECTORY
# BASENAME_COMMAND
# HOSTNAME_COMMAND
# X11_LD_LIBRARY
# This file has been so processed.
# See if caller wants to invoke gdb
use_gdb=''
case ${1:-foo} in
gdb*) use_gdb="$1"; shift ;;
esac
# Save arguments (can be the usual X parameters)
cmd_args="$@"
# See if this installation is using the esoteric "USE_NODE" feature of Exim,
# in which it uses the host's name as a suffix for the configuration file name.
if [ "" = "yes" ]; then
hostsuffix=.`uname -n`
fi
# Now find the configuration file name. This has got complicated because
# CONFIGURE_FILE may now be a list of files. The one that is used is the first
# one that exists. Mimic the code in readconf.c by testing first for the
# suffixed file in each case.
set `awk -F: '{ for (i = 1; i <= NF; i++) print $i }' <<End
/etc/exim4/exim4.conf:/var/lib/exim4/config.autogenerated
End
`
while [ "$config" = "" -a $# -gt 0 ] ; do
if [ -f "$1$hostsuffix" ] ; then
config="$1$hostsuffix"
elif [ -f "$1" ] ; then
config="$1"
fi
shift
done
# Determine where the spool directory is and whether there is any setting of
# log_file_path. Search for an exim_path setting in the configure file;
# otherwise use the bin directory. Call that version of Exim to find the spool
# directory and the setting of log_file_path.
config=${EXIMON_EXIM_CONFIG-$config}
# Add code here to redefine "config" if an alternative configuration file
# should be used in some circumstances. If you do that, you should also arrange
# for the value to be set in EXIMON_EXIM_CONFIG, and to export that variable
# into the environment. BEWARE: a tab character is needed in the command below.
# It has had a nasty tendency to get lost in the past. Use a variable to hold a
# space and a tab to keep the tab in one place.
st=' '
EXIM_PATH=`grep "^[$st]*exim_path" $config | sed "s/.*=[$st]*//"`
if test "$EXIM_PATH" = ""; then EXIM_PATH=/usr/sbin/exim4; fi
SPOOL_DIRECTORY=`$EXIM_PATH -bP spool_directory | sed 's/.*=[ ]*//'`
LOG_FILE_PATH=`$EXIM_PATH -bP log_file_path | sed 's/.*=[ ]*//'`
# If log_file_path is "syslog" then logging is only to syslog, and the monitor
# is unable to display a log tail unless EXIMON_LOG_FILE_PATH is set to tell
# it where the log data is. Otherwise, remove any occurrences of
# "syslog:" or ":syslog" (spaces allowed in various places) and look at the
# remainder of the entry. If it's null, the default is "mainlog" in the
# "log" directory in the spool directory. Otherwise, set the name from the
# given path.
if [ "$EXIMON_LOG_FILE_PATH" != "" ] ; then
LOG_FILE_NAME="$EXIMON_LOG_FILE_PATH"
elif [ "$LOG_FILE_PATH" = "syslog" ] ; then
LOG_FILE_NAME=""
echo \*\*\*
echo Exim is using the syslog interface for its log data. If you redirect all
echo MAIL.INFO syslog messages into a separate file, you can point eximon at
echo that file with the EXIMON_LOG_FILE_PATH environment variable.
echo \*\*\*
else
LOG_FILE_NAME=`echo $LOG_FILE_PATH | \
sed -e 's/ *: *syslog *: */:/' \
-e 's/ *: *syslog *$//' \
-e 's/^ *syslog *: *//' \
-e 's/%s/main/'`
if [ "$LOG_FILE_NAME" = "" ] ; then
LOG_FILE_NAME=$SPOOL_DIRECTORY/log/mainlog
fi
fi
# The basename and hostname commands vary from system to system
basename=look_for_it
hostname=/bin/hostname
# SunOS5 is a pain in that they may be in one of two places. So is Linux
# in the case of basename. Set up a general mechanism for searching for
# them in several places.
if [ "${basename}" = "look_for_it" ] ; then
if [ -f /usr/bin/basename ] ; then
basename=/usr/bin/basename
else
if [ -f /bin/basename ] ; then
basename=/bin/basename
else
basename=/usr/ucb/basename
fi
fi
fi
if [ "${hostname}" = "look_for_it" ] ; then
if [ -f /usr/bin/hostname ] ; then
hostname=/usr/bin/hostname
else
if [ -f /bin/hostname ] ; then
hostname=/bin/hostname
else
hostname=/usr/ucb/hostname
fi
fi
fi
# Set hostname to the full hostname with the specified domain
# stripped off its end. On Solaris 2, the default basename
# command treats its suffix argument as a pattern. Consequently,
# if fullhostname contains no dots but ends with what looks like
# the domain, straightforward use of basename screws things up.
# Use a general test for this case, just in case any other OS
# do the same.
fullhostname=`${hostname}`
case `${basename} abc .c` in
a) hostname=`${basename} ${fullhostname} '\.'${DOMAIN}` ;;
*) hostname=`${basename} ${fullhostname} .${DOMAIN}` ;;
esac
# Arrange for the window title field to be substituted by the shell
# so that it can contain either the full or the short host name. This
# is a tedious little bit of magic, but I don't know how to do it
# in a less tortuous way.
WINDOW_TITLE=`fullhostname=${fullhostname} hostname=${hostname} /bin/sh <<xx
echo ${WINDOW_TITLE}
xx
`
# Add the X11 library to the library path, and then export the
# environment variables used by eximon. The string X11-LD-LIBRARY
# (with underscores, not hyphens) below is replaced by the configured
# library name when the script is built. (Hyphens are used in the description
# to stop it getting changed there too.)
X11LIB=/usr/X11R6/lib
if [ "${LD_LIBRARY_PATH}" = "" ] ; then
LD_LIBRARY_PATH=${X11LIB}
else
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${X11LIB}
fi
export EXIM_PATH LD_LIBRARY_PATH \
LOG_BUFFER LOG_DEPTH LOG_FILE_NAME LOG_FONT LOG_WIDTH \
ACTION_OUTPUT ACTION_QUEUE_UPDATE\
MENU_EVENT MIN_HEIGHT MIN_WIDTH \
QUALIFY_DOMAIN QUEUE_DEPTH QUEUE_FONT QUEUE_INTERVAL QUEUE_MAX_ADDRESSES \
QUEUE_STRIPCHART_NAME QUEUE_TOTAL QUEUE_WIDTH SPOOL_DIRECTORY \
START_DEPTH LOG_STRIPCHARTS SIZE_STRIPCHART SIZE_STRIPCHART_NAME \
START_SMALL STRIPCHART_INTERVAL \
TEXT_DEPTH WINDOW_TITLE
# Exec to the program we really want to run, thereby continuing in
# just the one process, and let it run in parallel with whatever
# called this script (unless gdb was requested in original $1).
if [ "${use_gdb:-}" = "" ] ; then
exec "${EXIMON_BINARY}" $cmd_args &
else
exec "$use_gdb" "${EXIMON_BINARY}" $cmd_args
# not backgrounded
fi
# End
|