哪位大大来看看。。

软件和网站开发以及相关技术探讨
回复
xytcl
帖子: 2
注册时间: 2008-11-23 13:26
送出感谢: 0
接收感谢: 0

哪位大大来看看。。

#1

帖子 xytcl » 2008-11-25 14:51

#!/bin/sh

# max open files 犬牢
echo '*----- checking... max open files'

echo ""

# include/linux/fs.h 狼 NR_OPEN, INR_OPEN 犬牢
echo "===== Check fs.h File ====="
if [ -f /usr/src/linux/include/linux/fs.h ]; then
grep 'define NR_OPEN' /usr/src/linux/include/linux/fs.h \
| awk '{ nr_open = $3; if(nr_open != "(4096*4096)") { print "fs.h!!"; exit 1;} }'
if [ $? != 0 ]; then
exit 1;
fi
grep 'define INR_OPEN' /usr/src/linux/include/linux/fs.h \
| awk '{ inr_open = $3; if(inr_open != 4096) { print "fs.h !!"; exit 1; }}'
if [ $? != 0 ]; then
exit 1;
fi
else
echo "/usr/src/linux/include/linux/fs.h 颇老捞 绝嚼聪促"
exit 1
fi
echo "fs.h ok!"
echo ""

# include/linux/limits.h NR_OPEN, OPEN_MAX 犬牢
echo "===== Check limits.h File ====="
if [ -f /usr/src/linux/include/linux/limits.h ]; then
grep 'define NR_OPEN' /usr/src/linux/include/linux/limits.h \
| awk '{ nr_open = $3; if(nr_open != 4096) { print "limits.h!!"; exit 1; }}'
if [ $? != 0 ]; then
exit 1;
fi
grep 'define OPEN_MAX' /usr/src/linux/include/linux/limits.h \
| awk '{ open_max = $3; if(open_max != 4096) { print "limits.h!!"; exit 1; }}'
if [ $? != 0 ]; then
exit 1;
fi
else
echo "/usr/src/linux/include/linux/limits.h 颇老捞 绝嚼聪促"
exit 1
fi
echo "limits.h ok!"
echo ""

# include/linux/posix_types.h 狼 FD_SETSIZE 犬牢
echo "===== Check posix_types.h File ====="
if [ -f /usr/src/linux/include/linux/posix_types.h ]; then
grep 'define __FD_SETSIZE' /usr/src/linux/include/linux/posix_types.h \
| awk '{ fd_setsize = $3; if(fd_setsize != 4096) { print "posix_types.h!!"; exit 1 }}'
if [ $? != 0 ]; then
exit 1;
fi
else
echo "/usr/src/linux/include/linux/posix_types.h 颇老捞 绝嚼聪促"
exit 1
fi
echo "posix_types.h ok!"
echo ""

# /usr/include/bits/types.h 狼 FD_SETSIZE 犬牢
echo "===== Check types.h File ====="
if [ -f /usr/include/bits/types.h ]; then
grep 'define __FD_SETSIZE' /usr/include/bits/types.h \
| awk '{ fd_setsize = $3; if(fd_setsize != 4096) { print "types.h!!"; exit 1 }}'
if [ $? != 0 ]; then
exit 1;
fi
else
echo "/usr/include/bits/types.h 颇老捞 绝嚼聪促"
exit 1
fi
echo "types.h ok!"
echo ""

# 犬牢 累诀 ~_~
ulimit -n | awk '{max_open_files = $0; if(max_open_files == 4096) { print "Max Open Files check ok!" } else { print "Oops!! 囗囗囗囗!"; exit 1}}'
if [ $? != 0 ]; then
exit 1;
fi
echo ""
echo "--------------------------------"

这段SHELL是什么意思额? :em06
回复

回到 “软件/网站开发”