committing changes in /etc made by "-bash"
Package changes:
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh -x
|
||||
##########################################################
|
||||
# Copyright (C) 2001-2018 VMware, Inc. All rights reserved.
|
||||
# Copyright (C) 2001-2018, 2021 VMware, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published
|
||||
@@ -26,31 +26,104 @@
|
||||
# of suspend and resume events, respectively.
|
||||
#
|
||||
|
||||
logbase=/var/log/vmware-network
|
||||
SOURCE=$0
|
||||
logdir=/var/log
|
||||
logbase=$logdir/vmware-network
|
||||
logfile=$logbase.log
|
||||
|
||||
# Defines logging mode enabled (1) or disabled (0)
|
||||
logmode=1
|
||||
|
||||
# Defines whether to rotate logs (1) or not (0)
|
||||
logrotate=1
|
||||
|
||||
#
|
||||
# Get log file path
|
||||
#
|
||||
get_logfile() {
|
||||
file=`vmware-toolbox-cmd config get logging network.data | \
|
||||
sed -e 's/.*= *//' -e 's/ *$//'`
|
||||
if [ -n "${file##*"UNSET"*}" ]; then
|
||||
logfile=$file
|
||||
logdir=`dirname $logfile`
|
||||
logbase=`echo $logfile | sed 's/\..*$//'`
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Get Network logging config
|
||||
#
|
||||
get_logconfig() {
|
||||
handler=`vmware-toolbox-cmd config get logging network.handler | \
|
||||
sed -e 's/.*= *//' -e 's/ *$//'`
|
||||
case $handler in
|
||||
"file")
|
||||
get_logfile
|
||||
;;
|
||||
"file+")
|
||||
get_logfile
|
||||
logrotate=0
|
||||
;;
|
||||
"vmx"|"std")
|
||||
logrotate=0
|
||||
;;
|
||||
"syslog")
|
||||
logfile=/var/log/syslog
|
||||
logdir=`dirname $logfile`
|
||||
logrotate=0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
#
|
||||
# Rotate any logs
|
||||
#
|
||||
rotate_logfile() {
|
||||
max=9
|
||||
max=`expr $max - 1`
|
||||
for s in `seq $max -1 1`; do
|
||||
d=`expr $s + 1`
|
||||
mv -f $logbase.$s.log $logbase.$d.log
|
||||
done
|
||||
mv -f $logbase.log $logbase.1.log
|
||||
if [ $logrotate -eq 1 ]; then
|
||||
max=`vmware-toolbox-cmd config get logging network.maxOldLogFiles | \
|
||||
sed -e 's/.*= *//' -e 's/ *$//'`
|
||||
if [ -z "${max##*"UNSET"*}" -o `expr "$max" : '[0-9]\+$'` -eq 0 ]; then
|
||||
max=9
|
||||
fi
|
||||
max=`expr $max - 1`
|
||||
for s in `seq $max -1 1`; do
|
||||
d=`expr $s + 1`
|
||||
mv -f $logbase.$s.log $logbase.$d.log
|
||||
done
|
||||
mv -f $logbase.log $logbase.1.log
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Logging api
|
||||
#
|
||||
log() {
|
||||
if [ $logmode -eq 1 ]; then
|
||||
if [ "$handler" = "vmx" ]; then
|
||||
`vmtoolsd --cmd "log $*"`
|
||||
elif [ "$handler" = "std" ]; then
|
||||
echo `date` ": $*"
|
||||
elif [ -w $logdir ]; then
|
||||
space=`df -k $logdir | awk 'NR == 2 { print $4 }'`
|
||||
if [ $space -gt 1024 ]; then
|
||||
echo `date` ": $*" >> $logfile
|
||||
else
|
||||
`vmtoolsd --cmd "log WARNING: [$SOURCE] Logging disabled. No space left in $logdir"`
|
||||
logmode=0
|
||||
fi
|
||||
else
|
||||
`vmtoolsd --cmd "log WARNING: [$SOURCE] Logging disabled. $logdir is not writable"`
|
||||
logmode=0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
get_logconfig
|
||||
rotate_logfile
|
||||
|
||||
# redirect stdio
|
||||
exec > $logfile 2>&1
|
||||
chmod 0600 $logfile
|
||||
|
||||
|
||||
echo `date` ": Executing '$0 $*'"
|
||||
echo
|
||||
log "Executing '$0 $*'"
|
||||
|
||||
. `dirname "$0"`/../../statechange.subr
|
||||
|
||||
@@ -96,7 +169,7 @@ find_networking_script() {
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$script"
|
||||
log "$script"
|
||||
}
|
||||
|
||||
|
||||
@@ -394,9 +467,9 @@ rescue_NIC()
|
||||
fi
|
||||
|
||||
if echo $intf_out | grep -q 'UP'; then
|
||||
echo `date` "[rescue_nic] $nic is already active."
|
||||
log "[rescue_nic] $nic is already active."
|
||||
else
|
||||
echo `date` "[rescue_nic] activating $nic ..."
|
||||
log "[rescue_nic] activating $nic ..."
|
||||
|
||||
# Our best effort to activate interfaces, use ifup if available
|
||||
# otherwise use the ip command as fallback.
|
||||
@@ -612,7 +685,7 @@ main() {
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "No argument supplied."
|
||||
log "No argument supplied."
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -620,4 +693,4 @@ main() {
|
||||
}
|
||||
|
||||
main "$@"
|
||||
echo `date` ": Finished '$0 $*'"
|
||||
log "Finished '$0 $*'"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2019-2020 VMware, Inc. All rights reserved.
|
||||
# Copyright (c) 2019-2021 VMware, Inc. All rights reserved.
|
||||
|
||||
# "CAUTION: tools.conf is highly syntax sensitive file. Use extreme caution
|
||||
# while editing it. If modified, it is automatically re-loaded by
|
||||
@@ -124,6 +124,24 @@
|
||||
#toolboxcmd.handler = file
|
||||
#toolboxcmd.data = c:/tmp/vmtoolboxcmd-${USER}.log
|
||||
|
||||
# With no explicit logging configuration for deployPkg, its default log path in
|
||||
# Linux is /var/log/vmware-imc/toolsDeployPkg.log, and in Windows is
|
||||
# %WINDIR%/Temp/vmware-imc/toolsDeployPkg.log
|
||||
# Set the following configuration if you want to redirect the deployPkg log to
|
||||
# any existing location other than the default.
|
||||
#deployPkg.level = debug
|
||||
#deployPkg.handler = file
|
||||
#deployPkg.data = c:/tmp/toolsDeployPkg-${USER}.log
|
||||
|
||||
# Redirecting the deployPkg log to the vmx log file. Please note that
|
||||
# "log = true" and the vmsvc log handler setting to vmx are also neccessary
|
||||
# if you want to redirect the deployPkg log to vmx.
|
||||
#log = true
|
||||
#vmsvc.level = debug
|
||||
#vmsvc.handler = vmx
|
||||
#deployPkg.level = debug
|
||||
#deployPkg.handler = vmx
|
||||
|
||||
# Enable old VMwareUser/vmware-user logging to file.
|
||||
#log.file = c:/tmp/vmtools.log
|
||||
|
||||
@@ -142,6 +160,16 @@
|
||||
# Default 4096, 0=> disable log caching
|
||||
#maxCacheEntries=4096
|
||||
|
||||
|
||||
# Set the following configurations for modifying network script logging file.
|
||||
# Only for Linux, Mac OS X, Solaris, and FreeBSD
|
||||
#network.handler = file
|
||||
#network.data = /tmp/network.log
|
||||
#network.maxOldLogFiles = 9
|
||||
|
||||
# Redirect network script logs to vmx
|
||||
#network.handler = vmx
|
||||
|
||||
[powerops]
|
||||
# Custom scripts for power operations
|
||||
# This can be an absolute path, or a path relative to the tools
|
||||
@@ -269,54 +297,66 @@
|
||||
|
||||
[vmbackup]
|
||||
|
||||
# enableSyncDriver is not available for Windows:
|
||||
# enableSyncDriver is Linux only.
|
||||
#enableSyncDriver=true
|
||||
|
||||
# enableVSS is Windows only:
|
||||
# enableVSS is Windows only.
|
||||
#enableVSS=true
|
||||
|
||||
# vss.disableAppQuiescing is Windows only.
|
||||
# This setting can be used to force file system quiescing on Windows systems
|
||||
# having problems with application quiescing.
|
||||
# See https://kb.vmware.com/s/article/2146204
|
||||
# can be used to fallback to FS quiescing forcely when there are app quiescing
|
||||
# problems for specific Windows systems
|
||||
#vss.disableAppQuiescing=false
|
||||
|
||||
#execScripts=true
|
||||
#scriptArg=
|
||||
|
||||
# Linux:
|
||||
# The value of excludedFileSystems is a comma-separated list of glob-style
|
||||
# patterns specifying the file systems to be excluded from quiesced snapshots.
|
||||
# The patterns may use '*' (wildcard) to represent any string of characters
|
||||
# and '?" (joker) to represent any single character. Note that the characters
|
||||
# represented by these patters, '*' and '?" may include any characters,
|
||||
# including '/'
|
||||
# patterns specifying the file system mount points to be excluded from
|
||||
# quiescing operation. The patterns may use '*' (wildcard) to represent
|
||||
# any string of characters and '?' (joker) to represent any single character.
|
||||
# The characters represented by the patterns '*' and '?' may include any
|
||||
# characters, including '/'.
|
||||
#
|
||||
# Windows:
|
||||
# The value of excludedFileSystems is a comma-separated list of mount points
|
||||
# specifying the volumes to be excluded from quiesced snapshots.
|
||||
# Each mount point must be a full path separated and ended with "\\".
|
||||
# to exclude volumes with drive letter E and mount point F:\mount\, set below
|
||||
# excludedFileSystems= E:\\,F:\\mount\\
|
||||
# This option only applies when app quiescing doesn't take effect.
|
||||
# For example, to exclude volumes with drive letter 'E' or mount point
|
||||
# "F:\mount\", use:
|
||||
# excludedFileSystems=E:\\,F:\\mount\\
|
||||
# This setting is ignored when application quiescing is used.
|
||||
|
||||
#excludedFileSystems=
|
||||
|
||||
# Whether to execute scripts on quiescing.
|
||||
# Scripts are executed from /etc/vmware-tools/backupScripts.d on Linux and
|
||||
# %installpath%\backupScripts.d on Windows, and the legacy scripts
|
||||
# "c:\windows\pre-freeze-script.bat"
|
||||
# "c:\windows\post-thaw-script.bat"
|
||||
# execScripts specifies whether to execute scripts as part of the quiescing
|
||||
# operation. Scripts are executed from the scripts directory along with the
|
||||
# legacy scripts.
|
||||
#
|
||||
# Linux:
|
||||
# "/usr/sbin/pre-freeze-script"
|
||||
# "/usr/sbin/post-thaw-script"
|
||||
# Scripts directory:
|
||||
# Linux: /etc/vmware-tools/backupScripts.d
|
||||
# Windows: <Install-Path>\backupScripts.d
|
||||
#
|
||||
# Scripts will be called with "freeze", "freezeFail" or "thaw" as their first
|
||||
# arguments.
|
||||
# Legacy scripts:
|
||||
# Linux: /usr/sbin/pre-freeze-script and /usr/sbin/post-thaw-script
|
||||
# Windows: C:\windows\pre-freeze-script.bat and C:\windows\post-thaw-script.bat
|
||||
#
|
||||
# On each quiescing operation, scripts are invoked before quiescing and
|
||||
# either after a quiescing failure or after thawing.
|
||||
# The first argument passed to each script is
|
||||
# "freeze", when invoked before quiescing;
|
||||
# "freezefail", when invoked after a quiescing failure; or
|
||||
# "thaw", when invoked after thawing.
|
||||
# When invoked before quiescing, scripts from the directory are invoked in
|
||||
# alphabetically ascending order; when invoked following a quiescing failure
|
||||
# or thawing, they are invoked in the reverse order. Any subdirectories are
|
||||
# ignored.
|
||||
# Note that the legacy pre-freeze-script is invoked only before quiescing as
|
||||
# the first script and post-thaw-script is invoked after a quiescing failure
|
||||
# as well as after thawing as the last script.
|
||||
|
||||
#execScripts=true
|
||||
|
||||
# additional argument to be passed to scripts
|
||||
# Additional argument to be passed to scripts
|
||||
#scriptArg=
|
||||
|
||||
[guestoperations]
|
||||
@@ -379,3 +419,10 @@
|
||||
# Default value is "vmtools" which points to the latest version of
|
||||
# VMware Tools package in the GuestStore.
|
||||
#vmtools-version-key=vmtools
|
||||
|
||||
[devicehelper]
|
||||
|
||||
# The deviceHelper plugin is only available for Windows.
|
||||
|
||||
# Set to true to disable the deviceHelper plugin.
|
||||
#disabled=false
|
||||
|
||||
Reference in New Issue
Block a user