使用Docker的服务启动/停止

时间:2015-10-30 14:15:14

标签: mongodb ubuntu docker ubuntu-14.04

我有一个正在运行的docker容器,我想执行:

Runnable

我想知道为什么我有这个输出:

service mongod status/start/stop ..etc

更新

这是没有bash -c的命令的输出:

sudo docker exec 29c7bf21111e bash -c "service mongod status"

Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongod status

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the status(8) utility, e.g. status mongod

当我运行另一项服务时:

$ sudo docker exec 29c7bf271d7e service mongod status
[sudo] password for -: 
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongod status

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the status(8) utility, e.g. status mongod

网络工作,因为它显示用法

sudo docker exec 29c7bf271d7e service cron status
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service cron status

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the status(8) utility, e.g. status cron

重新加载网络服务:

sudo docker exec 29c7bf271d7e service networking status
Usage: /etc/init.d/networking {start|stop|reload|restart|force-reload}

0 个答案:

没有答案