带空格的系统服务名称
Systemd service name with spaces
我在 /etc/systemd/system 中创建了以下服务 - 我的 test.service ,但是当我尝试通过 systemctl start "my test.service"
启动该服务时,该服务没有启动而且它不是 found.How 如果服务名称包含空格,我可以转义吗?
你不能。 systemd.unit(5)
明确说明单位名称中允许使用哪些字符。
Valid unit names consist of a "name prefix" and a dot and a suffix specifying the unit type. The "unit prefix" must consist of one or more valid characters (ASCII letters, digits, ":", "-", "_", ".", and ""). The total length of the unit name including the suffix must not exceed 256 characters. The type suffix must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".slice", or ".scope".
来源(由 JayEye 注明):https://www.freedesktop.org/software/systemd/man/systemd.unit.html
我在 /etc/systemd/system 中创建了以下服务 - 我的 test.service ,但是当我尝试通过 systemctl start "my test.service"
启动该服务时,该服务没有启动而且它不是 found.How 如果服务名称包含空格,我可以转义吗?
你不能。 systemd.unit(5)
明确说明单位名称中允许使用哪些字符。
Valid unit names consist of a "name prefix" and a dot and a suffix specifying the unit type. The "unit prefix" must consist of one or more valid characters (ASCII letters, digits, ":", "-", "_", ".", and ""). The total length of the unit name including the suffix must not exceed 256 characters. The type suffix must be one of ".service", ".socket", ".device", ".mount", ".automount", ".swap", ".target", ".path", ".timer", ".slice", or ".scope".
来源(由 JayEye 注明):https://www.freedesktop.org/software/systemd/man/systemd.unit.html