我创建了一个新的 systemd 脚本/etc/systemd/system/foo.service
[Unit]
Description="My foo script"
Before=network-pre.target
Wants=network-pre.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/foo
当我跑步service start foo
或service start foo.service
start: unrecognized service
出了什么问题?Ubuntu 16.04
答案1
该service
命令将目的第一的:
service foo start
这systemctl
命令执行相反的操作:
systemctl start foo