下面例子出自 /etc/init.d/esound:
# 1995-2002, 2008 SUSE Linux Products GmbH, Nuernberg, Germany. # All rights reserved. # # Author: Stanislav Brabec, feedback to
http://www.suse.de/feedback # ### BEGIN INIT INFO # Provides: esound # Required-Start: alsasound $remote_fs # Should-Start: $network $portmap # Required-Stop: alsasound $remote_fs # Should-Stop: $network $portmap # Default-Start: 5 # Default-Stop: # Short-Description: Sound daemon with network support # Description: Starts esound server to allow remote access to sound # card. To use esound locally, you do not need to start this # server on boot. You should edit server settings before # starting it via sysconfig editor: Network/Sound/Esound ### END INIT INFO
LSB 头部由以下几个部分组成:
# Provides: 行
LSB 头部的 # Provides: 行列出了所有本脚本服务能提供的引导设施。其他的服务可以在它们的 # Required-Start: 和 # Required-Stop: 行中引入我们提供的这些引导设施。 引导设施通常是守护程序的名字。如果多个软件包提供了相同的引导设施(例如 sendmail vs. postfix, dhcpcd vs. dhclient),两者的启动脚本应该提供相同的引导设施名。
# Provides: boot_facility_1 [boot_facility_2...]
当启动脚本带着一个 start 开始参数运行时,即 /etc/init.d/NetworkManager start 这样,Provides 关键词指定的引导设施(们)就被视为可用的,因此其他要求这些引导设施的启动脚本就可以随后启动。当启动脚本带着一个 stop 停止参数运行时,即 /etc/init.d/NetworkManager stop 这样,Provides 关键词指定的引导设施就被视为不再可用。