2013-08-01 95 views
0

當我安裝elasticsearch debian軟件包時,文件被複制到我的系統中的各個文件夾中,並啓動elasticsearch服務器。安裝.deb時運行什麼代碼?

這是怎麼發生的? .deb包內的哪些文件包含所有這些安裝信息?

當我查看了包,我看到了以下文件:

➜ downloads dpkg-deb -c elasticsearch-0.90.2.deb 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/ 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/ 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/elasticsearch/ 
-rw-r--r-- root/root  165 2013-06-26 08:56 ./usr/share/elasticsearch/NOTICE.txt 
-rw-r--r-- root/root  7942 2013-06-26 08:56 ./usr/share/elasticsearch/README.textile 
-rw-r--r-- root/root  2031 2013-06-26 08:56 ./usr/share/elasticsearch/core-signatures.txt 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/elasticsearch/bin/ 
-rwxr-xr-x root/root  5511 2013-06-26 08:56 ./usr/share/elasticsearch/bin/elasticsearch 
-rwxr-xr-x root/root  2099 2013-06-26 08:56 ./usr/share/elasticsearch/bin/elasticsearch.in.sh 
-rwxr-xr-x root/root  740 2013-06-26 08:56 ./usr/share/elasticsearch/bin/plugin 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/elasticsearch/lib/ 
-rw-r--r-- root/root 11000124 2013-06-26 08:56 ./usr/share/elasticsearch/lib/elasticsearch-0.90.2.jar 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/ 
-rw-r--r-- root/root 246605 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/libsigar-amd64-linux.so 
-rw-r--r-- root/root 494929 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/libsigar-ia64-linux.so 
-rw-r--r-- root/root 233385 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/libsigar-x86-linux.so 
-rw-r--r-- root/root 428580 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/sigar-1.6.4.jar 
-rw-r--r-- root/root 865400 2013-06-26 08:56 ./usr/share/elasticsearch/lib/jna-3.3.0.jar 
-rw-r--r-- root/root 770462 2013-06-26 08:56 ./usr/share/elasticsearch/lib/jts-1.12.jar 
-rw-r--r-- root/root 489884 2013-06-26 08:56 ./usr/share/elasticsearch/lib/log4j-1.2.17.jar 
-rw-r--r-- root/root 1563004 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-analyzers-common-4.3.1.jar 
-rw-r--r-- root/root 296563 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-codecs-4.3.1.jar 
-rw-r--r-- root/root 2213537 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-core-4.3.1.jar 
-rw-r--r-- root/root 107736 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-grouping-4.3.1.jar 
-rw-r--r-- root/root 123614 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-highlighter-4.3.1.jar 
-rw-r--r-- root/root  63680 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-join-4.3.1.jar 
-rw-r--r-- root/root  35907 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-memory-4.3.1.jar 
-rw-r--r-- root/root 202556 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-queries-4.3.1.jar 
-rw-r--r-- root/root 385813 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-queryparser-4.3.1.jar 
-rw-r--r-- root/root  45506 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-sandbox-4.3.1.jar 
-rw-r--r-- root/root  92692 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-spatial-4.3.1.jar 
-rw-r--r-- root/root 142268 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-suggest-4.3.1.jar 
-rw-r--r-- root/root  69290 2013-06-26 08:56 ./usr/share/elasticsearch/lib/spatial4j-0.3.jar 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./etc/ 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./etc/default/ 
-rw-r--r-- root/root  890 2013-06-26 08:56 ./etc/default/elasticsearch 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./etc/init.d/ 
-rwxr-xr-x root/root  5469 2013-06-26 08:56 ./etc/init.d/elasticsearch 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./etc/elasticsearch/ 
-rw-r--r-- root/root  12519 2013-06-26 08:56 ./etc/elasticsearch/elasticsearch.yml 
-rw-r--r-- root/root  1380 2013-06-26 08:56 ./etc/elasticsearch/logging.yml 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/lintian/ 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/lintian/overrides/ 
-rw-r--r-- root/root  482 2013-06-26 08:56 ./usr/share/lintian/overrides/elasticsearch 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/doc/ 
drwxr-xr-x root/root   0 2013-06-26 08:56 ./usr/share/doc/elasticsearch/ 
-rw-r--r-- root/root  741 2013-06-26 08:56 ./usr/share/doc/elasticsearch/copyright 

回答

2

.deb文件ar檔案。你可以用

ar x elasticsearch-0.90.2.deb 

提取它其中包含

debian-binary 
control.tar.gz 
data.tar.gz 

可以提取control.tar.gz

tar xvzf control.tar.gz 

這包含了四個劇本:prermpreinstpostrmpostinst

postinst是安裝後腳本。

http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

+0

非常感謝羅蘭。享受你的一天,先生 – Nick