4 Commits

Author SHA1 Message Date
f18d2751f6 correct the absolute path of rm executable
Signed-off-by: Yuan-Hao Chen <yhchen0906@gmail.com>
2020-06-19 22:23:35 +08:00
e5c3432944 generate systemd: ExecStopPost for all units
Add an `ExecStopPost` run even for units generated without `--new`.
Although it may seem redundant to run `container/pod stop` twice at
first glance, we really need the post run.  If the main PID (i.e.,
conmon) is killed, systemd will not execute `ExecStop` but only the
post one.  We made this obeservation in a customer issue and could
reproduce the behavior consistently.  Hence, the post run is needed
to properly clean up when conmon is killed and it's pretty much a
NOP in all other cases.

Credits to Ulrich Obergfell for throrough and detailed analyses,
which ultimately lead to this fix.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-17 18:52:44 +02:00
6118ab4948 generate systemd: --replace on named containers/pods
Use `--replace` for named containers and pods.  This will clean up
previous containers and podsthat may not have been removed after a
system crash.

Fixes: #5485
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-15 15:56:02 +02:00
8d8746adee generate systemd: create pod template
Create a new template for generating a pod unit file. Eventually, this
allows for treating and extending pod and container generation
seprately.

The `--new` flag now also works on pods.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00