]>
Commit | Line | Data |
---|---|---|
b30cd7ee KZ |
1 | #!/bin/bash |
2 | ||
92f2c23e KZ |
3 | # |
4 | # Copyright (C) 2007 Karel Zak <kzak@redhat.com> | |
5 | # | |
601d12fb | 6 | # This file is part of util-linux. |
92f2c23e KZ |
7 | # |
8 | # This file is free software; you can redistribute it and/or modify | |
9 | # it under the terms of the GNU General Public License as published by | |
10 | # the Free Software Foundation; either version 2 of the License, or | |
11 | # (at your option) any later version. | |
12 | # | |
13 | # This file is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | # GNU General Public License for more details. | |
17 | # | |
b30cd7ee | 18 | |
e130ce53 | 19 | TS_TOPDIR="${0%/*}/../.." |
b30cd7ee KZ |
20 | TS_DESC="limits overflow" |
21 | ||
1016b53f | 22 | . $TS_TOPDIR/functions.sh |
1d9acab1 | 23 | ts_init "$*" |
2f791546 SK |
24 | |
25 | ts_check_test_command "$TS_CMD_IPCS" | |
19e00ec9 | 26 | ts_check_test_command "$TS_HELPER_SYSINFO" |
2f791546 | 27 | |
f0b561b6 | 28 | ts_skip_nonroot |
12826d4c | 29 | ts_check_prog "bc" |
1016b53f | 30 | |
d42bbae5 | 31 | . $TS_SELF/functions.sh |
b30cd7ee | 32 | |
a2db0b1a RM |
33 | ts_lock "ipcslimits" |
34 | ||
57a917d6 KZ |
35 | ts_log "load original values" |
36 | for i in $IPCS_IDX; do | |
37 | SHM_ORG[$i]=$(cat ${IPCS_PROCFILES[$i]}) | |
38 | done >> $TS_OUTPUT | |
1d9acab1 | 39 | |
9e930041 | 40 | ts_log "maximize kernel setting" |
57a917d6 KZ |
41 | for i in $IPCS_IDX; do |
42 | echo ${IPCS_LIMITS[$i]} >> ${IPCS_PROCFILES[$i]} | |
43 | done >> $TS_OUTPUT | |
b30cd7ee | 44 | |
7ef338f3 | 45 | ts_log "check for difference between kernel and IPC" |
57a917d6 | 46 | ipcs_limits_check >> $TS_OUTPUT |
b30cd7ee | 47 | |
57a917d6 KZ |
48 | ts_log "write original values to kernel" |
49 | for i in $IPCS_IDX; do | |
50 | echo ${SHM_ORG[$i]} >> ${IPCS_PROCFILES[$i]} | |
51 | done >> $TS_OUTPUT | |
b30cd7ee KZ |
52 | |
53 | ts_finalize | |
54 |