scripts/maglev in rvm-1.0.6 vs scripts/maglev in rvm-1.0.7
- old
+ new
@@ -10,11 +10,11 @@
# Check we're on a suitable 64-bit machine
case "$system" in
Linux)
if [[ "$(uname -sm)" != "Linux x86_64" ]]; then
- "$rvm_scripts_path/log" "error" "This script only works on a 64-bit Linux OS."
+ "$rvm_path/scripts/log" "error" "This script only works on a 64-bit Linux OS."
echo "The result from \"uname -sm\" is \"`uname -sm`\" not \"Linux x86_64\""
exit 1
fi
;;
Darwin)
@@ -24,47 +24,47 @@
CPU_TYPE="$(uname -p)"
CPU_CAPABLE="$(sysctl hw.cpu64bit_capable | cut -f2 -d' ')"
#
# Check the CPU and Mac OS profile.
if [[ $CPU_TYPE != "i386" || $CPU_CAPABLE -ne 1 || $MAJOR -lt 10 || $MINOR -lt 5 ]] ; then
- "$rvm_scripts_path/log" "error" "This script requires Mac OS 10.5 or later on a 64-bit Intel CPU."
+ "$rvm_path/scripts/log" "error" "This script requires Mac OS 10.5 or later on a 64-bit Intel CPU."
exit 1
fi
;;
Solaris-x86)
if [[ "$(uname -sm)" != "SunOS i86pc" ]]; then
- "$rvm_scripts_path/log" "error" "This script only works on a 64-bit Solaris-x86 OS."
+ "$rvm_path/scripts/log" "error" "This script only works on a 64-bit Solaris-x86 OS."
echo "The result from \"uname -sm\" is \"`uname -sm`\" not \"SunOS i86pc\""
exit 1
fi
;;
*)
- "$rvm_scripts_path/log" "error" "This script only works on a 64-bit Linux, Mac OS X, or Solaris-x86 machine"
+ "$rvm_path/scripts/log" "error" "This script only works on a 64-bit Linux, Mac OS X, or Solaris-x86 machine"
echo "The result from \"uname -sm\" is \"`uname -sm`\""
exit 1
;;
esac
# We should run this as a normal user, not root.
if [[ `id | cut -f2 -d= | cut -f1 -d\(` -eq 0 ]]; then
- "$rvm_scripts_path/log" "error" "This script should be run as a normal user, not root."
+ "$rvm_path/scripts/log" "error" "This script should be run as a normal user, not root."
exit 1
fi
# Check that the current directory is writable
if [[ ! -w "." ]]; then
- "$rvm_scripts_path/log" "error" "This script requires write permission on your current directory."
+ "$rvm_path/scripts/log" "error" "This script requires write permission on your current directory."
\ls -ld $PWD
exit 1
fi
# We're good to go. Let user know.
machine_name="`uname -n`"
-"$rvm_scripts_path/log" "info" "Starting installation of $version on $machine_name"
+"$rvm_path/scripts/log" "info" "Starting installation of $version on $machine_name"
# Figure out how much total memory is installed
-"$rvm_scripts_path/log" "info" "Setting up shared memory"
+"$rvm_path/scripts/log" "info" "Setting up shared memory"
#
# Ref: http://wiki.finkproject.org/index.php/Shared_Memory_Regions_on_Darwin
# Ref: http://developer.postgresql.org/pgdocs/postgres/kernel-resources.html
# Ref: http://www.idevelopment.info/data/Oracle/DBA_tips/Linux/LINUX_8.shtml
#
@@ -92,11 +92,11 @@
totalMem=$(($totalMemMB * 1048576))
shmmax=$(($totalMem / 4))
shmall=$(($shmmax / 4096))
;;
*)
- "$rvm_scripts_path/log" "error" "Can't determine operating system. Check script."
+ "$rvm_path/scripts/log" "error" "Can't determine operating system. Check script."
exit 1
;;
esac
totalMemMB=$(($totalMem / 1048576))
shmmaxMB=$(($shmmax / 1048576))
@@ -122,26 +122,26 @@
[[ $shmallNew -lt $shmall ]] && shmallNew=$shmall
shmallNewMB=$(($shmallNew / 256))
# Increase shmmax if appropriate
if [[ $shmmaxNew -gt $shmmax ]]; then
- "$rvm_scripts_path/log" "info" "Increasing max shared memory segment size to $shmmaxNewMB MB"
+ "$rvm_path/scripts/log" "info" "Increasing max shared memory segment size to $shmmaxNewMB MB"
[[ $system = "Darwin" ]] && sudo sysctl -w kern.sysv.shmmax=$shmmaxNew
[[ $system = "Linux" ]] && sudo bash -c "echo $shmmaxNew > /proc/sys/kernel/shmmax"
[[ $system = "Solaris-x86" ]] && echo "[[Warning]] shmmax must be set manually on Solaris-x86"
else
- "$rvm_scripts_path/log" "info" "No need to increase max shared memory segment size"
+ "$rvm_path/scripts/log" "info" "No need to increase max shared memory segment size"
fi
# Increase shmall if appropriate
if [[ $shmallNew -gt $shmall ]]; then
- "$rvm_scripts_path/log" "info" "Increasing max shared memory allowed to $shmallNewMB MB"
+ "$rvm_path/scripts/log" "info" "Increasing max shared memory allowed to $shmallNewMB MB"
[[ $system = "Darwin" ]] && sudo sysctl -w kern.sysv.shmall=$shmallNew
[[ $system = "Linux" ]] && sudo bash -c "echo $shmallNew > /proc/sys/kernel/shmall"
[[ $system = "Solaris-x86" ]] && echo "[[Warning]]shmall must be set manually on Solaris-x86"
else
- "$rvm_scripts_path/log" "info" "No need to increase max shared memory allowed"
+ "$rvm_path/scripts/log" "info" "No need to increase max shared memory allowed"
fi
# At this point, shared memory settings contain the values we want,
# put them in sysctl.conf so they are preserved.
if [[ ! -f /etc/sysctl.conf ]] || [[ "$(\grep -sc "kern.*.shm" /etc/sysctl.conf)" -eq 0 ]] ; then
@@ -161,33 +161,33 @@
Solaris-x86)
# Do nothing in Solaris-x86 since /etc/sysctl.conf is ignored on Solaris 10.
# Must configure shared memory settings manually.
;;
*)
- "$rvm_scripts_path/log" "error" "Can't determine operating system. Check script."
+ "$rvm_path/scripts/log" "error" "Can't determine operating system. Check script."
exit 1
;;
esac
# Do nothing on Solaris-x86 since /etc/sysctl.conf is ignored on Solaris 10.
if [[ "$system" != "Solaris-x86" ]]; then
- "$rvm_scripts_path/log" "info" "Adding the following section to /etc/sysctl.conf"
+ "$rvm_path/scripts/log" "info" "Adding the following section to /etc/sysctl.conf"
cat /tmp/sysctl.conf.$$
sudo bash -c "cat /tmp/sysctl.conf.$$ >> /etc/sysctl.conf"
/bin/rm -f /tmp/sysctl.conf.$$
fi
else
- "$rvm_scripts_path/log" "info" "The following shared memory settings already exist in /etc/sysctl.conf"
+ "$rvm_path/scripts/log" "info" "The following shared memory settings already exist in /etc/sysctl.conf"
echo "To change them, remove the following lines from /etc/sysctl.conf and rerun this script"
\grep "kern.*.shm" /etc/sysctl.conf
fi
# Now setup for NetLDI in case we ever need it.
-"$rvm_scripts_path/log" "info" "Setting up GemStone netldi service port"
+"$rvm_path/scripts/log" "info" "Setting up GemStone netldi service port"
if [[ $(\grep -sc "^gs64ldi" /etc/services) -eq 0 ]]; then
echo '[[Info]] Adding "gs64ldi 50378/tcp" to /etc/services'
sudo bash -c 'echo "gs64ldi 50378/tcp # Gemstone netldi" >> /etc/services'
else
- "$rvm_scripts_path/log" "info" "GemStone netldi service port is already set in /etc/services"
+ "$rvm_path/scripts/log" "info" "GemStone netldi service port is already set in /etc/services"
echo "To change it, remove the following line from /etc/services and rerun this script"
\grep "^gs64ldi" /etc/services
fi