Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5351781
  • 博文数量: 1144
  • 博客积分: 11974
  • 博客等级: 上将
  • 技术积分: 12312
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-13 20:06
文章存档

2017年(2)

2016年(14)

2015年(10)

2014年(28)

2013年(23)

2012年(29)

2011年(53)

2010年(86)

2009年(83)

2008年(43)

2007年(153)

2006年(575)

2005年(45)

分类: LINUX

2006-05-30 09:55:20

Of course, the plebian cp can be used as
well, but we Unix sysadmins love to use cryptic commands to complete relatively simple
tasks. That's what separates us from mortal users.
 
init is also responsible for running a number of programs and scripts when the system boots.
Everything init does is controlled by the file /etc/inittab. In order to understand this file, you
need to understand the concept of runlevels first.
 
Finally, the inittab file includes entries that execute /sbin/agetty for the first six virtual
consoles. agetty is one of the several getty variants available for Linux. These programs
permit logins on terminals; without them the terminal would be effectively dead and would
not respond when a user walked up and pressed a key or mouse button. The various getty
commands open a terminal device (such as a virtual console or a serial line), set various
parameters for the terminal driver, and execute /bin/login to initiate a login session on that
terminal. Therefore, to allow logins on a given virtual console, you must be running getty or
agetty on it. agetty is the version used on a number of Linux systems, but others use getty,
which has a slightly different syntax. See the manual pages for getty and agetty on your
system.
agetty takes two arguments: a baud rate and a device name. The port names for Linux virtual
consoles are /dev/tty1, /dev/tty2, and so forth. agetty assumes the given device name is relative
to /dev. The baud rate for virtual consoles should generally be 38400.
Note that the action field for each agetty entry is respawn. This means that init should
restart the command given in the entry when the agetty process dies, which is every time a
user logs out.
 
The problem is that if the system were to be suddenly powered down or rebooted, the buffers
in memory would not be written to disk, and data could be lost or corrupted. /sbin/update is a
program started from /etc/rc.d/boot on most systems; it flushes dirty buffers (ones that have
been changed since they were read from the disk) back to disk every five seconds to prevent
serious damage from occurring should the system crash. However, to be completely safe, the
system needs to undergo a "safe" shutdown before rebooting. This will not only ensure that
disk buffers are properly synchronized, but also allow all running processes to exit cleanly.
shutdown is the general, all-purpose command used to halt or reboot the system. As root,
阅读(1757) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~