使用:Ubuntu Server 14.04 x64 LXD 2.0.0
我有几个容器(它们都在运行“高寒边缘”),在这些容器中我运行的是lighttpd + mysql。
问题是,每次重新启动容器时,都必须手动重新启动这些服务,因为它们不会自动启动。
我该怎么做才能解决这个问题?
我暂时使用的方法是:
lxc exec alpine-edge service lighttpd start
来自父操作系统( init脚本中)。但是我认为应该有一种方法可以在容器内自动执行,所以如果我手动重新启动它(容器),我就不必每次执行该命令。
发布于 2016-05-25 10:50:08
阿尔卑斯Linux使用作为init系统。。与其交互的基本命令是
rc-update add <service> [runlevel]将service添加到init序列(类似于Ubuntu15.04和forward中的systemd's systemctl enable <service> );
rc-update del <service> [runlevel]阻止service在系统init期间启动(类似于systemd's systemctl disable <service>);
rc-service <service> [start stop restart]管理当前正在运行的服务(类似于systemd的S systemctl [start stop restart] <service>,或相当于systemd和OpenRC工作的/etc/init.d/service [start stop restart] )。
更多信息可以在上面链接到的阿尔卑斯Wiki页面上找到,OpenRC-systemd翻译的备忘单是可用的这里。
https://askubuntu.com/questions/774013
复制相似问题