为什么要在Required-start 中设置与init.d 脚本中的Required-stop 相同的值?

Kit*_*nde 2 debian init.d

Debian wiki为“INIT INFO”提供了以下示例:

### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO
Run Code Online (Sandbox Code Playgroud)

然后文档说明了有关Required-stop的以下内容:

必需停止:boot_facility_1 [boot_facility_2...]

定义由脚本提供的服务使用的设施。此脚本提供的工具应在列出的工具停止之前停止以避免冲突。通常,您会在此处包含与 Required-Start 关键字相同的功能。

Required-Start如果在设施停止之前它不会运行,那么设置相同的值不是毫无意义吗?

Arr*_*ter 5

必需停止:boot_facility_1 [boot_facility_2...]

定义由脚本提供的服务使用的设施。此脚本提供的工具 应在列出的工具停止之前停止以避免冲突。通常,您会在此处包含与 Required-Start 关键字相同的功能。

Required-Stop用于指示在停止当前脚本提供的设施之前不应停止列出的设施。

例如,这是为了防止 $remote_fs 被停止,并且在您的数据库服务器有机会安全关闭并将数据库正确保存到文件系统之前,您的 NFS 挂载 /usr 和 /var 被卸载。