-
进程管理systemd的一处使用这里想让系统启动时,执行一些简单任务。终端下输入
sudo -i切换到Ubuntu ROOT用户角色下, 执行vi /media/state/units/hello.service,敲入如下内容:
[Unit] Description=My Service After=docker.service [Service] Restart=always ExecStart=/usr/bin/docker run ubuntu /bin/sh -c "while true; do echo Hello World; sleep 1; done" [Install] WantedBy=local.target保存之后,我们需要做到模拟重启:
systemctl restart local-enable.service现在查看一下日志,可以看到其输出:
journalctl -u hello.service -f更多systemd细节,请参考http://www.freedesktop.org/wiki/Software/systemd/。
6.本次浅尝辄止,到此结束
总体看,CoreOS最大特色,专门为大规模服务器部署定制的Linux精简系统,尽可能的精简无关紧要的功能,将操作系统和应用程序完全分离,从而降低操作系统和应用程序的耦合度,同时解决了现有Linux服务器在容器资源、权限管理方面的欠缺。目前若说是颠覆性的操作系统,十分牵强,是不是未来,也不好说,但肯定是一种趋势。
因此,十分值得期待。
CoreOS 的详细介绍:请点这里
CoreOS 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-07/104807.htm


