Kin'blog

喜欢coding。喜欢大海。


  • Home

  • Archives

  • Brief

  • Tags

  • About

Ubuntu 服务自动启动

Posted on Dec 20 2014 |

有时候,我们希望服务器重启后能够自动的把相关的服务启动起来。在了解如何让服务自动启动前,我们需要先了解一下,linux系统的启动步骤。

linux 系统的启动步骤

  1. 读取 MBR 的信息,启动 Boot Manager。
  2. 加载系统内核,初始化硬件和设备驱动,启动 init 进程, init 进程是 Linux 的根进程,所有的系统进程都是它的子进程,也就是说 init 进程会根据配置文件继续引导过程,启动其它进程。
  3. init 进程读取 /etc/inittab 文件中的信息,并进入预设的运行级别。通常情况下 /etc/rcS.d/ 目录下的启动脚本首先被执行,然后是/etc/rcN.d/ 目录。
  4. 根据 /etc/rcS.d/ 文件夹中对应的脚本启动 Xwindow 服务器 xorg,Xwindow 为 Linux 下的图形用户界面系统。
  5. 启动登录管理器,等待用户登录。
Read more »

window 对象的“生命周期”事件

Posted on Dec 7 2014 |

“生命周期”事件?什么是”生命周期”事件?好吧,我只是想不到标题,于是就想了个“生命周期”名词,个人觉得比较”高大上” (*^__^*)。其实就是网页加载或关闭时触发的事件。

访问一个网页时,可能会触发 window 对象的一些事件(onload, onbeforeunload, onunload, onfocus, onblur等)。我们可以在这些事件触发时,实现一些功能,也可以根据这些事件来捕获用户的一些本地行为等等。

Read more »

《JavaScript 模式》养分

Posted on Nov 20 2014 |

《JavaScript 模式》作者: Stoyan Stefanov 译: 陈新

养分

1. 自调用构造函数: 实现不使用new关键字,构造出实例。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function Waffle() {
if ((!this instanceof Waffle)) {
return new Waffle();
}

this.tastes = "yummy";
}
Waffle.prototype.wantAnother = true;

var first = new Waffle(),
section = Waffle();

console.log(first.tastes); // yummy
console.log(section.tastes); // yummy
Read more »
1…8910…15
aikin

aikin

45 posts
60 tags
RSS
GitHub Segmentfault
© 2019 aikin
Powered by Hexo
Theme - NexT.Mist