20 Commits

Author SHA1 Message Date
941a6d0c05 pkg/signal: ignore SIGTOP for signal proxy
It makes no sense to forward it, SIGSTOP cannot be handled by
userspace (like SIGKILL) and it didn't do anything before so this just
makes it more explicit.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-04-30 19:43:13 +02:00
a4d0067249 pkg/signal: rework CatchAll() behavior
Instead of catching all signals and then ignoring them inside the loop
again just don't register them in Notify() to begin with.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-04-30 19:42:15 +02:00
90e6478cf8 refacto: unknown signal return signal number without prefix
Signed-off-by: Florian Bezannier <florian.bezannier@hotmail.fr>
2024-02-28 19:45:03 +01:00
585af039d7 feat: allow compatibility with podman v4 machine
Signed-off-by: Florian Bezannier <florian.bezannier@hotmail.fr>
2024-02-28 19:45:03 +01:00
2a2d0b0e18 chore: delete obsolete // +build lines
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 11:53:38 +02:00
efbad590d7 Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-04 10:57:41 -04:00
7cfe0328f1 Add support to sig-proxy for podman-remote
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2022-09-20 22:52:45 +03:00
66c62eb968 Implement CatchAll and StopCatch in signal_common.go
This is part of a set of changes to port podman to the FreeBSD platform.
The pkg/signal parts are needed to enable ABI mode on FreeBSD. No tests
are needed here because it should be a functional no-op for linux.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-27 13:27:12 +01:00
70f147d019 cmd/podman/common/completion.go: fix FIXMEs
There is no good way to recommend labels for podman container runlabel.

Add the missing max-size log option. These are the only documented
options so the completion should not suggest something different.

Add proper --stop-signal completion. It will now complete all supported
signal names both upper and lowercase depending on the user input. Also
it work with and without the SIG prefix.

Fixing the TODOs in this file are more complicated since they describe
bigger features.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-05-24 17:56:37 +02:00
ecd245d8fd Unit tests for pkg/specgenutil pkg/signal
Add some lightweight unit tests to the arsenal.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-04-25 14:48:39 -05:00
6c030cd573 fix a number of godot issues
Still an unknown number remains but I am running out of patience.
Adding dots is not the best use of my time.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-22 13:04:35 +01:00
ea08765f40 go fmt: use go 1.18 conditional-build syntax
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-18 09:11:53 +01:00
edc62b5294 Fixes TTY & resizing on Mac and Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-12 12:00:38 -06:00
9dfc636fd6 Fix build for mips architecture follow-up
Follow-up to commit (1ad796677e1c). The build on mips is still
failing because SIGWINCH was not defined in the signal pkg.
Also stat_t.Rdev is unit32 on mips so we need to typecast.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-07 15:04:22 +01:00
1ad796677e Fix build for mips architecture
The signal SIGSTKFLT does not exists on mips architectures.
Also RTMIN and RTMAX are different.

This code is copied from docker.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-21 15:55:18 +01:00
200cfa41a4 Turn on More linters
- misspell
    - prealloc
    - unparam
    - nakedret

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-15 07:05:56 -04:00
e0eb6022b3 Ensure that signal names can be parsed on Windows
To ensure the Windows and OS X remote clients can properly parse
container stop signal (when given as a name e.g. SIGTERM) and
set it in SpecGen, we need access to a list of Linux signal names
and the numbers they map to that is available on non-Linux OSes.
Fortunately, these are ABI constants that are extremely unlikely
to change, so we can just take the existing constant definitions
from the library and use them.

The signal numbers used here are sourced from AMD64, but should
be the same for every architecture that is not Alpha, SPARC,
MIPS, and PA-RISC. So `podman run --stop-signal SIGTTOU` from a
Windows client to a Podman service on a SPARC host will set an
incorrect stop signal, but I don't think this is a large problem.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-28 14:26:36 -04:00
90ead05903 Fixes for load and other system tests
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-13 13:08:04 -05:00
9536560b4f podmanv2 add core container commands
add core container commands for podmanv2: kill, pause, restart, rm, stop, unpause

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-22 13:24:45 -05:00
85b7374491 add pkg/signal
Add pkg/signal to deal with parts of signal processing and translating
signals from string to numeric representations.  The code has been
copied from docker/docker (and attributed with the copyright) but been
reduced to only what libpod needs (on Linux).

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-14 15:04:14 +01:00