20 Commits

Author SHA1 Message Date
302b3084eb Restart all containers with restart-policy=always on boot
* Add podman-restart systemd unit file and add it to podman RPM package
* Fix podman start to filter all containers + unit test

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2021-06-13 15:04:34 +03:00
9738f63bac auto-update service: prune images
Extend the systemd auto-update service to prune images after an update
has run.  As reported by a user [1], auto updates can over time cause
the disk to run out of space.  With Edge being a target use case, we
need to make sure that systems can run without much supervision, so
let's make sure to run `podman image prune` to clean up dangling images.

[1] https://twitter.com/r_isc_y/status/1388981737011793921

Fixes: #10190
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-14 14:32:43 +02:00
afb7afe2f1 podman.service should be an exec service not a notify service
Podman never notifies sytemd that it is ready to recieve connections
so systemd kills it after waiting 1.5 minutes.  Changing to exec
should leave it running until podman exits or the service is stopped.

https://github.com/containers/podman/issues/8751

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-16 13:20:39 -05:00
d8795a36b2 Make podman service log events
* Log endpoint calls at level Info
* Ensure API server started at level Info

Fixes #8390

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-11-19 14:42:56 -07:00
e362d438b2 Set podman-auto-update.service Type=oneshot
Signed-off-by: Vilgot Fredenberg <vilgot@fredenberg.xyz>
2020-11-13 11:10:36 +01:00
0f4e2be073 podman.service: use sdnotiy
Commit 2b6dd3fb4384 set the killmode of the podman.service to the
systemd default which ultimately lead to the problem that systemd
will kill *all* processes inside the unit's cgroup and hence kill
all containers whenever the service is stopped.

Fix it by setting the type to sdnotify and the killmode to process.
`podman system service` will send the necessary notify messages
when the NOTIFY_SOCKET is set and unset it right after to prevent
the backend and container runtimes from jumping in between and send
messages as well.

Fixes: #7294
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-08-13 17:53:59 +02:00
7dadf1b46e podman.service: drop install section
podman.service is socket activated through podman.socket. It should not
have its own [Install] section, it does not make sense to systemctl
enable podman.service.

This leads to podman.service always running on a Debian system, as
Debian's policy is to enable/start running services by default.

We don't want a daemon :^)

Fixes: #7190
Reported-by: @martinpitt
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-08-03 09:48:13 +02:00
a5e37ad280 Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
38bb6756b8 podman.service: set type to simple
Set the type of the podman.service to simple.  This will correctly
report the status of the service once it has started.  As a oneshot
service, it does not transition from the startup state to running.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:42:49 +02:00
0f22b69c03 podman.service: set doc to podman-system-service
podman-api(1) does not exist, so set the man page to
podman-system-service(1).  Same for the .socket.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:42:02 +02:00
21665cbfa6 podman.service: use default registries.conf
Do not hard-set the registries.conf to `/etc/containers/registries.conf`.
Podman (and other c/image users) already default to it.  However,
ordinary non-root users should still be able to use the configs in their
home directories which is now possible.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:40:46 +02:00
2b6dd3fb43 podman.service: use default killmode
Do not set the killmode to process as it only kills the main process and
leaves other processes untouched.  Just remove the line and use the
default cgroup killmode which will kill all processes in the service's
cgroup.

Fixes: #7021
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:40:46 +02:00
2e6946c777 podman.service: remove stop timeout
Remove the stop timeout from the unit.  As unit does not specify any
stop command, the timeout is effectively 0 and a NOOP.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:40:46 +02:00
9312d458b4 systemd: symlink user->system
Symlink the user to the system services in `contrib/systemd`.
There is no diference between the services, so we can reduce
redundancy while not breaking downstream packages which might
already be referencing `./contrib/systemd/user`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:12:41 +02:00
f4e873c4e1 auto updates
Add support to auto-update containers running in systemd units as
generated with `podman generate systemd --new`.

`podman auto-update` looks up containers with a specified
"io.containers.autoupdate" label (i.e., the auto-update policy).

If the label is present and set to "image", Podman reaches out to the
corresponding registry to check if the image has been updated.  We
consider an image to be updated if the digest in the local storage is
different than the one of the remote image.  If an image must be
updated, Podman pulls it down and restarts the container.  Note that the
restarting sequence relies on systemd.

At container-creation time, Podman looks up the "PODMAN_SYSTEMD_UNIT"
environment variables and stores it verbatim in the container's label.
This variable is now set by all systemd units generated by
`podman-generate-systemd` and is set to `%n` (i.e., the name of systemd
unit starting the container).  This data is then being used in the
auto-update sequence to instruct systemd (via DBUS) to restart the unit
and hence to restart the container.

Note that this implementation of auto-updates relies on systemd and
requires a fully-qualified image reference to be used to create the
container.  This enforcement is necessary to know which image to
actually check and pull.  If we used an image ID, we would not know
which image to check/pull anymore.

Fixes: #3575
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-17 17:18:56 +01:00
e894bfe6a4 [CI:DOCS]update contrib systemd user
one more update

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-06 16:05:49 -06:00
f2d6e711c7 [CI:DOCS]fix systemd files for apiv2
the paths and instructions for running the new api via systemd needed updates due to a change in the command.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-06 15:34:09 -06:00
5190407619 Assure validate includes lint
Fixed issue where lint was not run on CI, so we missed to prevent regressions.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2020-01-30 18:39:56 +00:00
4ab6a10d0c Add link from docker.sock to podman.sock
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-27 09:52:25 -05:00
89678ab0ed Add APIv2 CLI example POC
* Add ReadMe, CLI and unit files to support socket activation, both for
  system and rootless

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-01-15 09:13:45 -07:00