<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ann
    冰是沒有未來的,因為它的永恒
    posts - 107,comments - 34,trackbacks - 0
    Manipulating the start and stop order of Linux servicesThis document (7002295) is provided subject to the disclaimer at the end of this document.

    Environment
    Novell SUSE Linux
    Novell SUSE Linux Enterprise Server 9
    Novell SUSE Linux Enterprise Server 10
    Novell SUSE Linux Enterprise Desktop 10

    Situation
    In some circumstances, the start and stop order of a service needs to be manipulated. 
    How to add start and stop orders to a custom service

    Resolution
    Under the LSB (Linux Standards Base), the start and stop order of services is controlled using the "insserv" package. Unlike Netware, DOS and other operating systems, SUSE calculates the start and stop orders based on dependencies. This idiosyncrasy of Linux has the distinct advantage of providing a faster boot time, but does make things a little more complex.  

    The start and stop scripts are found in /etc/init.d. In the header for the script, you should see something similar:

    ### BEGIN INIT INFO# Provides:        myService# Required-Start: $network# Should-Start: # Required-Stop:# Should-Stop:# Default-Start:  2 3 5# Default-Stop:# Description:    Example Service### END INIT INFO
    If the script lacks the information above (such as a custom script) then you can add it. All LSB-compliant scripts should have a similar header. The only files that should not have this header are any of the .depend.* and boot.local, and after.local.

    The comments above are used by the insserv package to define what the service needs. The "Provides:" line is a pseudo name that can be referenced in other scripts in the "Required-Start," "Should-Start," "Required-Stop," and "Should-Stop" fields. 

    There are ways to manipulate certain services. 

    "$" before a service name refers to a group of services that comprise the pseudo name. These are defined in /etc/insserv.conf. 

    "$ALL" is a reserved name that will make a service run last
    "+" means that the service is optional or that failure of the service will not prevent the referencing service from starting or stopping
    warning

    Do NOT modify the .depend.* files in /etc/init.d directly. Doing so can render a system unbootable. 

    In /etc/init.d/rc?.d directories have the order of the start and stop. The first letter and subsequent two numbers in the name of the file will define the start and stop order. For example, S05myService and S05myService2 would be started at the same time; S05myService and S06myService2 would mean that myService would start before myService2. There is a tendency to manipulate the number of these files directly. This IS NOT advised. Anytime you run "chkconfig" or "insserv" these files will be renamed. It is much better use the LSB method. 

    examples

    Here are few examples of how to manipulate the header of a service defined in /etc/init.d. 

    The following example will start Service "myService" after the network has loaded and will automatically start the service "myOtherService"

    ### BEGIN INIT INFO# Provides:        myService# Required-Start: $network# Should-Start:   myOtherService# Required-Stop:# Should-Stop:# Default-Start:  2 3 5# Default-Stop:# Description:    Example Service### END INIT INFO

    The following example will start the service "myService" last

    ### BEGIN INIT INFO# Provides:        myService# Required-Start: $ALL# Should-Start: # Required-Stop:# Should-Stop:# Default-Start:  2 3 5# Default-Stop:# Description:    Example Service### END INIT INFO
    The following example will start the service "myService" after the network and the optional component "myOtherService"

    ### BEGIN INIT INFO# Provides:        myService# Required-Start: $network +myOtherService# Should-Start: # Required-Stop:# Should-Stop:# Default-Start:  2 3 5# Default-Stop:# Description:    Example Service### END INIT INFO
    defining pseudo services

    In /etc/insserv.conf, pseudo service that are referenced with the "$" in the service scripts are defined. In the event that you need to add a collection of service scripts and reference them only once, they can be added to the insserv.conf file. This is useful for customization to certain environments. 

    For example, if you want to run your firewall rule script every time the network is started, you can modify /etc/insserv.conf to make $network reference "network" and "myFirewall." Assuming that there is a valid script in /etc/init.d with the permissions of 0755, you would change it from:

    $network   network

    to 

    $network   network   myFirewall


    There is one special keyword in the file -- 
    <interactive>. Any service name with <interactive> will require user intervention. 

    making the services run sequentially

    In order to speed the boot process, services are started and stopped in parallel. Under the vast majority, there is no reason to change this behavior. However, if there are problems with this you can change /etc/sysconfig/boot -- simply find the parameter RUN_PARALLEL="YES" to "NO"

    making the changes effective

    After changing the script, you need to run two commands. Replace "myService" with the name of the file you modified. 

    insserv myService
    chkconfig myService on 

    changing novell and third-party provided services

    When changing any provided script from either Novell or a third-party, the changes may and most likely will be over written during a service pack upgrade or a new version of the service. Generally Novell does not release a new version of the /etc/init.d scripts, but it may happen from time to time. 

    adding a custom script

    When a custom script, the permissions of the file need to be 0755 (-rwxr-xr-x).







    Document
    Document ID: 7002295 
    Creation Date: 01-06-2009 
    Modified Date: 01-06-2009 
    Novell Product: SUSE Linux Enterprise Desktop 
    Novell Product: SUSE Linux Enterprise Real Time 
    Novell Product: SUSE Linux Enterprise Server 

    Disclaimer
    The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information. 
    Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.

    posted on 2009-06-30 17:05 冰是沒有未來的,因為它的永恒 閱讀(423) 評論(0)  編輯  收藏 所屬分類: linux

    當下,把心放下 放下如果是可能的,那一定是在當下,
    不在過去,也不在未來。
    當下放下。唯有活在當下,你的問題才能放下。

    主站蜘蛛池模板: 亚洲风情亚Aⅴ在线发布| 国产又大又黑又粗免费视频| 亚洲色大成网站www永久一区 | 成人亚洲综合天堂| 亚洲人成电影网站免费| 免费毛片在线视频| 精品亚洲国产成人av| 成人爱做日本视频免费| 爱爱帝国亚洲一区二区三区| 免费在线观看亚洲| 成av免费大片黄在线观看| 亚洲精品无码鲁网中文电影| 中文字幕免费不卡二区| 老司机亚洲精品影院| 免费能直接在线观看黄的视频| 亚洲午夜在线一区| 日韩成全视频观看免费观看高清 | 亚洲成网777777国产精品| h视频在线免费观看| 久久亚洲精品中文字幕无码| 免费在线视频你懂的| 国产产在线精品亚洲AAVV| 伊人亚洲综合青草青草久热| 无码国产精品一区二区免费16| 亚洲不卡中文字幕| 九月婷婷亚洲综合在线| 韩国免费a级作爱片无码| 亚洲熟妇av一区| 国产一级理论免费版| 久久精品成人免费观看| 亚洲中文字幕久久无码| 综合亚洲伊人午夜网 | 亚洲av乱码中文一区二区三区| 亚洲AV成人潮喷综合网| 先锋影音资源片午夜在线观看视频免费播放| 久久久亚洲AV波多野结衣| 国产hs免费高清在线观看| 中文字幕久精品免费视频 | 猫咪免费人成在线网站| 久久亚洲日韩精品一区二区三区 | 日韩午夜理论免费TV影院|