]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agolocale: make "arg_host" const
Yu Watanabe [Tue, 20 Nov 2018 09:08:33 +0000 (18:08 +0900)] 
locale: make "arg_host" const

5 years agohostnamed: use DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:03:50 +0000 (18:03 +0900)] 
hostnamed: use DEFINE_MAIN_FUNCTION() macro

This also renames context_free() to context_clear().

5 years agohibernate-resume-generator: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:00:13 +0000 (18:00 +0900)] 
hibernate-resume-generator: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agofstab-generator: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 08:56:47 +0000 (17:56 +0900)] 
fstab-generator: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agofirstboot: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 08:52:57 +0000 (17:52 +0900)] 
firstboot: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agodissect: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 08:46:14 +0000 (17:46 +0900)] 
dissect: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agobless-boot: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 08:39:25 +0000 (17:39 +0900)] 
bless-boot: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agocryptsetup: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 08:18:08 +0000 (17:18 +0900)] 
cryptsetup: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agocgls: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 06:47:27 +0000 (15:47 +0900)] 
cgls: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agocgls: add const
Yu Watanabe [Tue, 20 Nov 2018 06:42:48 +0000 (15:42 +0900)] 
cgls: add const

5 years agobusctl: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 06:40:36 +0000 (15:40 +0900)] 
busctl: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agobootctl: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 06:35:07 +0000 (15:35 +0900)] 
bootctl: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agobacklight: use DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 06:16:08 +0000 (15:16 +0900)] 
backlight: use DEFINE_MAIN_FUNCTION() macro

5 years agoask-password: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 06:14:16 +0000 (15:14 +0900)] 
ask-password: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agoanalyze: use static destructors
Yu Watanabe [Tue, 20 Nov 2018 06:13:16 +0000 (15:13 +0900)] 
analyze: use static destructors

5 years agobinfmt: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 09:04:35 +0000 (10:04 +0100)] 
binfmt: define main through macro

5 years agodelta: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 09:02:43 +0000 (10:02 +0100)] 
delta: define main through macro

5 years agonetworkctl: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:57:30 +0000 (09:57 +0100)] 
networkctl: define main through macro

5 years agoportablectl: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:56:57 +0000 (09:56 +0100)] 
portablectl: define main through macro

5 years agolocalectl: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:56:18 +0000 (09:56 +0100)] 
localectl: define main through macro

5 years agocoredumpctl: fix "leak" of bus connection
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:54:31 +0000 (09:54 +0100)] 
coredumpctl: fix "leak" of bus connection

