Last change
on this file was
dd7f574,
checked in by Edwin Eefting <edwin@datux.nl>, 7 years ago
|
prevent empty config
|
-
Property mode set to
100755
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | if [ -e /etc/my.init ]; then |
---|
3 | INIT="--init-file=/etc/my.init" |
---|
4 | fi |
---|
5 | |
---|
6 | export TMPDIR=/home/system/tmp |
---|
7 | |
---|
8 | ### dynamicly configure bufferpool |
---|
9 | #max size of total mysqld=4Gb on 32 bits systems, but there is other stuff in mysqld that uses memory as well. 2200000k seems the maximum for our config on 32 bit |
---|
10 | MAX_POOL=1800000 |
---|
11 | |
---|
12 | #total system mem in KB |
---|
13 | MEM_KB=`cat /proc/meminfo | grep MemTotal | sed 's/[^0-9]//g'` |
---|
14 | |
---|
15 | #manual says: pool size 50% of memory, but we use 25% (zarafa also needs a lot) |
---|
16 | (( MEM_POOL = MEM_KB / 4 )) |
---|
17 | if [ "$MEM_POOL" -ge $MAX_POOL ]; then |
---|
18 | MEM_POOL=$MAX_POOL |
---|
19 | fi |
---|
20 | |
---|
21 | #make the config update atomic. (it happend more then once that during a crash/reset the config file ended up zero bytes ) |
---|
22 | cat /etc/my.cnf | sed "s/^innodb_buffer_pool_size.*/innodb_buffer_pool_size = "$MEM_POOL"K/g" > /etc/my.cnf.tmp |
---|
23 | sync |
---|
24 | mv /etc/my.cnf.tmp /etc/my.cnf |
---|
25 | |
---|
26 | cd / |
---|
27 | umask 077 |
---|
28 | exec mysqld --basedir=/usr --datadir=/home/system/mysql5 --user=mysql --log-error=/home/system/mysql5/mysql.err --pid-file=/home/system/mysql5/mysql.pid --socket=/var/run/mysql/mysql.sock --port=3306 $INIT |
---|
29 | |
---|
Note: See
TracBrowser
for help on using the repository browser.