我创建了一个新的 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
Run Code Online (Sandbox Code Playgroud)
当我跑步service start foo或service start foo.service
start: unrecognized service
Run Code Online (Sandbox Code Playgroud)
怎么了?Ubuntu 16.04
该service命令将对象放在首位:
service foo start
Run Code Online (Sandbox Code Playgroud)
该systemctl命令执行相反的操作:
systemctl start foo
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14477 次 |
| 最近记录: |