Bookmark this entry:
_ Debian で sysctl のソースが見たくなったら、どうするのか。
まずは、sysctl がどのパッケージに属しているのか確認します。
dpkg -S sysctl | grep bin
dpkg -S の出力は、属するパッケージ名と、パス付きファイル名であるので、求めている sysctl はコマンドなんで、grep で bin を指定してみた。これだと、/bin /sbin /usr/bin /usr/sbin などがカバーできるし。
dpkg -S sysctl | grep bin
procps: /sbin/sysctl
結果により、procps パッケージに属していることがわかったので、apt-get source procsps して、ソースを取得する。下記のような感じ。
yabuki@Ernalda:~/src/deb-package/procps$ apt-get source procps
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了
331kB のソースアーカイブを取得する必要があります。
取得:1 http://ftp.debian.org unstable/main procps 1:3.2.7-9 (dsc) [986B]
取得:2 http://ftp.debian.org unstable/main procps 1:3.2.7-9 (tar) [282kB]
取得:3 http://ftp.debian.org unstable/main procps 1:3.2.7-9 (diff) [47.8kB]
331kB を 2s で取得しました (158kB/s)
dpkg-source: extracting procps in procps-3.2.7
dpkg-source: unpacking procps_3.2.7.orig.tar.gz
dpkg-source: applying ./procps_3.2.7-9.diff.gz
すると、
yabuki@Ernalda:~/src/deb-package/procps$ ls -la
合計 344
drwxr-sr-x 3 yabuki yabuki 4096 2008-08-21 10:16 .
drwxr-sr-x 36 yabuki yabuki 4096 2008-08-21 10:16 ..
drwxr-xr-x 5 yabuki yabuki 4096 2008-08-21 10:16 procps-3.2.7
-rw-r--r-- 1 yabuki yabuki 47775 2008-08-10 11:02 procps_3.2.7-9.diff.gz
-rw-r--r-- 1 yabuki yabuki 986 2008-08-10 11:02 procps_3.2.7-9.dsc
-rw-r--r-- 1 yabuki yabuki 281965 2006-06-27 08:17 procps_3.2.7.orig.tar.gz
な状態になっているので、cd procps-3.2.7 してから、ls すると、
yabuki@Ernalda:~/src/deb-package/procps/procps-3.2.7$ ls
AUTHORS dummy.c procps.lsm sysctl.c v
BUGS free.1 procps.spec sysctl.conf vmstat.8
COPYING free.c ps sysctl.conf.5 vmstat.c
COPYING.LIB kill.1 pwdx.1 t w.1
CodingStyle minimal.c pwdx.c tload.1 w.c
Makefile pgrep.1 skill.1 tload.c watch.1
NEWS pgrep.c skill.c top.1 watch.c
README pkill.1 slabtop.1 top.c
README.top pmap.1 slabtop.c top.h
TODO pmap.c snice.1 uptime.1
debian proc sysctl.8 uptime.c
ってな感じ。目的の sysctl.c を発見しました。
Bookmark this entry:
_ monit
本家は、
(http://www.tildeslash.com/monit/) Barking at daemons というフレーズから、犬のイメージは番犬くんからか。良いイメージ戦略ですね。Web の 方は、ありがたいことに日本語で読める。
(http://packages.debian.org/ja/etch/monit) 以下は、etch で monit の情報を取得した結果である。
$ apt-cache show monit
Package: monit
Priority: optional
Section: admin
Installed-Size: 664
Maintainer: Stefan Alfredsson < alfs@debian.org >
Architecture: i386
Version: 1:4.8.1-2.1
Depends: libc6 (>= 2.3.6-6), libssl0.9.8 (>= 0.9.8c-1)
Filename: pool/main/m/monit/monit_4.8.1-2.1_i386.deb
Size: 254726
MD5sum: 626ad3e4922d6aaafa3e9d875fed652a
SHA1: 46d5774046246ffb67364f6d4e909e2ad624775a
SHA256: 950a9e4f89a7365928bf05b7b474ef240eed8f12604aae422819a5dafc7c8d76
Description: A utility for monitoring and managing daemons or similar programs
monit is a utility for monitoring and managing daemons or similar
programs running on a Unix system. It will start specified programs
if they are not running and restart programs not responding.
.
monit supports:
* Daemon mode - poll programs at a specified interval
* Monitoring modes - active, passive or manual
* Start, stop and restart of programs
* Group and manage groups of programs
* Process dependency definition
* Logging to syslog or own logfile
* Configuration - comprehensive controlfile
* Runtime and TCP/IP port checking (tcp and udp)
* SSL support for port checking
* Unix domain socket checking
* Process status and process timeout
* Process cpu usage
* Process memory usage
* Process zombie check
* Check the systems load average
* Check a file or directory timestamp
* Alert, stop or restart a process based on its characteristics
* MD5 checksum for programs started and stopped by monit
* Alert notification for program timeout, restart, checksum, stop
resource and timestamp error
* Flexible and customizable email alert messages
* Protocol verification. HTTP, FTP, SMTP, POP, IMAP, NNTP, SSH, DWP,
LDAPv2 and LDAPv3
* An http interface with optional SSL support to make monit
accessible from a webbrowser
Tag: admin::monitoring, interface::daemon, network::hiavailability, network::server, role::program, use::monitor , works-with::software:running
apt-get install dlocate<br>dlocate bin/sysctl<br>(ぼそ
別解で、apt-file search や、auto-aptもいかがというフィードバックは別の場所でもらいました。<br><br>dpkg -S bin/sysctl の良い所は、かならず入っていて、追加でインストールするところですが、毎回ファイルをなめにいくので遅い。locate系はdbに入っているから答えを得るのが早いのが利点ですよね。