<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flib &#187; 运维</title>
	<atom:link href="http://blog.flib.me/category/%e8%bf%90%e7%bb%b4/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flib.me</link>
	<description>flex&#039;s library</description>
	<lastBuildDate>Thu, 15 Dec 2011 11:05:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>LSI MegaSAS RAID 驱动 BUG</title>
		<link>http://blog.flib.me/2011/03/19/lsi-megasas-raid-%e9%a9%b1%e5%8a%a8-bug/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lsi-megasas-raid-%25e9%25a9%25b1%25e5%258a%25a8-bug</link>
		<comments>http://blog.flib.me/2011/03/19/lsi-megasas-raid-%e9%a9%b1%e5%8a%a8-bug/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 09:23:32 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[运维]]></category>
		<category><![CDATA[lsi]]></category>
		<category><![CDATA[megacli]]></category>
		<category><![CDATA[megaraid_sas]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38254</guid>
		<description><![CDATA[表现为使用MegaCli工具在线创建或者移除VD时不更新linux的设备文件，只有重启后才能更新。 已知在内核驱动/drivers/scsi/megaraid/megaraid_sas.c的00.00.04.17.1-rc1版本修复。 另外，DELL、IBM等某些服务器上，不使用RAID卡会出现硬盘的slot编号和linux的设备文件顺序不一致的情况，据说创建单盘RAID0能够解决。]]></description>
			<content:encoded><![CDATA[<p>表现为使用MegaCli工具在线创建或者移除VD时不更新linux的设备文件，只有重启后才能更新。</p>
<p>已知在内核驱动/drivers/scsi/megaraid/megaraid_sas.c的00.00.04.17.1-rc1版本修复。</p>
<p>另外，DELL、IBM等某些服务器上，不使用RAID卡会出现硬盘的slot编号和linux的设备文件顺序不一致的情况，据说创建单盘RAID0能够解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2011/03/19/lsi-megasas-raid-%e9%a9%b1%e5%8a%a8-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>关于moosefs的changelog</title>
		<link>http://blog.flib.me/2010/11/25/%e5%85%b3%e4%ba%8emoosefs%e7%9a%84changelog/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%2585%25b3%25e4%25ba%258emoosefs%25e7%259a%2584changelog</link>
		<comments>http://blog.flib.me/2010/11/25/%e5%85%b3%e4%ba%8emoosefs%e7%9a%84changelog/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 04:12:00 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[moosefs]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[metalogger]]></category>
		<category><![CDATA[mfs]]></category>
		<category><![CDATA[mfsmetarestore]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38248</guid>
		<description><![CDATA[如果metalogger和master的连接中断过，那么moosefs metalogger的changelog可能会丢失部分log，导致使用mfsmetarestore的时候失败。所以mfs迁移master不推荐使用metalogger进行restore。可以考虑rsync或者共享存储，如drbd。]]></description>
			<content:encoded><![CDATA[<p>如果metalogger和master的连接中断过，那么moosefs metalogger的changelog可能会丢失部分log，导致使用mfsmetarestore的时候失败。所以mfs迁移master不推荐使用metalogger进行restore。可以考虑rsync或者共享存储，如drbd。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/11/25/%e5%85%b3%e4%ba%8emoosefs%e7%9a%84changelog/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>puppet的generate函数</title>
		<link>http://blog.flib.me/2010/07/08/puppet%e7%9a%84generate%e5%87%bd%e6%95%b0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=puppet%25e7%259a%2584generate%25e5%2587%25bd%25e6%2595%25b0</link>
		<comments>http://blog.flib.me/2010/07/08/puppet%e7%9a%84generate%e5%87%bd%e6%95%b0/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:30:10 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[puppet]]></category>
		<category><![CDATA[运维]]></category>
		<category><![CDATA[generate]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38235</guid>
		<description><![CDATA[这个函数不能直接执行shell脚本，需要/usr/bin/env等做为第一个参数，如： $hostalias = generate("/usr/bin/env", "/tmp/genhname.sh", "172.16.0.133") 其次，这个函数的执行的是master上的脚本，它仅仅是将client上的变量拿回来，在本地执行；也就是说/tmp/genhname.sh要位于master的相应路径上，且有执行权限，不需要将脚本文件分发到client。]]></description>
			<content:encoded><![CDATA[<p>这个函数不能直接执行shell脚本，需要/usr/bin/env等做为第一个参数，如：</p>
<pre>$hostalias = generate("/usr/bin/env", "/tmp/genhname.sh", "172.16.0.133")</pre>
<p>其次，这个函数的执行的是<strong>master上的脚本</strong>，它仅仅是将client上的变量拿回来，在本地执行；也就是说/tmp/genhname.sh要位于master的相应路径上，且有执行权限，不需要将脚本文件分发到client。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/07/08/puppet%e7%9a%84generate%e5%87%bd%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>puppet dashboard的安装</title>
		<link>http://blog.flib.me/2010/07/07/puppet-dashboard%e7%9a%84%e5%ae%89%e8%a3%85/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=puppet-dashboard%25e7%259a%2584%25e5%25ae%2589%25e8%25a3%2585</link>
		<comments>http://blog.flib.me/2010/07/07/puppet-dashboard%e7%9a%84%e5%ae%89%e8%a3%85/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 02:51:32 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[puppet]]></category>
		<category><![CDATA[运维]]></category>
		<category><![CDATA[dashboard]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38206</guid>
		<description><![CDATA[以下过程基于debian: 系统要求： ruby &#62;= 1.8.1 rake &#62;= 0.8.3 （在lenny里版本不够，需要squeeze，不过我觉得使用gem应该也能装） mysql ruby mysql bindings（我个人觉得对应的包为libmysql-ruby，不过网上的另一个deb包依赖的是dbconfig-common libdbd-mysql-ruby） 安装过程： 1. 获得最新源码： git clone git://github.com/reductivelabs/puppet-dashboard.git 2. 设置数据库： cd puppet_dashboard/config cp database.yml.example database.yml 编辑database.yml，在development域中加入数据库用户名、密码，然后进行数据库初始化（确保mysql服务已经启动）： rake install （中间可能需要运行rake gem:install） 3.设置puppetmaster： 部署lib文件：（在puppet 2.6版本中不再需要） cp puppet_dashboard/lib/puppet/puppet_dashboard.rb /usr/lib/ruby/1.8/puppet/reports/ 这点和readme中描述不符，不过作者的方法怎么实验都不成功。:( 然后在/etc/puppet/puppet.conf的puppetmasterd域中加入： &#8230; <a href="http://blog.flib.me/2010/07/07/puppet-dashboard%e7%9a%84%e5%ae%89%e8%a3%85/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>以下过程基于debian:</p>
<p><strong>系统要求：</strong><br />
ruby &gt;= 1.8.1<br />
rake &gt;= 0.8.3 （在lenny里版本不够，需要squeeze，不过我觉得使用gem应该也能装）<br />
mysql<br />
ruby mysql bindings（我个人觉得对应的包为libmysql-ruby，不过网上的另一个deb包依赖的是dbconfig-common libdbd-mysql-ruby）</p>
<p><strong>安装过程：</strong></p>
<p>1. 获得最新源码：</p>
<pre>git clone git://github.com/reductivelabs/puppet-dashboard.git</pre>
<p>2. 设置数据库：</p>
<pre>
cd puppet_dashboard/config
cp database.yml.example database.yml
</pre>
<p>编辑database.yml，在development域中加入数据库用户名、密码，然后进行数据库初始化（确保mysql服务已经启动）：</p>
<pre>rake install</pre>
<p>（中间可能需要运行rake gem:install）</p>
<p>3.设置puppetmaster：</p>
<p>部署lib文件：（在puppet 2.6版本中不再需要）</p>
<pre>cp  puppet_dashboard/lib/puppet/puppet_dashboard.rb  /usr/lib/ruby/1.8/puppet/reports/</pre>
<p>这点和readme中描述不符，不过作者的方法怎么实验都不成功。:(</p>
<p>然后在/etc/puppet/puppet.conf的puppetmasterd域中加入：</p>
<pre>reports = puppet_dashboard</pre>
<p>Puppet 2.6版本是：</p>
<pre>reports = http</pre>
<p>可以写多种方法，用逗号分隔，比如：</p>
<pre>reports = puppet_dashboard, log, store</pre>
<p>最后重启服务端</p>
<p>4.运行dashboard server</p>
<pre>script/server</pre>
<p>5.设置puppet client：</p>
<p>在/etc/puppet/puppet.conf的puppetd域加入：</p>
<pre>report = true</pre>
<p>重启客户端</p>
<p>如果没有意外，dashboard将会接收到新的report，访问http://localhost:3000/进入web界面。</p>
<p>如果想将以前的report导入，在dashboard目录运行：</p>
<pre>rake reports:import</pre>
<p>如果reportdir不是/var/lib/puppet/reports则运行：</p>
<pre>rake reports:import REPORT_DIR=/path/to/your/reports</pre>
<p>如果时区显示有问题，在config/enviroment.rb文件中修改：</p>
<pre>config.time_zone = 'Beijing'</pre>
<p><em>参考：</em></p>
<p><em>1. <a href="http://docs.puppetlabs.com/guides/installing_dashboard.html" target="_blank">http://docs.puppetlabs.com/guides/installing_dashboard.html</a></em></p>
<p><em>2.<a href="http://zcentric.com/2010/03/11/install-puppet-dashboard-on-redhatcentos-5/" target="_blank">http://zcentric.com/2010/03/11/install-puppet-dashboard-on-redhatcentos-5/</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/07/07/puppet-dashboard%e7%9a%84%e5%ae%89%e8%a3%85/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>关于puppet的import</title>
		<link>http://blog.flib.me/2010/06/29/%e5%85%b3%e4%ba%8epuppet%e7%9a%84import/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%2585%25b3%25e4%25ba%258epuppet%25e7%259a%2584import</link>
		<comments>http://blog.flib.me/2010/06/29/%e5%85%b3%e4%ba%8epuppet%e7%9a%84import/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 14:49:26 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[puppet]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38201</guid>
		<description><![CDATA[import "autofs" import "autofs/init.pp" import "autofs/util/stuff.pp" 第一句与第二句会在模块路径中寻找autofs/manifests/init.pp并载入。 第三句只载入autofs/util/stuff.pp文件。 puppet 0.23.1之后的版本，位于modulepath下（默认是/etc/puppet/modules）的模块会被自动载入，所以不需要手动载入此目录下的各个模块了。 当你引用autofs模块中的craziness类时，puppet会自动在autofs模块下寻找craziness.pp文件中的这个类。使用这个技巧就可以不在模块的init.pp中写入额外的import了。]]></description>
			<content:encoded><![CDATA[<pre>import "autofs"
import "autofs/init.pp"
import "autofs/util/stuff.pp"
</pre>
<p>第一句与第二句会在模块路径中寻找autofs/manifests/init.pp并载入。<br />
第三句只载入autofs/util/stuff.pp文件。</p>
<p>puppet 0.23.1之后的版本，位于modulepath下（默认是/etc/puppet/modules）的模块会被自动载入，所以不需要手动载入此目录下的各个模块了。</p>
<p>当你引用autofs模块中的craziness类时，puppet会自动在autofs模块下寻找craziness.pp文件中的这个类。使用这个技巧就可以不在模块的init.pp中写入额外的import了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/06/29/%e5%85%b3%e4%ba%8epuppet%e7%9a%84import/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache在子目录取消访问控制</title>
		<link>http://blog.flib.me/2010/04/24/apache%e5%9c%a8%e5%ad%90%e7%9b%ae%e5%bd%95%e5%8f%96%e6%b6%88%e8%ae%bf%e9%97%ae%e6%8e%a7%e5%88%b6/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apache%25e5%259c%25a8%25e5%25ad%2590%25e7%259b%25ae%25e5%25bd%2595%25e5%258f%2596%25e6%25b6%2588%25e8%25ae%25bf%25e9%2597%25ae%25e6%258e%25a7%25e5%2588%25b6</link>
		<comments>http://blog.flib.me/2010/04/24/apache%e5%9c%a8%e5%ad%90%e7%9b%ae%e5%bd%95%e5%8f%96%e6%b6%88%e8%ae%bf%e9%97%ae%e6%8e%a7%e5%88%b6/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 08:09:23 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[运维]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[satisfy]]></category>
		<category><![CDATA[访问控制]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38175</guid>
		<description><![CDATA[Removing controls in subdirectories The following example shows how to use the Satisfy directive to disable access controls in a subdirectory of a protected directory. This technique should be used with caution, because it will also disable any access controls &#8230; <a href="http://blog.flib.me/2010/04/24/apache%e5%9c%a8%e5%ad%90%e7%9b%ae%e5%bd%95%e5%8f%96%e6%b6%88%e8%ae%bf%e9%97%ae%e6%8e%a7%e5%88%b6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Removing controls in subdirectories</p>
<p>The following example shows how to use the Satisfy directive to disable access controls in a subdirectory of a protected directory. This technique should be used with caution, because it will also disable any access controls imposed by mod_authz_host.<br />
[code gutter="false" highlight="7"]<br />
&lt;Directory /path/to/protected/&gt;<br />
Require user david<br />
&lt;/Directory&gt;<br />
&lt;Directory /path/to/protected/unprotected&gt;<br />
# All access controls and authentication are disabled<br />
# in this directory<br />
Satisfy Any<br />
Allow from all<br />
&lt;/Directory&gt;﻿</p>
<p>[/code]</p></blockquote>
<p>截取自apache 2.2手册<a href="http://httpd.apache.org/docs/2.2/mod/core.html#require">http://httpd.apache.org/docs/2.2/mod/core.html#require</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/04/24/apache%e5%9c%a8%e5%ad%90%e7%9b%ae%e5%bd%95%e5%8f%96%e6%b6%88%e8%ae%bf%e9%97%ae%e6%8e%a7%e5%88%b6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>nginx的log</title>
		<link>http://blog.flib.me/2010/01/29/nginx%e7%9a%84log/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx%25e7%259a%2584log</link>
		<comments>http://blog.flib.me/2010/01/29/nginx%e7%9a%84log/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 09:03:39 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[运维]]></category>
		<category><![CDATA[access_log]]></category>
		<category><![CDATA[error_log]]></category>
		<category><![CDATA[error_page]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38161</guid>
		<description><![CDATA[access_log的最小作用域是location，关闭方式是：access_log off; error_log的最小作用域是http，关闭方式是：error_log /dev/null; 如果一个请求是404之类的，则access_log中记录404，error_log同时会记录open filename failed等错误，如果不需要，可以改变http域error_log的记录等级，也可以直接关闭（还有log_not_found选项可以关闭记录open filename failed错误）。]]></description>
			<content:encoded><![CDATA[<p>access_log的最小作用域是location，关闭方式是：access_log off;</p>
<p>error_log的最小作用域是http，关闭方式是：error_log /dev/null;</p>
<p>如果一个请求是404之类的，则access_log中记录404，error_log同时会记录open filename failed等错误，如果不需要，可以改变http域error_log的记录等级，也可以直接关闭（还有log_not_found选项可以关闭记录open filename failed错误）。<span style="text-decoration: line-through;"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/01/29/nginx%e7%9a%84log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx的rewrite</title>
		<link>http://blog.flib.me/2010/01/28/nginx%e7%9a%84rewrite/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx%25e7%259a%2584rewrite</link>
		<comments>http://blog.flib.me/2010/01/28/nginx%e7%9a%84rewrite/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 15:50:36 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[运维]]></category>
		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38148</guid>
		<description><![CDATA[设置nginx的rewrite如果替换项是以http://开头，则起的是redirect的作用，即使最后的参数是last不是redirect，例如： rewrite ^(.*)$ http://aaa.bbb.com/ccc$1 last; 浏览器端会得到302。 nginx的文档里提到： redirect &#8211; returns temporary redirect with code 302; it is used if the substituting line begins with http:// 另外，rewrite后的host的使用顺序如下： 当请求的http头里的host匹配sever_name里的任一host时，使用此host 若不匹配，或者为空，使用server_name的第一个host 若没有设置server_name，则使用本机的hostname 若要一直使用http头里的host，则将server_name设置为：servername _ *;（下划线不能少，因为 * 不能做为sever_name第一项的开头）]]></description>
			<content:encoded><![CDATA[<p>设置nginx的rewrite如果替换项是以http://开头，则起的是redirect的作用，即使最后的参数是last不是redirect，例如：</p>
<p>rewrite ^(.*)$ http://aaa.bbb.com/ccc$1 last;</p>
<p>浏览器端会得到302。</p>
<p>nginx的文档里提到：</p>
<blockquote><p>
redirect &#8211; returns temporary redirect with code 302; it is used if the substituting line begins with http://</p></blockquote>
<p>另外，rewrite后的host的使用顺序如下：</p>
<ol>
<li>当请求的http头里的host匹配sever_name里的任一host时，使用此host</li>
<li>若不匹配，或者为空，使用server_name的第一个host</li>
<li>若没有设置server_name，则使用本机的hostname</li>
<li>若要一直使用http头里的host，则将server_name设置为：servername _ *;（下划线不能少，因为 * 不能做为sever_name第一项的开头）</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/01/28/nginx%e7%9a%84rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apt-get与aptitude</title>
		<link>http://blog.flib.me/2010/01/26/apt-get%e4%b8%8eaptitude/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apt-get%25e4%25b8%258eaptitude</link>
		<comments>http://blog.flib.me/2010/01/26/apt-get%e4%b8%8eaptitude/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 14:47:11 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[运维]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[recommends]]></category>
		<category><![CDATA[suggests]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38143</guid>
		<description><![CDATA[aptitude install默认会安装recommends的包，etch中apt-get不会，而lenny中则和aptitude相同。两者都不会安装suggests。 aptitude remove会清除所有不需要的包，apt-get remove只会清除指定包，但是有autoremove选项。 如果希望只安装必要的包的话，可以用apt-get &#8211;no-install-recommends，aptitude可以在设置里取消Install recommended packages automatically。 或者，在/etc/apt/apt.conf中根据需要写入以下配置： [code] APT::Install-Recommends &#34;false&#34;; APT::Install-Suggests &#34;false&#34;; Aptitude::Recommends-Important &#34;false&#34;; Aptitude::Keep-Suggests &#34;false&#34;; [/code] 附录： 2.2.8 软件包依赖关系 Debian 软件包管理系统依赖声明，它描述了这一事实：一些软件包需要其它软件包被安装才能正常运行或运行得更好。 软件包 A 依赖(depends)软件包 B：要运行A必须安装 B。在有些情况下，A 不仅依赖 B，还要求 B 的特定版本。版本依赖通常有最低版本限制，A 更依赖于B的最新版而非某个特定版本。 软件包 A 推荐(recommends)软件包 B：软件包维护者认为所有用户都不会喜欢缺少某些功能的 &#8230; <a href="http://blog.flib.me/2010/01/26/apt-get%e4%b8%8eaptitude/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>aptitude install默认会安装recommends的包，etch中apt-get不会，而lenny中则和aptitude相同。两者都不会安装suggests。</p>
<p>aptitude remove会清除所有不需要的包，apt-get remove只会清除指定包，但是有autoremove选项。</p>
<p>如果希望只安装必要的包的话，可以用apt-get &#8211;no-install-recommends，aptitude可以在设置里取消Install recommended packages automatically。</p>
<p>或者，在/etc/apt/apt.conf中根据需要写入以下配置：</p>
<p>[code]</p>
<p>APT::Install-Recommends &quot;false&quot;;<br />
APT::Install-Suggests &quot;false&quot;;<br />
Aptitude::Recommends-Important &quot;false&quot;;<br />
Aptitude::Keep-Suggests &quot;false&quot;;</p>
<p>[/code]</p>
<p>附录：</p>
<p>2.2.8 软件包依赖关系</p>
<p>Debian 软件包管理系统依赖声明，它描述了这一事实：一些软件包需要其它软件包被安装才能正常运行或运行得更好。</p>
<ul>
<li>软件包 A 依赖(depends)软件包 B：要运行A必须安装 B。在有些情况下，A 不仅依赖 B，还要求 B 的特定版本。版本依赖通常有最低版本限制，A 更依赖于B的最新版而非某个特定版本。</li>
</ul>
<ul>
<li>软件包 A 推荐(recommends)软件包 B：软件包维护者认为所有用户都不会喜欢缺少某些功能的 A，而这些功能需要 B 来提供。</li>
</ul>
<ul>
<li>软件包 A 建议(suggests)软件包 B：B 中某些文件与 A 的功能相关，并能够增强 A 的功能。这种关系通过声明软件包 B 增强 Enhances 软件包 A 来表示。</li>
</ul>
<ul>
<li>软件包 A 与软件包 B 冲突(conflicts)：如果系统中安装了 B 那么 A 无法运行。“Conflicts”常和“replaces”同时出现。</li>
</ul>
<ul>
<li>软件包 A 替换(replaces)软件包 B：B 安装的文件被 A 中的文件移除和覆盖了。</li>
</ul>
<ul>
<li>软件包 A 提供(provides)软件包 B：A 中包含了 B 中的所有文件和功能。</li>
</ul>
<p>上述术语使用方法的更详细的信息参阅 Packaging Manual 和 the Policy Manual。</p>
<p>注意，aptitude 和 dselect 可以对 recommends 和 suggests 类软件包进行更细粒度的操作，apt-get 只会简单的下载安装 depends 类软件包而不管 recommends 和 suggests 类软件包。这两个程序均正式使用 APT 作为其后端。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/01/26/apt-get%e4%b8%8eaptitude/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cfengine的哲学</title>
		<link>http://blog.flib.me/2010/01/10/cfengine%e7%9a%84%e5%93%b2%e5%ad%a6/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cfengine%25e7%259a%2584%25e5%2593%25b2%25e5%25ad%25a6</link>
		<comments>http://blog.flib.me/2010/01/10/cfengine%e7%9a%84%e5%93%b2%e5%ad%a6/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 08:34:38 +0000</pubDate>
		<dc:creator>flex</dc:creator>
				<category><![CDATA[cfengine]]></category>
		<category><![CDATA[运维]]></category>
		<category><![CDATA[promise]]></category>

		<guid isPermaLink="false">http://blog.flib.me/?p=38138</guid>
		<description><![CDATA[最近在做基于cfengine的二次开发，目前正在进行的是系统初始化的工作。 开始的时候我直接对现有的shell脚本进行cfengine化，然而随着工作的深入，越发疑惑这么做的意义，使用脚本逐句执行的方式来运用cfengine有什么优势呢？不就是相当于使用了cfengine语法的“脚本”么？而且系统初始化后，如何保证这个状态呢？难道要再写一套“脚本”？ 随后和老大的一番讨论让我发现我还是没有理解透彻cfengine对于promise的定义。即，promise是为了保证一种状态的不变。用户需要定义的就是这个状态。当然，对于复杂的cfengine没有提供原生支持的状态，还需要定义修复方法。 所以，使用cfengine首先要确定的是要达到什么状态，其次是状态意外改变后如何修复。 对于系统初始化，首先用cfengine描述出系统应达到的状态，而第一次运行，整个系统明显是“偏离”这个状态的，于是修复过程开始。]]></description>
			<content:encoded><![CDATA[<p>最近在做基于cfengine的二次开发，目前正在进行的是系统初始化的工作。</p>
<p>开始的时候我直接对现有的shell脚本进行cfengine化，然而随着工作的深入，越发疑惑这么做的意义，使用脚本逐句执行的方式来运用cfengine有什么优势呢？不就是相当于使用了cfengine语法的“脚本”么？而且系统初始化后，如何保证这个状态呢？难道要再写一套“脚本”？</p>
<p>随后和老大的一番讨论让我发现我还是没有理解透彻cfengine对于promise的定义。即，promise是为了保证一种状态的不变。用户需要定义的就是这个状态。当然，对于复杂的cfengine没有提供原生支持的状态，还需要定义修复方法。</p>
<p>所以，使用cfengine首先要确定的是要达到什么状态，其次是状态意外改变后如何修复。</p>
<p>对于系统初始化，首先用cfengine描述出系统应达到的状态，而第一次运行，整个系统明显是“偏离”这个状态的，于是修复过程开始。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flib.me/2010/01/10/cfengine%e7%9a%84%e5%93%b2%e5%ad%a6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

