Using: Ubuntu Server 14.04 x64
LXD 2.0.0
I have several containers (all of them running "alpine-edge") in which I'm running lighttpd + mysql.
The problem is that each time I restart the containers I have to restart manually those services as they don't start automatically.
What do I need to do to fix that?
UPDATE
The temporally work-around that I'm using is to:
lxc exec alpine-edge service lighttpd start
from the parent OS (inside an init script). But I believe there should be a way to do it automatically inside the container, so if I manually reboot it (the container), I don't have to execute that command each time.
Alpine Linux uses OpenRC for its init system. The basic commands to interact with it are
adds
service
to the init sequence (similarly tosystemd
'ssystemctl enable <service>
in Ubuntu 15.04 and forward);stops
service
from starting during system init (similarly tosystemd
'ssystemctl disable <service>
);manages currently running services (similarly to
systemd
'ssystemctl [start stop restart] <service>
, or equivalently/etc/init.d/service [start stop restart]
which works in bothsystemd
and OpenRC).More information can be found on the Alpine Wiki page I linked to above, and a cheatsheet for OpenRC-
systemd
translation is available here.