-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathsysctl_script.sh
More file actions
executable file
·52 lines (47 loc) · 1.73 KB
/
sysctl_script.sh
File metadata and controls
executable file
·52 lines (47 loc) · 1.73 KB
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
#!/usr/bin/env bash
# Author: Robert Martin, Ohio University
# Checks sysctl variable vaues on OSX to see if they are large enough
# to handle the shared memory requirements for ION
case $OSTYPE in
*darwin*)
VAR_LIST=('kern.sysv.shmmax' 'kern.sysv.shmmin' 'kern.sysv.shmmni'
'kern.sysv.shmseg' 'kern.sysv.shmall' 'net.inet.udp.maxdgram'
'kern.sysv.semmns' 'kern.sysv.semmni' 'net.inet.udp.recvspace')
;;
*freebsd*)
VAR_LIST=('kern.ipc.shmmax' 'kern.ipc.shmmin' 'kern.ipc.shmmni'
'kern.ipc.shmseg' 'kern.ipc.shmall' 'net.inet.udp.maxdgram'
'kern.ipc.semmns' 'kern.ipc.semmni' 'net.inet.udp.recvspace')
;;
*)
echo "No need to update sysctl variables."
exit 0
;;
esac
VAR_VALUE=(2147483648 1 32 32 1048576 65536 32000 128 168320)
CUR_VALUE=0
I=0
CHANGE=0
while [[ $I -lt ${#VAR_LIST[@]} ]]; do
CUR_VALUE=`sysctl ${VAR_LIST[$I]} | awk '{ print $2 }'`
if [[ $CUR_VALUE -lt ${VAR_VALUE[$I]} ]]; then
echo "${VAR_LIST[$I]}=${VAR_VALUE[I]}"
let CHANGE=1
fi
let I=$I+1
done
if [[ $CHANGE == 0 ]]; then
echo "This system is ready to run ION."
else
echo
echo "Your system's sysctl configuration needs be updated in order to"
echo "run ION. This is usually done by copying the above assignments into"
echo "/etc/sysctl.conf or /boot/loader.conf and rebooting."
echo ""
echo "If you are running macOS, use the install_macos_sysctl.sh script"
echo ""
echo "If you are running FreeBSD, shmmni, shmseg, shmmns, and semmni should"
echo " be updated through /boot/loader.conf; The other"
echo " parameters can be updated using sysctl command or via /etc/sysctl.conf."
exit 1
fi