$ valgrind --show-leak-kinds=all --leak-check=full build/coredumpctl dump --output /tmp/ff
...
==16431== HEAP SUMMARY:
==16431==     in use at exit: 3,680 bytes in 13 blocks
==16431==   total heap usage: 831 allocs, 818 frees, 197,776 bytes allocated
==16431==
==16431== 2 bytes in 1 blocks are still reachable in loss record 1 of 13
==16431==    at 0x483880B: malloc (vg_replace_malloc.c:299)
==16431==    by 0x4C4D5AD: strdup (strdup.c:42)
==16431==    by 0x49B2387: bus_message_parse_fields (bus-message.c:5300)
==16431==    by 0x49A23AF: bus_message_from_malloc (bus-message.c:560)
==16431==    by 0x49C459B: bus_socket_make_message (bus-socket.c:1099)
==16431==    by 0x49C4C5B: bus_socket_read_message (bus-socket.c:1213)
==16431==    by 0x49CE4CE: bus_read_message (sd-bus.c:1777)
==16431==    by 0x49CFA2C: sd_bus_call (sd-bus.c:2176)
==16431==    by 0x1105F3: check_units_active (coredumpctl.c:1029)
==16431==    by 0x110998: run (coredumpctl.c:1087)
==16431==    by 0x110A45: main (coredumpctl.c:1100)
==16431==
==16431== 9 bytes in 1 blocks are still reachable in loss record 2 of 13
==16431==    at 0x483880B: malloc (vg_replace_malloc.c:299)
==16431==    by 0x4939067: malloc_multiply (alloc-util.h:78)
==16431==    by 0x493921D: hexmem (hexdecoct.c:62)
==16431==    by 0x49C2B75: bus_socket_start_auth_client (bus-socket.c:626)
==16431==    by 0x49C2D78: bus_socket_start_auth (bus-socket.c:665)
==16431==    by 0x49C3B09: bus_socket_connect (bus-socket.c:915)
==16431==    by 0x49CBB08: bus_start_address (sd-bus.c:1103)
==16431==    by 0x49CBFEA: sd_bus_start (sd-bus.c:1187)
==16431==    by 0x49CC452: sd_bus_open_system_with_description (sd-bus.c:1294)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==
==16431== 9 bytes in 1 blocks are still reachable in loss record 3 of 13
==16431==    at 0x483880B: malloc (vg_replace_malloc.c:299)
==16431==    by 0x4C4D5AD: strdup (strdup.c:42)
==16431==    by 0x497364E: free_and_strdup (string-util.c:1013)
==16431==    by 0x49C9FB1: hello_callback (sd-bus.c:547)
==16431==    by 0x49D0A3A: process_reply (sd-bus.c:2498)
==16431==    by 0x49D13E0: process_message (sd-bus.c:2677)
==16431==    by 0x49D165F: process_running (sd-bus.c:2739)
==16431==    by 0x49D20DD: bus_process_internal (sd-bus.c:2957)
==16431==    by 0x49D21E8: sd_bus_process (sd-bus.c:2984)
==16431==    by 0x49CF21E: bus_ensure_running (sd-bus.c:2053)
==16431==    by 0x49CF51F: sd_bus_call (sd-bus.c:2095)
==16431==    by 0x1105F3: check_units_active (coredumpctl.c:1029)
==16431==
==16431== 24 bytes in 1 blocks are still reachable in loss record 4 of 13
==16431==    at 0x483880B: malloc (vg_replace_malloc.c:299)
==16431==    by 0x495CB0D: malloc_multiply (alloc-util.h:78)
==16431==    by 0x495CB2A: prioq_new (prioq.c:35)
==16431==    by 0x495CC02: prioq_ensure_allocated (prioq.c:60)
==16431==    by 0x49CEF84: sd_bus_call_async (sd-bus.c:1995)
==16431==    by 0x49CA0E6: bus_send_hello (sd-bus.c:581)
==16431==    by 0x49CC019: sd_bus_start (sd-bus.c:1196)
==16431==    by 0x49CC452: sd_bus_open_system_with_description (sd-bus.c:1294)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==    by 0x110444: check_units_active (coredumpctl.c:1007)
==16431==
==16431== 38 bytes in 1 blocks are still reachable in loss record 5 of 13
==16431==    at 0x483880B: malloc (vg_replace_malloc.c:299)
==16431==    by 0x4C4D5AD: strdup (strdup.c:42)
==16431==    by 0x497364E: free_and_strdup (string-util.c:1013)
==16431==    by 0x49C7F97: sd_bus_set_address (sd-bus.c:269)
==16431==    by 0x49CC314: bus_set_address_system (sd-bus.c:1262)
==16431==    by 0x49CC3E0: sd_bus_open_system_with_description (sd-bus.c:1281)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==    by 0x110444: check_units_active (coredumpctl.c:1007)
==16431==    by 0x110998: run (coredumpctl.c:1087)
==16431==    by 0x110A45: main (coredumpctl.c:1100)
==16431==
==16431== 64 bytes in 1 blocks are still reachable in loss record 6 of 13
==16431==    at 0x4838748: malloc (vg_replace_malloc.c:298)
==16431==    by 0x483AD63: realloc (vg_replace_malloc.c:826)
==16431==    by 0x4902663: greedy_realloc (alloc-util.c:55)
==16431==    by 0x49C7D7D: sd_bus_new (sd-bus.c:255)
==16431==    by 0x49CC398: sd_bus_open_system_with_description (sd-bus.c:1271)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==    by 0x110444: check_units_active (coredumpctl.c:1007)
==16431==    by 0x110998: run (coredumpctl.c:1087)
==16431==    by 0x110A45: main (coredumpctl.c:1100)
==16431==
==16431== 64 bytes in 1 blocks are still reachable in loss record 7 of 13
==16431==    at 0x4838748: malloc (vg_replace_malloc.c:298)
==16431==    by 0x483AD63: realloc (vg_replace_malloc.c:826)
==16431==    by 0x4902663: greedy_realloc (alloc-util.c:55)
==16431==    by 0x49CE54E: bus_rqueue_make_room (sd-bus.c:1786)
==16431==    by 0x49C44FC: bus_socket_make_message (bus-socket.c:1087)
==16431==    by 0x49C4C5B: bus_socket_read_message (bus-socket.c:1213)
==16431==    by 0x49CE4CE: bus_read_message (sd-bus.c:1777)
==16431==    by 0x49CE6AF: dispatch_rqueue (sd-bus.c:1814)
==16431==    by 0x49D162E: process_running (sd-bus.c:2733)
==16431==    by 0x49D20DD: bus_process_internal (sd-bus.c:2957)
==16431==    by 0x49D21E8: sd_bus_process (sd-bus.c:2984)
==16431==    by 0x49CF21E: bus_ensure_running (sd-bus.c:2053)
==16431==
==16431== 65 bytes in 1 blocks are still reachable in loss record 8 of 13
==16431==    at 0x483AB1A: calloc (vg_replace_malloc.c:752)
==16431==    by 0x496E5D6: getpeersec (socket-util.c:969)
==16431==    by 0x49C291C: bus_get_peercred (bus-socket.c:594)
==16431==    by 0x49C2CB2: bus_socket_start_auth (bus-socket.c:650)
==16431==    by 0x49C3B09: bus_socket_connect (bus-socket.c:915)
==16431==    by 0x49CBB08: bus_start_address (sd-bus.c:1103)
==16431==    by 0x49CBFEA: sd_bus_start (sd-bus.c:1187)
==16431==    by 0x49CC452: sd_bus_open_system_with_description (sd-bus.c:1294)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==    by 0x110444: check_units_active (coredumpctl.c:1007)
==16431==
==16431== 181 bytes in 1 blocks are still reachable in loss record 9 of 13
==16431==    at 0x483AD19: realloc (vg_replace_malloc.c:826)
==16431==    by 0x49C4791: bus_socket_read_message (bus-socket.c:1143)
==16431==    by 0x49CE4CE: bus_read_message (sd-bus.c:1777)
==16431==    by 0x49CFA2C: sd_bus_call (sd-bus.c:2176)
==16431==    by 0x1105F3: check_units_active (coredumpctl.c:1029)
==16431==    by 0x110998: run (coredumpctl.c:1087)
==16431==    by 0x110A45: main (coredumpctl.c:1100)
==16431==
==16431== 256 bytes in 1 blocks are still reachable in loss record 10 of 13
==16431==    at 0x483880B: malloc (vg_replace_malloc.c:299)
==16431==    by 0x496E740: getpeergroups (socket-util.c:998)
==16431==    by 0x49C29BD: bus_get_peercred (bus-socket.c:599)
==16431==    by 0x49C2CB2: bus_socket_start_auth (bus-socket.c:650)
==16431==    by 0x49C3B09: bus_socket_connect (bus-socket.c:915)
==16431==    by 0x49CBB08: bus_start_address (sd-bus.c:1103)
==16431==    by 0x49CBFEA: sd_bus_start (sd-bus.c:1187)
==16431==    by 0x49CC452: sd_bus_open_system_with_description (sd-bus.c:1294)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==    by 0x110444: check_units_active (coredumpctl.c:1007)
==16431==
==16431== 256 bytes in 1 blocks are still reachable in loss record 11 of 13
==16431==    at 0x4838748: malloc (vg_replace_malloc.c:298)
==16431==    by 0x483AD63: realloc (vg_replace_malloc.c:826)
==16431==    by 0x495D1A0: prioq_put (prioq.c:162)
==16431==    by 0x49CF0EA: sd_bus_call_async (sd-bus.c:2023)
==16431==    by 0x49CA0E6: bus_send_hello (sd-bus.c:581)
==16431==    by 0x49CC019: sd_bus_start (sd-bus.c:1196)
==16431==    by 0x49CC452: sd_bus_open_system_with_description (sd-bus.c:1294)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==    by 0x110444: check_units_active (coredumpctl.c:1007)
==16431==    by 0x110998: run (coredumpctl.c:1087)
==16431==
==16431== 856 bytes in 1 blocks are still reachable in loss record 12 of 13
==16431==    at 0x483AB1A: calloc (vg_replace_malloc.c:752)
==16431==    by 0x49A1F33: bus_message_from_header (bus-message.c:458)
==16431==    by 0x49A22B1: bus_message_from_malloc (bus-message.c:535)
==16431==    by 0x49C459B: bus_socket_make_message (bus-socket.c:1099)
==16431==    by 0x49C4C5B: bus_socket_read_message (bus-socket.c:1213)
==16431==    by 0x49CE4CE: bus_read_message (sd-bus.c:1777)
==16431==    by 0x49CFA2C: sd_bus_call (sd-bus.c:2176)
==16431==    by 0x1105F3: check_units_active (coredumpctl.c:1029)
==16431==    by 0x110998: run (coredumpctl.c:1087)
==16431==    by 0x110A45: main (coredumpctl.c:1100)
==16431==
==16431== 1,856 bytes in 1 blocks are still reachable in loss record 13 of 13
==16431==    at 0x483880B: malloc (vg_replace_malloc.c:299)
==16431==    by 0x49C6EDF: malloc_multiply (alloc-util.h:78)
==16431==    by 0x49C7C81: sd_bus_new (sd-bus.c:235)
==16431==    by 0x49CC398: sd_bus_open_system_with_description (sd-bus.c:1271)
==16431==    by 0x49CC4C6: sd_bus_open_system (sd-bus.c:1303)
==16431==    by 0x49D4424: bus_default (sd-bus.c:3655)
==16431==    by 0x49D44BC: sd_bus_default_system (sd-bus.c:3668)
==16431==    by 0x110444: check_units_active (coredumpctl.c:1007)
==16431==    by 0x110998: run (coredumpctl.c:1087)
==16431==    by 0x110A45: main (coredumpctl.c:1100)
==16431==
==16431== LEAK SUMMARY:
==16431==    definitely lost: 0 bytes in 0 blocks
==16431==    indirectly lost: 0 bytes in 0 blocks
==16431==      possibly lost: 0 bytes in 0 blocks
==16431==    still reachable: 3,680 bytes in 13 blocks
==16431==         suppressed: 0 bytes in 0 blocks
==16431==

