public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] openrc-run for containers
@ 2021-05-12 19:17 Damo
  2021-05-23 21:15 ` [gentoo-user] " Damo
  2021-05-25  3:51 ` Damo
  0 siblings, 2 replies; 3+ messages in thread
From: Damo @ 2021-05-12 19:17 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

Hi,

I've been running docker containers for a while, where I pass
"--restart=always" into the run command, so the containers restart
automatically after reboot. I want to have more control over the startup
order of the containers, ie integrate into openrc start/stop and put into
different runlevels.

I've had mixed success so far. I would be interested if someone else has
working solution. My runlevels look something like this:

rl100
  container.registry
rl90
  container.auth
  container.router
boot
 ...

FYI, i've found systemd is doing it nicely, where systemctl start/stop
<CONTAINER> works as I would expect. I see a hardcoded dependency into the
container PID in the unit file (podman in this case):

[root@]# cat /usr/lib/systemd/system/container-libvirt-exporter.service

#

[Unit]
Description=Podman container-libvirtd-exporter.service
Documentation=man:podman-generate-systemd(1)

[Service]
Restart=always
ExecStart=/usr/bin/podman start libvirtd-exporter
ExecStop=/usr/bin/podman stop -t 10 libvirtd-exporter
KillMode=none
Type=forking
PIDFile=/var/run/containers/storage/overlay-containers/9037e389e61ed01eb5dfce16fa750b6f0f01827a67640e4748e6527bbfcb6276/userdata/conmon.pid

[Install]
WantedBy=multi-user.target


Kind regards,
Damo

[-- Attachment #2: Type: text/html, Size: 1534 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-25  3:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-12 19:17 [gentoo-user] openrc-run for containers Damo
2021-05-23 21:15 ` [gentoo-user] " Damo
2021-05-25  3:51 ` Damo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox