From cd001016a166bb849c454e7b5cdb58053f34935b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 9 Mar 2018 08:56:23 +0100 Subject: [PATCH 1/3] meson: add note about coreutils version with ln --relative https://bugs.freedesktop.org/show_bug.cgi?id=90799 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 30b7f1bafa..e25d2f1399 100644 --- a/meson.build +++ b/meson.build @@ -604,7 +604,7 @@ endforeach conf.set_quoted('TELINIT', get_option('telinit-path')) if run_command('ln', '--relative', '--help').returncode() != 0 - error('ln does not support --relative') + error('ln does not support --relative (added in coreutils 8.16)') endif ############################################################ From 8750ac02381be5f0b3ebbcc0131779553fa7ce52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 9 Mar 2018 09:32:03 +0100 Subject: [PATCH 2/3] pid1: make use of high rt signals on hppa with newer kernels Back in 4dffec1459f50ac9f8f67ccfcb79836b4ed5a50e we stopped using SIGRTMIN+26 and higher on hppa because they were not available. Then they became available in linux 3.18: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1f25df2eff5b25f52c139d3ff31bc883eee9a0ab Instead of hard-coding the list based on architecture, let's use a runtime check like signal(7) says. (A note about implementation: RTSIG_IF_AVAILABLE is defined to take the full signal and not just an offset from SIGRTMIN so that it's still possible to grep for SIGRTMIN\+.) Add a simple "test" to print the signal values. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=84931. --- src/core/manager.c | 28 +++++++++++++++------------- src/test/test-signal-util.c | 12 ++++++++++++ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/core/manager.c b/src/core/manager.c index 84adb9c666..3c662ffdef 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -426,6 +426,8 @@ static int enable_special_signals(Manager *m) { return 0; } +#define RTSIG_IF_AVAILABLE(signum) (signum <= SIGRTMAX ? signum : -1) + static int manager_setup_signals(Manager *m) { struct sigaction sa = { .sa_handler = SIG_DFL, @@ -479,22 +481,22 @@ static int manager_setup_signals(Manager *m) { /* .. one free signal here ... */ -#if !defined(__hppa64__) && !defined(__hppa__) - /* Apparently Linux on hppa has fewer RT - * signals (SIGRTMAX is SIGRTMIN+25 there), - * hence let's not try to make use of them - * here. Since these commands are accessible - * by different means and only really a safety - * net, the missing functionality on hppa - * shouldn't matter. */ + /* Apparently Linux on hppa had fewer RT signals until v3.18, + * SIGRTMAX was SIGRTMIN+25, and then SIGRTMIN was lowered, + * see commit v3.17-7614-g1f25df2eff. + * + * We cannot unconditionally make use of those signals here, + * so let's use a runtime check. Since these commands are + * accessible by different means and only really a safety + * net, the missing functionality on hppa shouldn't matter. + */ - SIGRTMIN+26, /* systemd: set log target to journal-or-kmsg */ - SIGRTMIN+27, /* systemd: set log target to console */ - SIGRTMIN+28, /* systemd: set log target to kmsg */ - SIGRTMIN+29, /* systemd: set log target to syslog-or-kmsg (obsolete) */ + RTSIG_IF_AVAILABLE(SIGRTMIN+26), /* systemd: set log target to journal-or-kmsg */ + RTSIG_IF_AVAILABLE(SIGRTMIN+27), /* systemd: set log target to console */ + RTSIG_IF_AVAILABLE(SIGRTMIN+28), /* systemd: set log target to kmsg */ + RTSIG_IF_AVAILABLE(SIGRTMIN+29), /* systemd: set log target to syslog-or-kmsg (obsolete) */ /* ... one free signal here SIGRTMIN+30 ... */ -#endif -1); assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c index f4b19ed69d..d264082478 100644 --- a/src/test/test-signal-util.c +++ b/src/test/test-signal-util.c @@ -21,10 +21,21 @@ #include #include +#include "log.h" #include "macro.h" #include "signal-util.h" #include "process-util.h" +#define info(sig) log_info(#sig " = " STRINGIFY(sig) " = %d", sig) + +static void test_rt_signals(void) { + info(SIGRTMIN); + info(SIGRTMAX); + + /* We use signals SIGRTMIN+0 to SIGRTMIN+24 unconditionally */ + assert(SIGRTMAX - SIGRTMIN >= 24); +} + static void test_block_signals(void) { sigset_t ss; @@ -62,6 +73,7 @@ static void test_ignore_signals(void) { } int main(int argc, char *argv[]) { + test_rt_signals(); test_block_signals(); test_ignore_signals(); From 6fdbb3c8218ed6a5a2b510508afab9653a330878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 9 Mar 2018 10:20:52 +0100 Subject: [PATCH 3/3] man: beef up description of systemctl list-units Fixes https://bugs.freedesktop.org/show_bug.cgi?id=88135. --- man/systemctl.xml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/man/systemctl.xml b/man/systemctl.xml index 1588ca719d..3d641fa18d 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -692,6 +692,42 @@ that are shown are additionally filtered by and if those options are specified. + Produces output similar to + UNIT LOAD ACTIVE SUB DESCRIPTION + sys-module-fuse.device loaded active plugged /sys/module/fuse + -.mount loaded active mounted Root Mount + boot-efi.mount loaded active mounted /boot/efi + systemd-journald.service loaded active running Journal Service + systemd-logind.service loaded active running Login Service +● user@1000.service loaded active running User Manager for UID 1000 +... + systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories + +LOAD = Reflects whether the unit definition was properly loaded. +ACTIVE = The high-level unit activation state, i.e. generalization of SUB. +SUB = The low-level unit activation state, values depend on unit type. + +123 loaded units listed. Pass --all to see loaded but inactive units, too. +To show all installed unit files use 'systemctl list-unit-files'. + + The header and the last unit of a given type are underlined if the + terminal supports that. A colored dot is shown next to services which + were masked, not found, or otherwise failed. + + The LOAD column shows the load state, one of + loaded, not-found, + stub, error, + merged, masked. The ACTIVE + columns shows the general unit state, one of active, + reloading, inactive, + failed, activating, + deactivating. The SUB column shows the + unit-type-specific detailed state of the unit, possible values vary by + unit type. The list of possible LOAD, ACTIVE, and SUB states is not + constant and new systemd releases may both add and remove values. + systemctl --state=help command maybe be + used to display the current set of possible values. + This is the default command.