欢迎来到飞鸟慕鱼博客,开始您的技术之旅!
当前位置: 首页知识笔记正文

Title: Reprinted 《Starting and Stoping Services: insserv》

墨初 知识笔记 30阅读

h2>Starting and Stoping Services SUSE uses insserv to control run-level links automatically. This section attempts to solve the problems related to creating and maintaining run-level links. 1. How to start the service at boot time? 2. Why does my run-level symbolic link change order? I can't find chkconfig. Where is it? 4. How to prevent hwscan from starting at startup?1.: How do I start the service at startup?/strong>startup service : $ insserv named stop service startup : $ insserv -r named

Note

You can also use the YaST Control Center-System-Runtime Editor Runtime Properties to view the detailed explanation in the insserv(8) man page. in serv(8)Su SE 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 /span/span/span/span> # 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 /span/span/span/span> 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.

/span/span/spantd align="left/span/span/spana target="_blank/span/span/span/astrong>2./td> /span/span/span>

Why do my runlevel symlinks change order ?

tr class="answer/span/span/spantd align="left/span/span/spanstrong/strong/td> /span/span/span>

"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).

/span/span/span>

/span/span/span>Tip

Have a look at /span/span/span>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...

tr class="question/span/span/spantd align="left/span/span/spana target="_blank/span/span/span/astrong>3./td> /span/span/span>

I can't find chkconfig where is it ?

tr class="answer/span/span/spantd align="left/span/span/spanstrong/strong/td> /span/span/span>
/span/span/span>

Applies to SuSE 8.0

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

/span/span/span>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
            
/span/span>/p> tr class="question/span/span/spantd align="left/span/span/spana target="_blank/span/span/span/astrong>4./td> /span/span/span>

How can I stop hwscan from starting at boot time ?

tr class="answer/span/span/spantd align="left/span/span/spanstrong/strong/td> /span/span/span>
/span/span/span> li>

Fire up YAST

  • Select "System"

  • Select "Runlevel Editor"

  • Select "Runlevel Properties"

  • Select (from list) "hwscan"

  • Click "Set/Reset"

  • Select "Disable the service"

  • Click "Finish"

  • /div>

    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 :

    /span/span/span># chkconfig -l script
                

    Normally you could remove the scripts with:

    /span/span/span># insserv -r script
                

    in your case:

    /span/span/span># insserv -r hwscan
                
    div class="clear/span/span/span/div>
    标签:
    声明:无特别说明,转载请标明本文来源!