﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-海阔天空-文章分类-Linux</title><link>http://www.blogjava.net/shiliqiang/category/44503.html</link><description>I'm on my way!</description><language>zh-cn</language><lastBuildDate>Wed, 14 Apr 2010 00:51:51 GMT</lastBuildDate><pubDate>Wed, 14 Apr 2010 00:51:51 GMT</pubDate><ttl>60</ttl><item><title>linux 开机自启动设置</title><link>http://www.blogjava.net/shiliqiang/articles/317455.html</link><dc:creator>石头@</dc:creator><author>石头@</author><pubDate>Sun, 04 Apr 2010 12:26:00 GMT</pubDate><guid>http://www.blogjava.net/shiliqiang/articles/317455.html</guid><wfw:comment>http://www.blogjava.net/shiliqiang/comments/317455.html</wfw:comment><comments>http://www.blogjava.net/shiliqiang/articles/317455.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shiliqiang/comments/commentRss/317455.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shiliqiang/services/trackbacks/317455.html</trackback:ping><description><![CDATA[&nbsp; 下面用自启动apache为例;<br />
自启动脚本:<br />
/usr/local/apache2/bin；<br />
./apachectl
start<br />
文件位于/etc/rc.d/init.d下,名为apached, 注意要可执行.<br />
#chmod +x
/etc/rc.d/init.d/apached &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;   //设置文件的属性为可执行<br />
#ln
-s /etc/rc.d/init.d/apached /etc/rc3.d/S90apache &nbsp;  &nbsp;   //建立软连接,快捷方式<br />
#ln
-s /etc/rc.d/init.d/apached /etc/rc0.d/K20apache<br />
<br />
<br />
<br />
在Red
Hat Linux中自动运行程序<br />
1．开机启动时自动运行程序<br />
Linux加载后, 它将初始化硬件和设备驱动,
然后运行第一个进程init。init根据配置文件继续引导过程，启动其它进程。通常情况下，修改放置在 /etc/rc或 /etc/rc.d 或
/etc/rc?.d 目录下的脚本文件，可以使init自动启动其它程序。例如：编辑 /etc/rc.d/rc.local
文件，在文件最末加上一行"xinit"或"startx"，可以在开机启动后直接进入X－Window。<br />
<br />
2．登录时自动运行程序<br />
用户登录时，bash首先自动执行系统管理员建立的全局登录script
：/ect/profile。然后bash在用户起始目录下按顺序查找三个特殊文件中的一个：/.bash_profile、/.bash_login、
/.profile，但只执行最先找到的一个。<br />
因此，只需根据实际需要在上述文件中加入命令就可以实现用户登录时自动运行某些程序（类似于
DOS下的Autoexec.bat）。<br />
<br />
3．退出登录时自动运行程序<br />
退出登录时，bash自动执行个人的退出登录脚本
/.bash_logout。例如，在/.bash_logout中加入命令"tar －cvzf c.source.tgz
＊.c"，则在每次退出登录时自动执行 "tar" 命令备份 ＊.c 文件。<br />
<br />
4．定期自动运行程序<br />
Linux有一个称
为crond的守护程序，主要功能是周期性地检查
/var/spool/cron目录下的一组命令文件的内容，并在设定的时间执行这些文件中的命令。用户可以通过crontab
命令来建立、修改、删除这些命令文件。<br />
例如，建立文件crondFile，内容为"00 9 23 Jan ＊
HappyBirthday"，运行"crontab
cronFile"命令后，每当元月23日上午9:00系统自动执行"HappyBirthday"的程序（"＊"表示不管当天是星期几）。<br />
<br />
5．定时自动运行程序一次<br />
定时执行命令at 与crond
类似（但它只执行一次）：命令在给定的时间执行，但不自动重复。at命令的一般格式为：at [ －f file ] time
，在指定的时间执行file文件中所给出的所有命令。也可直接从键盘输入命令：<br />
<br />
＄ at 12:00<br />
at&gt;mailto Roger －s &#8243;Have a lunch&#8243; &lt; plan.txt<br />
at&gt;Ctr－D<br />
Job 1 at 2000－11－09 12:00
<img src ="http://www.blogjava.net/shiliqiang/aggbug/317455.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shiliqiang/" target="_blank">石头@</a> 2010-04-04 20:26 <a href="http://www.blogjava.net/shiliqiang/articles/317455.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ubuntu 下编译vim源文件遇到的问题</title><link>http://www.blogjava.net/shiliqiang/articles/317339.html</link><dc:creator>石头@</dc:creator><author>石头@</author><pubDate>Fri, 02 Apr 2010 10:34:00 GMT</pubDate><guid>http://www.blogjava.net/shiliqiang/articles/317339.html</guid><wfw:comment>http://www.blogjava.net/shiliqiang/comments/317339.html</wfw:comment><comments>http://www.blogjava.net/shiliqiang/articles/317339.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shiliqiang/comments/commentRss/317339.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shiliqiang/services/trackbacks/317339.html</trackback:ping><description><![CDATA[&nbsp; vim version too low , so dl a vim lastest version7.2&nbsp; , but compiling need to install terminal library. so find this command :<br />
<br />
&nbsp;" apt-get install libncurses5-dev"&nbsp; <br />
<br />
done<br />
<br />
<span>may also want libgpmg1-dev and build-essential.
</span><br />
<br />
<br />
<img src ="http://www.blogjava.net/shiliqiang/aggbug/317339.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shiliqiang/" target="_blank">石头@</a> 2010-04-02 18:34 <a href="http://www.blogjava.net/shiliqiang/articles/317339.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ubuntu apt更新</title><link>http://www.blogjava.net/shiliqiang/articles/317335.html</link><dc:creator>石头@</dc:creator><author>石头@</author><pubDate>Fri, 02 Apr 2010 09:33:00 GMT</pubDate><guid>http://www.blogjava.net/shiliqiang/articles/317335.html</guid><wfw:comment>http://www.blogjava.net/shiliqiang/comments/317335.html</wfw:comment><comments>http://www.blogjava.net/shiliqiang/articles/317335.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/shiliqiang/comments/commentRss/317335.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/shiliqiang/services/trackbacks/317335.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最近在虚拟机中安装了个ubuntu，需要更新apt list, 但是运行命令：sudo apt-get update 后就在[Connecting to un.archive.unbuntu.com]一步就卡住了，怎么也连接不上， 最后在goog 上找到的（用的是英文版）<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 具体方法：<br />
<pre dir="ltr" style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 82px; text-align: left; overflow: auto;">sudo apt-get clean all<br />
<font face="courier new,courier"><font face="Courier New,Courier,mono">cd /var/lib/apt/lists<br />
</font></font><font face="courier new,courier"><font face="Courier New,Courier,mono">sudo mv lock lock.old<br />
sudo apt-get update</font></font></pre>
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
<br />
<img src ="http://www.blogjava.net/shiliqiang/aggbug/317335.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/shiliqiang/" target="_blank">石头@</a> 2010-04-02 17:33 <a href="http://www.blogjava.net/shiliqiang/articles/317335.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>