mirror of
https://github.com/systemd/systemd
synced 2025-11-20 09:14:46 +01:00
Compare commits
4 Commits
28aa0a1f25
...
3b11139c0d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b11139c0d | ||
|
|
1ec5d43a0e | ||
|
|
b8ee7c2206 | ||
|
|
cc814110af |
7
.github/workflows/build-test.sh
vendored
7
.github/workflows/build-test.sh
vendored
@ -47,6 +47,7 @@ PACKAGES=(
|
||||
libxkbcommon-dev
|
||||
libxtables-dev
|
||||
libzstd-dev
|
||||
linux-tools-generic
|
||||
mold
|
||||
mount
|
||||
net-tools
|
||||
@ -143,6 +144,12 @@ sudo apt-get -y install "${PACKAGES[@]}"
|
||||
pip3 install --user -r .github/workflows/requirements.txt --require-hashes --break-system-packages
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
# TODO: drop after we switch to ubuntu 26.04
|
||||
bpftool_dir=$(dirname "$(find /usr/lib/linux-tools/ /usr/lib/linux-tools-* -name 'bpftool' -perm /u=x 2>/dev/null | sort -r | head -n1)")
|
||||
if [ -n "$bpftool_dir" ]; then
|
||||
export PATH="$bpftool_dir:$PATH"
|
||||
fi
|
||||
|
||||
if [[ -n "$CUSTOM_PYTHON" ]]; then
|
||||
# If CUSTOM_PYTHON is set we need to pull jinja2 from pip, as a local interpreter is used
|
||||
pip3 install --user --break-system-packages jinja2
|
||||
|
||||
13
.github/workflows/unit-tests.sh
vendored
13
.github/workflows/unit-tests.sh
vendored
@ -18,6 +18,7 @@ ADDITIONAL_DEPS=(
|
||||
libtss2-dev
|
||||
libxkbcommon-dev
|
||||
libzstd-dev
|
||||
linux-tools-generic
|
||||
python3-libevdev
|
||||
python3-pip
|
||||
python3-pyelftools
|
||||
@ -74,6 +75,12 @@ for phase in "${PHASES[@]}"; do
|
||||
capsh --drop=all -- -c "stat $PWD/meson.build"
|
||||
;;
|
||||
RUN|RUN_GCC|RUN_CLANG|RUN_CLANG_RELEASE)
|
||||
# TODO: drop after we switch to ubuntu 26.04
|
||||
bpftool_dir=$(dirname "$(find /usr/lib/linux-tools/ /usr/lib/linux-tools-* -name 'bpftool' -perm /u=x 2>/dev/null | sort -r | head -n1)")
|
||||
if [ -n "$bpftool_dir" ]; then
|
||||
export PATH="$bpftool_dir:$PATH"
|
||||
fi
|
||||
|
||||
if [[ "$phase" =~ ^RUN_CLANG ]]; then
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
@ -105,6 +112,12 @@ for phase in "${PHASES[@]}"; do
|
||||
TZ=GMT+12 meson test "${MESON_TEST_ARGS[@]}" -C build --print-errorlogs
|
||||
;;
|
||||
RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN_NO_DEPS)
|
||||
# TODO: drop after we switch to ubuntu 26.04
|
||||
bpftool_dir=$(dirname "$(find /usr/lib/linux-tools/ /usr/lib/linux-tools-* -name 'bpftool' -perm /u=x 2>/dev/null | sort -r | head -n1)")
|
||||
if [ -n "$bpftool_dir" ]; then
|
||||
export PATH="$bpftool_dir:$PATH"
|
||||
fi
|
||||
|
||||
MESON_ARGS=(--optimization=1)
|
||||
|
||||
if [[ "$phase" =~ ^RUN_CLANG_ASAN_UBSAN ]]; then
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int get_core_audit_fd(void);
|
||||
void close_core_audit_fd(void);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int clock_reset_timewarp(void);
|
||||
void clock_apply_epoch(bool allow_backwards);
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "conf-parser-forward.h" /* IWYU pragma: export */
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
#include "unit-def.h" /* IWYU pragma: export */
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
typedef enum CrashAction {
|
||||
CRASH_FREEZE,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
typedef enum KillMode {
|
||||
/* The kill mode is a property of a unit. */
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
#include "crash-handler.h"
|
||||
|
||||
extern bool arg_dump_core;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "cgroup.h"
|
||||
#include "common-signal.h"
|
||||
#include "execute.h"
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
#include "log.h"
|
||||
#include "path-lookup.h"
|
||||
#include "show-status.h"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int mac_selinux_setup(bool *loaded_policy);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
/* Manager status */
|
||||
|
||||
|
||||
@ -7,6 +7,6 @@
|
||||
Nathaniel Chen <nathaniel.chen@intel.com>
|
||||
***/
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int mac_smack_setup(bool *loaded_policy);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
/* Flags that identify the various "atomic" behaviours a specific dependency type implies. Each dependency is
|
||||
* a combination of one or more of these flags that define what they actually entail. */
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int unit_cgroup_context_build_json(sd_json_variant **ret, const char *name, void *userdata);
|
||||
int unit_cgroup_runtime_build_json(sd_json_variant **ret, const char *name, void *userdata);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int rlimit_build_json(sd_json_variant **ret, const char *name, void *userdata);
|
||||
int rlimit_table_build_json(sd_json_variant **ret, const char *name, void *userdata);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int vl_method_get_user_record(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata);
|
||||
int vl_method_get_group_record(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
int vl_method_describe_manager(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "core-forward.h"
|
||||
|
||||
#define VARLINK_ERROR_UNIT_NO_SUCH_UNIT "io.systemd.Unit.NoSuchUnit"
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "conf-parser-forward.h" /* IWYU pragma: export */
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "homed-forward.h"
|
||||
#include "pidref.h"
|
||||
#include "stat-util.h"
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
typedef enum HomeSetupFlags HomeSetupFlags;
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "conf-parser-forward.h" /* IWYU pragma: export */
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-forward.h"
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "sd-forward.h" /* IWYU pragma: export */
|
||||
|
||||
typedef enum BusAuth BusAuth;
|
||||
typedef enum BusSlotType BusSlotType;
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "conf-parser-forward.h" /* IWYU pragma: export */
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "list.h"
|
||||
#include "logind-forward.h"
|
||||
#include "time-util.h"
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
typedef struct Machine Machine;
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "firewall-util.h"
|
||||
#include "shared-forward.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "networkd-forward.h"
|
||||
#include "networkd-util.h"
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
#include <linux/neighbour.h>
|
||||
#include <net/ethernet.h>
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "networkd-forward.h"
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "conf-parser-forward.h" /* IWYU pragma: export */
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
#include <linux/nl80211.h>
|
||||
|
||||
#include "ether-addr-util.h"
|
||||
#include "shared-forward.h"
|
||||
#include "network-util.h"
|
||||
#include "networkd-bridge-vlan.h"
|
||||
#include "networkd-forward.h"
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
typedef struct Manager Manager;
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "dns-def.h"
|
||||
#include "shared-forward.h"
|
||||
#include "list.h"
|
||||
#include "ratelimit.h"
|
||||
#include "resolve-util.h"
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "list.h"
|
||||
#include "resolved-conf.h"
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "list.h"
|
||||
#include "resolved-dns-packet.h"
|
||||
#include "resolved-dnstls.h"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "resolved-forward.h"
|
||||
|
||||
extern const BusObjectImplementation dnssd_object;
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "conf-parser-forward.h" /* IWYU pragma: export */
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "common-signal.h"
|
||||
#include "shared-forward.h"
|
||||
#include "list.h"
|
||||
#include "resolve-util.h"
|
||||
#include "resolved-dns-browse-services.h"
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
typedef struct Context Context;
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "conf-parser-forward.h" /* IWYU pragma: export */
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "udev-forward.h"
|
||||
#include "udev-event.h"
|
||||
|
||||
typedef struct UdevBuiltin {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "udev-forward.h"
|
||||
|
||||
int device_add_errno(sd_device *dev, int error);
|
||||
int device_add_exit_status(sd_device *dev, int status);
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include "shared-forward.h" /* IWYU pragma: export */
|
||||
|
||||
typedef struct UdevCtrl UdevCtrl;
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "list.h"
|
||||
#include "udev-config.h"
|
||||
#include "udev-forward.h"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "udev-forward.h"
|
||||
|
||||
int udev_node_apply_permissions(
|
||||
sd_device *dev,
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include "device-private.h"
|
||||
#include "device-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "shared-forward.h"
|
||||
#include "udev-forward.h"
|
||||
|
||||
/* Each trace point can have different number of additional arguments. Note that when the macro is used only
|
||||
* additional arguments are listed in the macro invocation!
|
||||
|
||||
@ -301,6 +301,7 @@ testcase_reload() {
|
||||
testcase_kernel_oom() {
|
||||
cat >/tmp/script.sh <<"EOF"
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
choom --adjust '+1000' -- bash -c 'echo f >/proc/sysrq-trigger && exec sleep infinity'
|
||||
choom --adjust '+1000' -p $$
|
||||
echo f >/proc/sysrq-trigger
|
||||
@ -324,12 +325,22 @@ EOF
|
||||
|
||||
cat >/tmp/script.sh <<"EOF"
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
echo '+memory' >/sys/fs/cgroup/system.slice/oom-kill.service/cgroup.subtree_control
|
||||
mkdir /sys/fs/cgroup/system.slice/oom-kill.service/sub
|
||||
echo 1 >/sys/fs/cgroup/system.slice/oom-kill.service/sub/memory.oom.group
|
||||
echo $$ >/sys/fs/cgroup/system.slice/oom-kill.service/sub/cgroup.procs
|
||||
choom --adjust '+1000' -p $$
|
||||
echo f >/proc/sysrq-trigger
|
||||
|
||||
# Start a child process in the subcgroup that will trigger OOM and be killed but keep the main process
|
||||
# outside the subcgroup to avoid a race condition where the kernel SIGKILLs the main process before systemd
|
||||
# can process the OOM notification. With the main process still alive, systemd should have time to receive
|
||||
# the OOM event and enter the 'oom-kill' state before the service exits.
|
||||
(
|
||||
echo $BASHPID >/sys/fs/cgroup/system.slice/oom-kill.service/sub/cgroup.procs
|
||||
choom --adjust '+1000' -p $BASHPID
|
||||
echo f >/proc/sysrq-trigger
|
||||
exec sleep infinity
|
||||
) &
|
||||
wait $! || :
|
||||
exec sleep infinity
|
||||
EOF
|
||||
chmod +x /tmp/script.sh
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user