我的 Docker 容器似乎没有service命令。我将如何重新启动nginx?
例如
# uname -r
3.13.0-119-generic
bash-4.3# uname -a
Linux <container id> 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 Linux
bash-4.3# service nginx restart
bash: service: command not found
Run Code Online (Sandbox Code Playgroud)
这取决于您的容器运行的是 systemd、sysV 还是 upstart。
此时有效的选择是
/etc/init.d/nginx restart
Run Code Online (Sandbox Code Playgroud)
和
systemctl restart nginx
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11536 次 |
| 最近记录: |