-bash: service: command not found

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

你可能感兴趣的:(linux常用基础技能及服务,not,found,-bash)