5 years agocoredumpctl: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:50:07 +0000 (09:50 +0100)] 
coredumpctl: define main through macro

We want to propagate the return value from gdb, hence this commit makes
use of the liberalization of DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE()
in previous commit.

5 years agocoredumpctl: open output file only before writing
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:27:19 +0000 (09:27 +0100)] 
coredumpctl: open output file only before writing

We would open the file very early, which is not nice, if we e.g. fail when
parsing later options. Let's do the usual thing and just open it just before
writing, and close immediately after writing.

5 years agobasic/main-func: propagate all positive return values
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:49:42 +0000 (09:49 +0100)] 
basic/main-func: propagate all positive return values

This changes DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE() to propagate positive
return values as they were, i.e. stops mapping them all to EXIT_FAILURE. This
was suggested in review, but I thought that we only ever return EXIT_FAILURE,
so we don't need to propagate multiple return values.

I was wrong. Turns out that we already *do* have multiple positive return
values, when we call external binaries and propagate the result. systemd-inhibit
is one example, and b453c447e0fb4a1e9eccd42120731c1700220b21 actually broke
this propagation. This commit fixes it.

In systemd-fsck we have the opposite case: we have only one failure value, and the
code needs to be adjusted, so that it keeps returning EXIT_FAILURE.

All other users of DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE() return <= 1, and
are unaffected by this change.

