CentOS/makewhatis,updatedbが起動しないようにする
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* makewhatis,updatedbが起動しないようにする [#l3045ae1]
マシンを立ち上げるといきなりCPU使用率が高く、topコマンド...
本資料はCentOSにてmakewhatisでCPU使用率が高い状態になった...
#contents
top - 16:27:11 up 1:21, 1 user, load average: 1.65, 1...
Tasks: 94 total, 2 running, 92 sleeping, 0 stopped...
Cpu(s): 5.2%us, 11.7%sy, 3.4%ni, 64.4%id, 8.6%wa, 0....
Mem: 251636k total, 246740k used, 4896k free, ...
Swap: 1048568k total, 100k used, 1048468k free, ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TI...
3901 root 39 19 64224 1544 1000 S 9.9 0.6 0:5...
125 root 10 -5 0 0 0 S 2.0 0.0 0:0...
1 root 18 0 10372 696 584 S 0.0 0.3 0:0...
<snip>
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* makewhatisとは? [#o4fe1123]
makewhatisはwhatisデータベースを生成するために動作します。~
以下、man whatisをした時の抜粋です。
WHATIS(1) Manual pager utils...
名前
whatis - マニュアルページの要約を表示する
書式
[-dhV] [-r|-w] [-m system[,...]] [-M path] name ...
説明
それぞれのマニュアルページには、先頭に短い要約文...
whatis はマニュアルページの名前を検索し、name
にマッチしたすべてのマニュアルから、この要約文を...
<snip>
* makewhatisはどこで起動されているのか? [#ob587a0d]
makewhatis.cronがmakewhatisを起動していました。
以下、/etc/crontabの設定です。
[root@centos ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
makewhatis.cronは以下の2つが存在していました。
[root@centos ~]# cat /etc/cron.weekly/makewhatis.cron
#!/bin/bash
LOCKFILE=/var/lock/makewhatis.lock
# the lockfile is not meant to be perfect, it's just in ...
# two makewhatis cron scripts get run close to each othe...
# them from stepping on each other's toes. The worst th...
# happen is that they will temporarily corrupt the datab...
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE; exit 255; }" EXIT
touch $LOCKFILE
makewhatis -w
exit 0
[root@centos ~]# cat /etc/cron.daily/makewhatis.cron
#!/bin/bash
LOCKFILE=/var/lock/makewhatis.lock
# the lockfile is not meant to be perfect, it's just in ...
# two makewhatis cron scripts get run close to each othe...
# them from stepping on each other's toes. The worst th...
# happen is that they will temporarily corrupt the datab...
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
touch $LOCKFILE
makewhatis -u -w
exit 0
* makewhatis.cronを起動しないようにする [#w1609f33]
対処方法として、以下のcronファイルのパーミッションを644に...
chmod 644 /etc/cron.daily/makewhatis.cron
chmod 644 /etc/cron.weekly/makewhatis.cron
* mlocate.cronも停止 [#jd80c639]
locateコマンド用のデータベース更新を行うmlocate.cronも停...
(updatedbコマンドによりlocateコマンド用のデータベースを更...
locateコマンドのためにupdatedbコマンドを実行している
[root@centos ~]# cat /etc/cron.daily/mlocate.cron
#!/bin/sh
nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print ...
renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "$nodevs"
makewhatis.cronと同様にパーミッションを644にして停止させ...
chmod 644 /etc/cron.daily/mlocate.cron
* まとめ [#t61ed21f]
makewhatis, updatedbが起動し、CPU使用率が上がったままにな...
何らかの性能測定を行うサーバだったり、makewhatis, updated...
#br
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
終了行:
#navi(../)
* makewhatis,updatedbが起動しないようにする [#l3045ae1]
マシンを立ち上げるといきなりCPU使用率が高く、topコマンド...
本資料はCentOSにてmakewhatisでCPU使用率が高い状態になった...
#contents
top - 16:27:11 up 1:21, 1 user, load average: 1.65, 1...
Tasks: 94 total, 2 running, 92 sleeping, 0 stopped...
Cpu(s): 5.2%us, 11.7%sy, 3.4%ni, 64.4%id, 8.6%wa, 0....
Mem: 251636k total, 246740k used, 4896k free, ...
Swap: 1048568k total, 100k used, 1048468k free, ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TI...
3901 root 39 19 64224 1544 1000 S 9.9 0.6 0:5...
125 root 10 -5 0 0 0 S 2.0 0.0 0:0...
1 root 18 0 10372 696 584 S 0.0 0.3 0:0...
<snip>
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* makewhatisとは? [#o4fe1123]
makewhatisはwhatisデータベースを生成するために動作します。~
以下、man whatisをした時の抜粋です。
WHATIS(1) Manual pager utils...
名前
whatis - マニュアルページの要約を表示する
書式
[-dhV] [-r|-w] [-m system[,...]] [-M path] name ...
説明
それぞれのマニュアルページには、先頭に短い要約文...
whatis はマニュアルページの名前を検索し、name
にマッチしたすべてのマニュアルから、この要約文を...
<snip>
* makewhatisはどこで起動されているのか? [#ob587a0d]
makewhatis.cronがmakewhatisを起動していました。
以下、/etc/crontabの設定です。
[root@centos ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
makewhatis.cronは以下の2つが存在していました。
[root@centos ~]# cat /etc/cron.weekly/makewhatis.cron
#!/bin/bash
LOCKFILE=/var/lock/makewhatis.lock
# the lockfile is not meant to be perfect, it's just in ...
# two makewhatis cron scripts get run close to each othe...
# them from stepping on each other's toes. The worst th...
# happen is that they will temporarily corrupt the datab...
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE; exit 255; }" EXIT
touch $LOCKFILE
makewhatis -w
exit 0
[root@centos ~]# cat /etc/cron.daily/makewhatis.cron
#!/bin/bash
LOCKFILE=/var/lock/makewhatis.lock
# the lockfile is not meant to be perfect, it's just in ...
# two makewhatis cron scripts get run close to each othe...
# them from stepping on each other's toes. The worst th...
# happen is that they will temporarily corrupt the datab...
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
touch $LOCKFILE
makewhatis -u -w
exit 0
* makewhatis.cronを起動しないようにする [#w1609f33]
対処方法として、以下のcronファイルのパーミッションを644に...
chmod 644 /etc/cron.daily/makewhatis.cron
chmod 644 /etc/cron.weekly/makewhatis.cron
* mlocate.cronも停止 [#jd80c639]
locateコマンド用のデータベース更新を行うmlocate.cronも停...
(updatedbコマンドによりlocateコマンド用のデータベースを更...
locateコマンドのためにupdatedbコマンドを実行している
[root@centos ~]# cat /etc/cron.daily/mlocate.cron
#!/bin/sh
nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print ...
renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "$nodevs"
makewhatis.cronと同様にパーミッションを644にして停止させ...
chmod 644 /etc/cron.daily/mlocate.cron
* まとめ [#t61ed21f]
makewhatis, updatedbが起動し、CPU使用率が上がったままにな...
何らかの性能測定を行うサーバだったり、makewhatis, updated...
#br
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
ページ名: