16 Commits

Author SHA1 Message Date
9a10e2124b systemd: replace multi-user with default.target
Replace `multi-user.target` with `default.target` across the code base.
It seems like the multi-user one is not available for (rootless) users
on F35 anymore is causing issues in all kinds of ways, for instance,
enabling the podman.service or generated systemd units.

Fixes: #12438
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-30 14:37:25 +01:00
12d0a85091 systemd: compatible with rootless mode
- change the type to forking to allow fork.
- add default.target for user systemd service

Signed-off-by: Easton Man <manyang.me@outlook.com>
2021-10-20 10:31:13 +08:00
69b6659960 Unit files: Use actual installed path for podman
Don't hardcode /usr/bin/podman in unit files: instead, use
template files with a path replaced at install time.

Because 'make' can be invoked repeatedly, with different
PREFIX, do not leave the generated files behind in our
work directory: wipe them immediately after install.

To get this to work, fix a longstanding bug in podman.spec.in,
a PREFIX that should've been DESTDIR.

Side note: #7023 made contrib/systemd/user a symlink
to .../system but did not update paths in Makefile.
The unrelated-looking path change you see here is
a belated correction for that.

Fixes: #10787

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-10-12 07:57:26 -06:00
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
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
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
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
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
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