- 浏览: 436458 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (158)
- J2SE (15)
- c/c++ (17)
- linux & ubuntu (20)
- js (18)
- algorithm (21)
- android (1)
- software (3)
- svn (1)
- db (6)
- other (19)
- css (5)
- go (1)
- html 5 (3)
- computer science (1)
- php (3)
- 创业 (8)
- EJB & jboss (1)
- TDD (1)
- jsp & servlet (2)
- http, tcp & ip (2)
- hibernate (1)
- json (1)
- 乐 (2)
- ps (2)
- netbeans (1)
- extjs (2)
- eclipse (4)
- 项目管理 (1)
- varnish (2)
- study abroad (1)
- python (1)
- erlang (1)
- math (1)
- shell (1)
- assembly (4)
- lucene (1)
- web (1)
- http (1)
- tcp & ip (1)
最新评论
-
yiguxianyun:
...
css li 不换行 -
stdayong:
...
netbeans 中使用 maven -
程序猿_星:
为啥会中文乱码啊
servlet 以 gzip 格式返回数据 -
huanhuan519:
感谢分享~
gdb 调试工具 -
heyl1234:
写过些js,对css还不熟。谢谢~
css li 不换行
linux startup scripts
------
init & run level
init process define 7 run level:
* level 0
shutdown
* level 1 or S
single user mode,
* level 3-5
multiple user mode,
2 or 3, is command line mode,
5, is x-window mode,
4, rarely used,
* level 6
reboot
config file:
location:
/etc/inittab
config init process, like default run level,
e.g.
id:2:initdefault:
------
scripts
location:
/etc/init.d/
orginal startup shell scripts, each script is for a service or an aspect of service,
accept args:
start, stop, restart(not sure support),
/etc/rcx.d/
the x could be: 0,1,2,3,4,5,6,S,
inside each folder, are symbol links to scripts in /etc/init.d,
execute rules:
for each level, init process will execute scripts in relative "/etc/rcx.d/" folder,
args for scripts:
start, if script name start with S,
stop, if script name stop with K,
order:
order depends on xx,
customize scripts:
steps:
* add/modify/remove orginal scripts in /etc/init.d/,
* add symbol links to /etc/rcx.d/ folder, start with S|K, and a proper order number,
distribution specific scripts style:
different distributions, might have some specific scripts style,
e.g. debian/ubuntu has a script "/usr/sbin/update-rc.d" to help customize startup scripts,
e.g.
under /etc/rc3.d/
// start oracle-xe in order 20, in level 3
ln -s S20oracle-xe ../init.d/oracle-xe
under /etc/rc0.d/
// stop oracle-xe in order 20, in level 0
ln -s K20oracle-xe ../init.d/oracle-xe
------
debian & ubuntu run level
run level:
0 shutdown
1 single
2 multiple user, default,
3-5 same as 2,
6 reboot
/etc/inittab file:
debian&ubuntu don't have this file by default, you need to create this file, then use it,
update-rc.d command:
help to add/remove init scripts,
use "man update-rc.d" to check help,
e.g.
// add S20foo for level 2/3/4/5, and add K20foo for level 0/1/6, links for foo should not already exists,
update-rc.d foo defaults
// remove all links for foo,
update-rc.d -f foo remove
// add S30foo for level 2/3/4/5, and add K25foo for level 0/1/6, links for foo should not already exists,
update-rc.d foo start 30 2 3 4 5 . stop 25 0 1 6 .
------
e.g.
* add a script to echo a line to a file when startup & shutdown
* script, foo:
#! /bin/sh case "$1" in start) echo -e "startup, $(date)\n" >> /home/eric/startup_script_test.txt ;; stop) echo -e "shutdown, $(date)\n" >> /home/eric/startup_script_test2.txt ;; *) echo "Usage: param only support start|stop" exit 1 ;; esac
* add script to run level - by hand:
startup (level 2):
su
cd /etc/rc2.d
ln -s S99foo ../init.d/foo
shutdown:
su
cd /etc/rc0.d
ln -s K99foo ../init.d/foo
restart:
when restart scripts in startup will be execute, but scripts in shutdown might not,
* remove script from run level - by hand:
just remove symbol links,
* add script to run level - ubuntu update-rc.d:
update-rc.d foo defaults
* remove script from run level - ubuntu update-rc.d:
update-rc.d -f foo remove
* change ubuntu default run level
* create /etc/inittab, if not exists,
su
vi /etc/inittab
save it,
* set default run level
vi /etc/inittab
add/modify line:
id:3:initdefault:
save it,
*
------
发表评论
-
ubuntu grub config
2014-04-10 23:14 753grub config for ubuntu 10.04 ... -
change encoding of folder recusively
2014-03-08 17:37 983use shell to change encodeing ... -
unity - why ubuntu still using it?
2013-11-02 02:08 968I want to say **** Unity! ... -
shell hack - inode table full
2012-05-26 14:58 1062shell hack - inode table full ... -
oracle10g xe install & config - ubuntu
2012-05-19 22:47 1357oracle10g xe install & conf ... -
linux vi 常用命令
2011-02-20 23:54 2267================= ... -
ubuntu 快捷键
2011-02-13 00:45 2668ubuntu 10.04 快捷键 ------ wi ... -
editplus - ubuntu
2011-01-28 09:29 2897editplus - ubuntu ------ i ... -
ubuntu 下安装 tomcat
2011-01-28 07:41 2044ubuntu 安装 tomcat ------ ... -
ubuntu9.10 升级 10.04
2010-11-07 19:26 1117今天把 ubuntu 从 9.10 升级到了 10.04 升 ... -
ubuntu 快捷键
2010-03-23 21:03 966ubuntu 快捷键 查看:http://wiki.ubun ... -
ubuntu9.10 顶部面板 恢复
2010-03-23 20:48 1644ubuntu9.10 顶部面板 恢复 不小心把 ubuntu ... -
ubuntu 扩展 分区
2010-01-31 18:39 4983ubuntu 扩展分区 由于 ubuntu,windows ... -
vmware 下 ubuntu 全屏显示
2009-12-07 16:58 19991vmware 下 ubuntu 全屏显示 在 vmware ... -
ubuntu9.10 安装 eclipse3.5 的问题
2009-11-08 18:12 2258参考:http://forum.ubuntu.org.cn/v ... -
ububtu9.10 显卡驱动 & 3D桌面 安装使用
2009-11-08 15:40 2169参考自:http://blog.ednchina.com/XT ... -
ubuntu9.10 iBus 输入法
2009-11-08 12:40 4568ubuntu9.10 iBus 输入法 ubuntu9.1 ... -
ubuntu 9.04 升级 9.10 nvidia 驱动 解决 图形界面
2009-11-08 12:29 2894* 问题: ubuntu 从 9.04 升级到 9.10 后, ... -
ubuntu 常用软件3
2009-11-08 00:39 1412ubuntu 常用软件: * MLDonkey p2p 下载 ...
相关推荐
这将在启动时启动您的FiveM服务器,如果崩溃应在60秒内启动它。
Startup Programs,Add一个Name叫"vmware-toolbox",Command是"/usr/bin/vmware-toolbox"的启动 程序.这样每次开机后就能自动运行VMware Tools了.重启Ubuntu看看效果吧!(注意:vmware-toolbox并不是在后台隐藏运行的...
此SDK工程,用于指导开发者脱离MDK5等IDE工具,不再安装软件,直接编译。了解编译过程。 另,此工程新增freertos系统,并创建了两个task,用于指导开发者...├── scripts ├── startup ├── system └── tools
Linux machine boots up, it executes the shell scripts in /etc/rc.d to restore the system configuration and set up services. A detailed understanding of these startup scripts is important for analyzing...
bin/4.1.2:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin 如果ifconfig没行就打上面的,配置环境变量 cat /etc/sysconfig/network-scripts/ifcfg-eth0 IP地址配置文件 cat /etc/passwd 本机多少用户 su - ...
MTradumàtica在Python 3上 :snake:Ubuntu 16.04 ...开始服务$ MTRADUMATICADIR/scripts/startup.sh5.浏览到“ ”基于Docker的安装(适用于Linux,Windows或Mac) 您可能需要安装Docker,可以从这里4步程序:0.下载Mtra
/README/scripts/install.sh 浏览器通行证扩展名问题 我在使browserpass能够在最新的Kubuntu安装上工作时遇到问题。 通过此链接解决 具体来说,此评论: sudo mkdir -p /etc/opt/chrome/native-messaging-hosts/ ...
2POD已在使用R2015a开始使用Matlab版本的运行Linux和Mac OS的计算机上进行了测试。 没有使用Matlab工具箱。 安装 要运行代码,必须将以下文件夹添加到MATLAB路径: / path / to / 2pod / src / path / to / 2pod / ...
rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4$ make ARCH=arm menuconfig [*] Networking support ---> <*> Bluetooth subsystem support ---> Bluetooth device drivers ---> < > ...
Create Your Own Startup Scripts Section 87. Automate NetBSD Package Builds Section 88. Easily Install Unix Applications on Mac OS X Chapter 9. Grokking BSD Introduction Section 89...
│ │ │ │ ├─Scripts │ │ │ │ ├─Shipping │ │ │ │ └─ShippingDLL │ │ │ ├─CustomTypeExample1 │ │ │ │ ├─Debug │ │ │ │ ├─DebugDLL │ │ │ │ ├─Release │ │ │ │ ├─...
Getting Vim for Unix and GNU/Linux 151 Getting Vim for Windows Environments 156 Getting Vim for the Macintosh Environment 157 Other Operating Systems 157 viii | Table of Contents Aids and Easy Modes ...
rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4$ make ARCH=arm menuconfig [*] Networking support ---> <*> Bluetooth subsystem support ---> Bluetooth device drivers ---> < > ...
Python参考手册,官方正式版参考手册,chm版。以下摘取部分内容:Navigation ...PEP 338: Executing Modules as Scripts PEP 341: Unified try/except/finally PEP 342: New Generator Features PEP 343: The ‘with...
ubuntu-setup:一个脚本配置,用于基于NodeJS开发为我的个人工作站安装入门应用程序
- Update config.guess/config.sub scripts to May 2010 revisions. - Update Visual Studio 2008 project files in build/win32/vs2008ex-workspace.zip - Added Bochs compilation timestamp after Bochs ...