5 years agotimedatectl: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:18:21 +0000 (09:18 +0100)] 
timedatectl: define main through macro

pager_close() is called from DEFINE_MAIN_FUNCTION().

5 years agobasic/main-func: also close the pager automatically
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 13:03:46 +0000 (14:03 +0100)] 
basic/main-func: also close the pager automatically

We generally want to close the pager last. This patch closes the pager last,
after the static destuctor calls. This means that they can do logging and such
like during normal program runtime.

5 years agobasic/main-func: unify the two macros
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 12:54:12 +0000 (13:54 +0100)] 
basic/main-func: unify the two macros

No functional change.

5 years agosysctl: use STATIC_DESTRUCTOR_REGISTER() to free arg_prefixes
Lennart Poettering [Tue, 20 Nov 2018 10:29:54 +0000 (11:29 +0100)] 
sysctl: use STATIC_DESTRUCTOR_REGISTER() to free arg_prefixes

5 years agosysctl: use _cleanup_ in one more occasion
Lennart Poettering [Tue, 20 Nov 2018 10:29:02 +0000 (11:29 +0100)] 
sysctl: use _cleanup_ in one more occasion

5 years agosysctl: port to use DEFINE_MAIN_FUNCTION()
Lennart Poettering [Tue, 20 Nov 2018 10:28:19 +0000 (11:28 +0100)] 
sysctl: port to use DEFINE_MAIN_FUNCTION()

5 years agoinhibit: fix return value in error path
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 08:41:32 +0000 (09:41 +0100)] 
inhibit: fix return value in error path

5 years agoMerge pull request #10850 from poettering/log-setup
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 12:36:45 +0000 (13:36 +0100)] 
Merge pull request #10850 from poettering/log-setup

reduce some logging boilerplate

5 years agoveritysetup-generator: treat '-' and '_' as equivalent
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 10:48:48 +0000 (11:48 +0100)] 
veritysetup-generator: treat '-' and '_' as equivalent

5 years agoMerge pull request #10538 from poettering/tmpfiles-reorder
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 12:00:28 +0000 (13:00 +0100)] 
Merge pull request #10538 from poettering/tmpfiles-reorder

tmpfiles: remove children before their parents plus other fixlets

5 years agoMerge pull request #10831 from keszybz/less-libbasic
Lennart Poettering [Tue, 20 Nov 2018 11:44:30 +0000 (12:44 +0100)] 
Merge pull request #10831 from keszybz/less-libbasic

Move various files that don't need to be in basic/ to shared/

5 years agolog: introduce new helper call log_setup_service() 10850/head
Lennart Poettering [Tue, 20 Nov 2018 10:18:22 +0000 (11:18 +0100)] 
log: introduce new helper call log_setup_service()

Let's reduce the common boilerplate and have a single setup function
used by all service code to setup logging.

5 years agogenerators: introduce a common implementation for the log setup boilerplate
Lennart Poettering [Mon, 19 Nov 2018 20:32:11 +0000 (21:32 +0100)] 
generators: introduce a common implementation for the log setup boilerplate

5 years agoMerge pull request #10787 from yuwata/libudev-cleanups
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 09:42:19 +0000 (10:42 +0100)] 
Merge pull request #10787 from yuwata/libudev-cleanups

libudev: drop unused private functions

5 years agojournal: fix sort order of header includes 10831/head
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 12:29:16 +0000 (13:29 +0100)] 
journal: fix sort order of header includes

5 years agoCODING_STYLE: fix rules for STRLEN and recommend strjoina more strongly
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 12:24:34 +0000 (13:24 +0100)] 
CODING_STYLE: fix rules for STRLEN and recommend strjoina more strongly

Again, this mostly matches what is happening in the codebase already.

