docker虚拟机中没有service命令,使用时会报 -bash: service: command not found
安装环境依赖即可
[root@0ca5b90999e6 ~]# yum install initscripts -y
如还不行,使用绝对路径即可
[root@0ca5b90999e6 ~]# whereis service
service: /usr/sbin/service
[root@0ca5b90999e6 ~]# /usr/sbin/service servicename restart|start|stop
--------------------------------end