﻿<?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>七维森林七维森林 |  &#187; Linux开发</title>
	<atom:link href="http://lizehong.freevar.com/?cat=54&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://lizehong.freevar.com</link>
	<description>技术爆炸、文明生存与个体价值</description>
	<lastBuildDate>Sat, 08 Dec 2012 14:07:20 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4</generator>
		<item>
		<title>Linux开机程序自启动实现</title>
		<link>http://lizehong.freevar.com/?p=186</link>
		<comments>http://lizehong.freevar.com/?p=186#comments</comments>
		<pubDate>Thu, 19 Apr 2012 13:53:03 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Linux开发]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://lizehong.freevar.com/?p=186</guid>
		<description><![CDATA[1.使程序在登录之前自动启动 把相应的启动脚本或者程序启动命令加入到inittab或者/etc/rc.local脚本中 注意此时还没有加载profile配置，无法使用登录后的环境变量 2.使程序在登录后自动启动 所有用户登录都自动启动：把脚本或程序放到/etc/profile脚本 … <a href="http://lizehong.freevar.com/?p=186"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>1.使程序在登录之前自动启动<br />
把相应的启动脚本或者程序启动命令加入到inittab或者/etc/rc.local脚本中<br />
注意此时还没有加载profile配置，无法使用登录后的环境变量</p>
<p>2.使程序在登录后自动启动<br />
所有用户登录都自动启动：把脚本或程序放到/etc/profile脚本文件中<br />
特定用户登录自动启动：把脚本或程序放到用户home目录下的相应配置文件中，如：.bash_profile/.bash_login/.profile</p>
<p>3.使程序在登出时自动运行<br />
把脚本或程序放到用户home目录下的.bash_logout文件中</p>
]]></content:encoded>
			<wfw:commentRss>http://lizehong.freevar.com/?feed=rss2&#038;p=186</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux启动过程及相关配置文件</title>
		<link>http://lizehong.freevar.com/?p=183</link>
		<comments>http://lizehong.freevar.com/?p=183#comments</comments>
		<pubDate>Thu, 19 Apr 2012 13:47:14 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Linux开发]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://lizehong.freevar.com/?p=183</guid>
		<description><![CDATA[Linux的不行发行版之间使用的文件系统不一致，因此导致了Linux启动过程所涉及的一些相关配置文件也各不相同，容易导致混乱。主要是体现在Linux的init进程启动的过程： Red Hat下相关的配置文件为： /etc/inittab /etc/rc.d/rc.sysinit  … <a href="http://lizehong.freevar.com/?p=183"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>Linux的不行发行版之间使用的文件系统不一致，因此导致了Linux启动过程所涉及的一些相关配置文件也各不相同，容易导致混乱。主要是体现在Linux的init进程启动的过程：<br />
Red Hat下相关的配置文件为：</p>
<p style="padding-left: 30px;">/etc/inittab<br />
/etc/rc.d/rc.sysinit<br />
/etc/rc.d/rcX.d/ 目录下的各符号链接<br />
/etc/rc.d/init.d/ 目录下的实际守护进程脚本<br />
/etc/rc.d/rc.local 用户自定义启动脚本</p>
<p>Ubuntu下相关的配置文件对应为：</p>
<p style="padding-left: 30px;">/etc/inittab （有的好像没有这个文件）<br />
/etc/rcS.d/ 目录下的启动服务符号链接<br />
/etc/rcX.d/ 各运行等级对应的启动目录,X:0-6<br />
/etc/init.d/ 实际的服务启动脚本<br />
/etc/rc.local 用户自定义启动脚本</p>
<p>下面主要就Ubuntu系统下的配置文件之间的关联进行一个整理：</p>
<ol>
<li>init进程读取inittab文件，启动rcS.d目录下的所有服务，确定启动运行级别(initdefault),依据顺序停止[K]或启动[S]对应运行级别rcX.d/目录下的服务</li>
<li>rcS.d/rcX.d目录下的文件均为init.d目录下的服务脚本的符号链接，通过标识[K]标明停止，标识[S]标明启动.</li>
<li>三个文件：/etc/init.d/rc  /etc/init.d/rc.local  /etc/init.d/rcS</li>
</ol>
<ul>
</ul>
<ul>
<li>rc脚本通过第一个参数确定具体的服务运行目录/级别,如rc S 执行rcS.d/下的服务，rc 5 执行rc5.d/下的服务等。</li>
<li>rc.local脚本根据标识执行或停止/etc/rc.local脚本(如果存在)，默认/etc/rc.local文件中没有任何内容，或者有一句 exit 0；可以在其中添加自定义的启动程序。</li>
<li>rcS脚本执行rcS.d/下的所有服务：exec /etc/init.d/rc S</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lizehong.freevar.com/?feed=rss2&#038;p=183</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