5 years agoCODING_STYLE: clarify the rules for the src/basic & src/shared split
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 12:14:21 +0000 (13:14 +0100)] 
CODING_STYLE: clarify the rules for the src/basic & src/shared split

The rule is changed from "put in basic unless there's a reason not to" to "put
in shared unless there's a reason not to", to match the change done in previous
commit. This minimizes libbasic. See previous commit for the reasons why this
is useful.

Previously, the guideline was based on whether the files in question use
"publicly exported APIs". This distinction is not particularly relevant. Let's
consider all other programs we compile: most of them use "publicly exported
APIs", usually linking to libsystemd-shared.so for the actual code. But those
programs are not forced to be in src/basic, and the distinction whether they
happen to use 'sd-*.h' or not is of no importance. The same is true for files
in src/shared/. If we didn't have publicly exported shared objects, we'd put
everything in libsystemd-shared.so. So let's only move things out of it that we
need to. Previous guideline was not "wrong", in the sense that it created *a*
split that was functional (no code in src/shared was required in the publicly
exported shared objects), but it put more files in basic/ then necessary.

Not much changes in practice, because (as previous commit shows), moving files
between libbasic.a and libsystemd-shared.so mostly just changes compilation
order.

The list of components which cannot use libsystemd-shared.so is adjusted.

5 years agomeson: drop libblkid from libbasic
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 10:35:33 +0000 (11:35 +0100)] 
meson: drop libblkid from libbasic

This doesn't seem to change anything, because libmount links to libblkid anyway.
But we don't need to include this dep directly in libbasic.

5 years agoMove various files that don't need to be in basic/ to shared/
Zbigniew Jędrzejewski-Szmek [Mon, 19 Nov 2018 10:12:28 +0000 (11:12 +0100)] 
Move various files that don't need to be in basic/ to shared/

This doesn't have much effect on the final build, because we link libbasic.a
into libsystemd-shared.so, so in the end, all the object built from basic/
end up in libsystemd-shared. And when the static library is linked into binaries,
any objects that are included in it but are not used are trimmed. Hence, the
size of output artifacts doesn't change:

$ du -sb /var/tmp/inst*
54181861 /var/tmp/inst1    (old)
54207441 /var/tmp/inst1s   (old split-usr)
54182477 /var/tmp/inst2    (new)
54208041 /var/tmp/inst2s   (new split-usr)

(The negligible change in size is because libsystemd-shared.so is bigger
by a few hundred bytes. I guess it's because symbols are named differently
or something like that.)

