惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
DataBreaches.Net
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
月光博客
月光博客
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog RSS Feed
博客园 - Franky
爱范儿
爱范儿

博客园 - 可可

广东电信最新DNS更新了 分布式缓存失效处理 序列化 suse中计划任务工具cron的使用 转载《.NET框架设计之五------------异常设计(异常与返回值)》 《高级Bash脚本编程指南》在线阅读 转载《Linux Shell Bash 各种小技巧》 Linux多线程例子 转载《Adding a Second IP Address to an Existing Network Adapter on Linux》 SuSE下chkconfig的启动脚本参考例子"/etc/init.d/skeleton” - 可可 - 博客园 linux下c++程序编译错误--理解typename 一个公网IP情况下实现LVS VS/DR vmware中suse10不能上网解决方法 Using PHP with mod_fcgid Apache Configuration PHP在Apache中两种工作方式的区别(CGI模式、Apache 模块DLL) SSO 转贴《负载均衡技术介绍》 CDN
转载《Starting and Stoping Services: insserv》
可可 · 2009-05-14 · via 博客园 - 可可

http://susefaq.sourceforge.net/faq/services.html

Starting and Stoping Services

SuSE is using insserv to control the runlevel links in an automatic fashion. This section tries to address questions related to creating and maintaing runlevel links.

1. How can I start services at boot time ?
2. Why do my runlevel symlinks change order ?
3. I can't find chkconfig where is it ?
4. How can I stop hwscan from starting at boot time ?
1.

How can I start services at boot time ?

To start a service:
$ insserv named
            
To stop a service from starting:
 $ insserv -r named
            

Note

You can also use ->->+Runlevel properties

Have a look at insserv(8) manual page for in detail explanations.

INSSERV(8)            The SuSE boot concept            INSSERV(8)
            Insserv - Enable an installed system init script
            Enables an installed  system  init  script  (`boot
            script')  by  reading  the  comment  header of the script,
            e.g.:
            ### BEGIN INIT INFO
            # Provides:       boot_facility_1 [ boot_facility_2 ...]
            # Required-Start: boot_facility_1 [ boot_facility_2 ...]
            # Required-Stop:  boot_facility_1 [ boot_facility_2 ...]
            # Default-Start:  run_level_1 [ run_level_2 ...]
            # Default-Stop:   run_level_1 [ run_level_2 ...]
            # Description:    multiline_description
            ### END INIT INFO
            and calculating  the  dependencies  between  all  scripts.
            

If you are interested in making your own init script for a custom program to start at boot time look at /etc/init.d/skeleton. You can use this example to create your own.

2.

Why do my runlevel symlinks change order ?

"insserv", is changing the run level links. Every time a package including an init script is being installed, it calls insserv in its %post section to install the required run level links. Have a look at the insserv(8) and init.d(7) man pages. Probably your init script is lacking the required comments in the header that determine the default run levels and startup dependencies (as specified by the LSB).

Tip

Have a look at SuSE Package Conventions document if you are creating your own rpms or for a deeper understanding of SuSE RPM internals. Note that this document is still work in progress...

3.

I can't find chkconfig where is it ?

Applies to SuSE 8.0

The equivalent is insserv, refer to the previous question for detailed info about man pages and other explanations.

CHKCONFIG(8)                                         CHKCONFIG(8)
            NAME
            chkconfig - enable or disable system services
            SYNOPSIS
            chkconfig -t|--terse [names]
            chkconfig -s|--set [name state]
            chkconfig -e|--edit [names]
            chkconfig -l|--list [--deps] [names]
            chkconfig -a|--add [names]
            chkconfig -d|--del [names]
            DESCRIPTION
            chkconfig  is used to manipulate the runlevel links at boot time
            (see init.d(7)).  It can be thought of as a frontend to insserv(8).
            Chkconfig can run in six different  modes:  terse  list  mode,  set
            mode,  edit mode, list mode, add mode and delete mode. The last three
            modes were added for compatibility reasons
            
4.

How can I stop hwscan from starting at boot time ?

  1. Fire up YAST

  2. Select "System"

  3. Select "Runlevel Editor"

  4. Select "Runlevel Properties"

  5. Select (from list) "hwscan"

  6. Click "Set/Reset"

  7. Select "Disable the service"

  8. Click "Finish"

An alternative procedure is as follows

It's a service called "hwscan", started from the Links in /etc/init.d/rcX.d where X is your runlevel. To see in which runlevels your script is invoked :

# chkconfig -l script
            

Normally you could remove the scripts with:

# insserv -r script
            

in your case:

# insserv -r hwscan