为什么 Jetty 启动脚本从基本名称中删除 [SK][0-9]



我阅读了 Jetty 9 启动脚本并发现了这个:

#!/usr/bin/env bash
#
# Startup script for jetty under *nix systems (it works under NT/cygwin too).
##################################################
# Set the name which is used by other variables.
# Defaults to the file name without extension.
##################################################
NAME=$(echo $(basename $0) | sed -e 's/^[SK][0-9]*//' -e 's/.sh$//')
# To get the service to restart correctly on reboot, uncomment below (3 lines):
# ========================
# chkconfig: 3 99 99
# description: Jetty 9 webserver
# processname: jetty
# ========================

我想知道为什么我们应该从NAME中删除 S/K 和数字.

/search/S2jetty.sh =>码头

有人能解释吗?

非常感谢!

这是试图从当前正在运行的初始化脚本中获取名称。

/etc/init.d目录中的链接都以S(用于开始)或K(用于杀死)和数字(用于控制排序顺序)开头。

该字母+数字组合是服务系统的工件,而不是相关服务名称的一部分,因此将删除前缀。

最新更新