The effect is on the build process, in particular partial builds. This change
effectively moves the requirements on some build steps toward the leaves of the
dependency tree. Two effects:
- when building items that do not depend on libsystemd-shared, we
  build less stuff for libbasic.a (which wouldn't be used anyway,
  so it's a net win).
- when building items that do depend on libshared, we reduce libbasic.a as a
  synchronization point, possibly allowing better parallelism.

Method:
1. copy list of .h files from src/basic/meson.build to /tmp/basic
2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less

5 years agolibudev: coding style fixes 10787/head
Yu Watanabe [Mon, 29 Oct 2018 17:40:23 +0000 (02:40 +0900)] 
libudev: coding style fixes

5 years agolibudev-list: move libudev-list related definitions to libudev-list-internal.h
Yu Watanabe [Fri, 16 Nov 2018 02:44:17 +0000 (11:44 +0900)] 
libudev-list: move libudev-list related definitions to libudev-list-internal.h

This also rename libudev-private.h to libudev-util.h, and cleanups
several unnecessary headers from udev.h and libudev-util.h

5 years agolibudev: drop prototypes for nonexistent functions
Yu Watanabe [Mon, 29 Oct 2018 15:59:06 +0000 (00:59 +0900)] 
libudev: drop prototypes for nonexistent functions

5 years agolibudev-monitor: drop unused private functions
Yu Watanabe [Mon, 29 Oct 2018 15:54:12 +0000 (00:54 +0900)] 
libudev-monitor: drop unused private functions

5 years agolibudev-device: drop unused private functions
Yu Watanabe [Fri, 16 Nov 2018 02:30:01 +0000 (11:30 +0900)] 
libudev-device: drop unused private functions

5 years agoudev: move definition of READ_END and WRITE_END from libudev-private.h to udev.h
Yu Watanabe [Fri, 16 Nov 2018 02:28:07 +0000 (11:28 +0900)] 
udev: move definition of READ_END and WRITE_END from libudev-private.h to udev.h

5 years agoMerge pull request #10847 from evverx/journald-stream-fuzzer
Yu Watanabe [Tue, 20 Nov 2018 04:37:27 +0000 (13:37 +0900)] 
Merge pull request #10847 from evverx/journald-stream-fuzzer

tests: add a fuzzer for journald streams

5 years agozsh-completion: Add support for set-property (#10322)
Xuanwo [Tue, 20 Nov 2018 04:17:11 +0000 (12:17 +0800)] 
zsh-completion: Add support for set-property (#10322)

5 years agoMerge pull request #10801 from ssc-services/zsh-completion_machinectl_clone
Yu Watanabe [Tue, 20 Nov 2018 04:13:41 +0000 (13:13 +0900)] 
Merge pull request #10801 from ssc-services/zsh-completion_machinectl_clone

 zsh-completion: complete available, not running machines for `clone`

5 years agoMerge pull request #10835 from poettering/transient-env-fix
Yu Watanabe [Tue, 20 Nov 2018 03:53:51 +0000 (12:53 +0900)] 
Merge pull request #10835 from poettering/transient-env-fix

fix flushing out of transient env vars from PID1's Manager object

5 years agobootspec: introduce SYSTEMD_ESP_PATH for overriding where to look for the ESP (#10834)
Lennart Poettering [Tue, 20 Nov 2018 03:37:01 +0000 (04:37 +0100)] 
bootspec: introduce SYSTEMD_ESP_PATH for overriding where to look for the ESP (#10834)

5 years agoprocess-util: check for correct kill return value (#10841)
David Leeds [Tue, 20 Nov 2018 03:35:36 +0000 (19:35 -0800)] 
process-util: check for correct kill return value (#10841)

Code was not doing a wait() after kill() due to checking for a return value > 0, and was leaving zombie processes. This affected things like  sd-bus unixexec connections.

5 years agotree-wide: use __ prefixed gcc attributes (#10843)
Lennart Poettering [Tue, 20 Nov 2018 03:34:08 +0000 (04:34 +0100)] 
tree-wide: use __ prefixed gcc attributes (#10843)

As suggest here:

https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax

    "You may optionally specify attribute names with ‘__’ preceding and
    following the name. This allows you to use them in header files without
    being concerned about a possible macro of the same name. For example,
    you may use the attribute name __noreturn__ instead of noreturn. "

5 years agoMerge pull request #10845 from poettering/static-destruct
Yu Watanabe [Tue, 20 Nov 2018 03:31:52 +0000 (12:31 +0900)] 
Merge pull request #10845 from poettering/static-destruct

RFC: introduce automatic destructors for static variables

5 years agotests: always use the right vtable wrapper calls
Lennart Poettering [Mon, 19 Nov 2018 13:48:28 +0000 (14:48 +0100)] 
tests: always use the right vtable wrapper calls

Prompted by https://github.com/systemd/systemd/pull/10836#discussion_r234598868

5 years agotests: add a fuzzer for journald streams 10847/head
Evgeny Vereshchagin [Tue, 20 Nov 2018 00:20:32 +0000 (01:20 +0100)] 
tests: add a fuzzer for journald streams

5 years agotest-execute: fix killing of unit processes
Lennart Poettering [Mon, 19 Nov 2018 12:05:43 +0000 (13:05 +0100)] 
test-execute: fix killing of unit processes

Let's use the correct wrapper for calling unit vtable functions. Let's
make sure we always use the right wrappers, and never bypass them
needlessly.

Moreover use SIGKILL rather than "9" as signal name. Let's not be
needlessly cryptic.

Follow-up for: f7f8e8cbb953686c520969a66a9718675a972af5

5 years agodoc: document the boot menu entry identifier vocabulary
Lennart Poettering [Mon, 19 Nov 2018 13:33:03 +0000 (14:33 +0100)] 
doc: document the boot menu entry identifier vocabulary

The existing text already said "See below regarding a recommended
vocabulary for boot loader entry identifiers.", but the section for it
was still missing. Let's fill in the missing bits, and describe basic
suggested rules for the boot menu entry identifier vocabulary, in
particular how to identify Windows and MacOS X installations, and how to
name automatic entries vs. explicitly configured ones.

This basically follows the logic implemented in sd-boot these days.

5 years agomeson: order source files alphabetically
Lennart Poettering [Mon, 19 Nov 2018 19:06:45 +0000 (20:06 +0100)] 
meson: order source files alphabetically

5 years agodebug-generator: port over to using static destructors 10845/head
Lennart Poettering [Mon, 19 Nov 2018 19:48:12 +0000 (20:48 +0100)] 
debug-generator: port over to using static destructors

5 years agodebug-generator: port over to DEFINE_MAIN_FUNCTION()
Lennart Poettering [Mon, 19 Nov 2018 19:11:35 +0000 (20:11 +0100)] 
debug-generator: port over to DEFINE_MAIN_FUNCTION()

5 years agomain-func: automatically call static destructors from main-func.h macros
Lennart Poettering [Mon, 19 Nov 2018 19:47:46 +0000 (20:47 +0100)] 
main-func: automatically call static destructors from main-func.h macros

5 years agoutil: add set of macros for declaring _cleanup_-style destructors for static variables
Lennart Poettering [Mon, 19 Nov 2018 19:08:04 +0000 (20:08 +0100)] 
util: add set of macros for declaring _cleanup_-style destructors for static variables

5 years agoutil-lib: move main() definition macros to its own header file
Lennart Poettering [Mon, 19 Nov 2018 19:26:37 +0000 (20:26 +0100)] 
util-lib: move main() definition macros to its own header file

This way, we can extend the macro a bit with stuff pulled in from other
headers without this affecting everything which pulls in macro.h, which
is one of our most basic headers.

This is just refactoring, no change in behaviour, in prepartion for
later changes.

5 years agoMerge pull request #10811 from keszybz/define-main-through-macro
Lennart Poettering [Mon, 19 Nov 2018 14:28:17 +0000 (15:28 +0100)] 
Merge pull request #10811 from keszybz/define-main-through-macro

Define main through macro

5 years agopam_systemd: suppress LOG_DEBUG log messages if debugging is off
Lennart Poettering [Mon, 19 Nov 2018 10:39:45 +0000 (11:39 +0100)] 
pam_systemd: suppress LOG_DEBUG log messages if debugging is off

In the PAM module we need to suppress LOG_DEBUG messages manually, if
debug logging is not on, as PAM won't do this for us. We did this
correctly for most log messages already, but two were missing. Let's fix
those too.

Fixes: #10822
5 years agomain: when reloading PID 1 let's reset the default environment 10835/head
Lennart Poettering [Mon, 19 Nov 2018 11:23:13 +0000 (12:23 +0100)] 
main: when reloading PID 1 let's reset the default environment

Otherwise we keep collecting stuff from env generators, and we really
shouldn't.

This was working properly on reexec but not on reload, as for reexec we
would always start fresh, but for reload would reuse the Manager object
and hence its default environment set.

Fixes: #10671
5 years agomanager: log on two OOM occasions
Lennart Poettering [Mon, 19 Nov 2018 11:22:56 +0000 (12:22 +0100)] 
manager: log on two OOM occasions

5 years agoMerge pull request #10698 from yuwata/udevd-replace-udev-device
Lennart Poettering [Mon, 19 Nov 2018 10:28:45 +0000 (11:28 +0100)] 
Merge pull request #10698 from yuwata/udevd-replace-udev-device

udevd: replace udev_device by sd_device

5 years agoMerge pull request #10809 from keszybz/unit-log-result
Lennart Poettering [Mon, 19 Nov 2018 10:07:07 +0000 (11:07 +0100)] 
Merge pull request #10809 from keszybz/unit-log-result

Add helper function for logging unit results

5 years agoMerge pull request #10814 from poettering/logind-suspend-fallback
Lennart Poettering [Mon, 19 Nov 2018 10:05:48 +0000 (11:05 +0100)] 
Merge pull request #10814 from poettering/logind-suspend-fallback

if we need to hibernate/suspend-then-hibernate/hybrid-sleep due to keypress/lid switch but can't, fallback to regular suspend

5 years agoMerge pull request #10825 from keszybz/advertize-followup
Lennart Poettering [Mon, 19 Nov 2018 10:05:18 +0000 (11:05 +0100)] 
Merge pull request #10825 from keszybz/advertize-followup

udev link advertizing followup

5 years agoMerge pull request #10507 from cdown/cpu_acct
Lennart Poettering [Mon, 19 Nov 2018 09:57:48 +0000 (10:57 +0100)] 
Merge pull request #10507 from cdown/cpu_acct

cgroup v2: Don't require CPU controller for CPU accounting in 4.15+

5 years agotest: kill all processes launched by test-execute before exiting
Evgeny Vereshchagin [Sat, 17 Nov 2018 19:36:31 +0000 (20:36 +0100)] 
test: kill all processes launched by test-execute before exiting

As was shown in https://github.com/systemd/systemd/issues/10696#issuecomment-439613204,
currently `meson` waits for 1080 seconds (which is three times the global timeout) for the
test to fail completely even though it takes just two minutes for it to really fail. This
happens because the test itself leaves the services it has launched behind, which, in turn, makes
meson think that the test is still in progress. KILL_ALL with SIGKILL should make the issue
go away.

5 years agocatalog: update Polish translation
Piotr Drąg [Sun, 18 Nov 2018 18:04:53 +0000 (19:04 +0100)] 
catalog: update Polish translation

5 years agotest: let the shell find "touch" instead of hard-coded "/bin/touch"
Xi Ruoyao [Sun, 18 Nov 2018 18:51:25 +0000 (02:51 +0800)] 
test: let the shell find "touch" instead of hard-coded "/bin/touch"

5 years agobasic/missing: drop _ETHTOOL_LINK_MODE_MAX 10825/head
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:13:32 +0000 (10:13 +0100)] 
basic/missing: drop _ETHTOOL_LINK_MODE_MAX

It was only used in one place, where we don't actually need it, and
it is too easy to forget to update it when adding new items to the table.
Let's just drop it.

5 years agoudev: use an "inline" array instead of allocating for advertise mode
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:12:14 +0000 (10:12 +0100)] 
udev: use an "inline" array instead of allocating for advertise mode

The code is a bit shorter and we don't allocate the uint32_t[127] array.

5 years agobasic/util: import memeqzero from casync
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:42:39 +0000 (10:42 +0100)] 
basic/util: import memeqzero from casync

5 years agocgroup v2: DefaultCPUAccounting=yes if CPU controller isn't required 10507/head
Chris Down [Thu, 25 Oct 2018 13:03:58 +0000 (14:03 +0100)] 
cgroup v2: DefaultCPUAccounting=yes if CPU controller isn't required

We now don't enable the CPU controller just for CPU accounting if we are
on 4.15+ and using pure unified hierarchy, as this is provided
externally to the CPU controller. This makes CPUAccounting=yes
essentially free, so enabling it by default when it's cheap seems like a
good idea.

5 years agocgtop: Still try to get CPU statistics if controller-free
Chris Down [Sat, 17 Nov 2018 11:47:44 +0000 (11:47 +0000)] 
cgtop: Still try to get CPU statistics if controller-free

If CPU accounting is cheap, no controller necessarily needs to be
enabled here for us to be able to read statistics.

5 years agocgroup v2: Don't require CPU controller for CPU accounting in 4.15+
Chris Down [Sat, 17 Nov 2018 11:19:07 +0000 (11:19 +0000)] 
cgroup v2: Don't require CPU controller for CPU accounting in 4.15+

systemd only uses functions that are as of Linux 4.15+ provided
externally to the CPU controller (currently usage_usec), so if we have a
new enough kernel, we don't need to set CGROUP_MASK_CPU for
CPUAccounting=true as the CPU controller does not need to necessarily be
enabled in this case.

Part of this patch is modelled on an earlier patch by Ryutaroh Matsumoto
(see PR #9665).

5 years agotest-util: modernize
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:46:30 +0000 (10:46 +0100)] 
test-util: modernize

5 years agoMerge pull request #10819 from yuwata/fix-10807
Zbigniew Jędrzejewski-Szmek [Sun, 18 Nov 2018 09:27:29 +0000 (10:27 +0100)] 
Merge pull request #10819 from yuwata/fix-10807

ethtool: drop NetDevAdvertise

5 years agoethtool: drop NetDevAdvertise 10819/head
Yu Watanabe [Sat, 17 Nov 2018 14:08:22 +0000 (23:08 +0900)] 
ethtool: drop NetDevAdvertise

Fixes #10807.

5 years agomissing: add ETHTOOL_LINK_MODE_* and struct ethtool_link_settings
Yu Watanabe [Sat, 17 Nov 2018 14:42:27 +0000 (23:42 +0900)] 
missing: add ETHTOOL_LINK_MODE_* and struct ethtool_link_settings

5 years agoMerge pull request #10817 from evverx/audit-fuzzer
Zbigniew Jędrzejewski-Szmek [Sat, 17 Nov 2018 17:26:54 +0000 (18:26 +0100)] 
Merge pull request #10817 from evverx/audit-fuzzer

Add a fuzzer for process_audit_string

5 years agotest: also tests enumerating subsystems
Yu Watanabe [Sat, 17 Nov 2018 15:42:33 +0000 (00:42 +0900)] 
test: also tests enumerating subsystems

5 years agoudevd: replace udev_device in struct event by sd_device 10698/head
Yu Watanabe [Thu, 8 Nov 2018 09:17:20 +0000 (18:17 +0900)] 
udevd: replace udev_device in struct event by sd_device

5 years agoudevd: update several log messages
Yu Watanabe [Fri, 9 Nov 2018 08:13:13 +0000 (17:13 +0900)] 
udevd: update several log messages

5 years agoudevd: decrease indentation
Yu Watanabe [Thu, 8 Nov 2018 08:45:01 +0000 (17:45 +0900)] 
udevd: decrease indentation

5 years agoudevd: rename event sources in struct event
Yu Watanabe [Thu, 8 Nov 2018 08:43:21 +0000 (17:43 +0900)] 
udevd: rename event sources in struct event

5 years agoudevd: capitalize log messages in on_sigchld()
Yu Watanabe [Thu, 8 Nov 2018 08:40:15 +0000 (17:40 +0900)] 
udevd: capitalize log messages in on_sigchld()

5 years agoudevd: also use sd_device_monitor_start() in worker_main()
Yu Watanabe [Thu, 8 Nov 2018 06:48:38 +0000 (15:48 +0900)] 
udevd: also use sd_device_monitor_start() in worker_main()

5 years agoudevd: use sd_device_monitor_start() in manager_new()
Yu Watanabe [Thu, 8 Nov 2018 06:44:25 +0000 (15:44 +0900)] 
udevd: use sd_device_monitor_start() in manager_new()

5 years agoudevd: replace udev_monitor by sd_device_monitor
Yu Watanabe [Thu, 8 Nov 2018 06:38:20 +0000 (15:38 +0900)] 
udevd: replace udev_monitor by sd_device_monitor

5 years agoudevd: use safe_fork() to spawn worker process
Yu Watanabe [Tue, 6 Nov 2018 08:35:33 +0000 (17:35 +0900)] 
udevd: use safe_fork() to spawn worker process