From 623f13d8198b83df890f014b1d27255f4d78f35b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 21 Oct 2016 03:00:49 -0400 Subject: wip --- src/grp-journal/catalog/.gitignore | 1 - src/grp-journal/catalog/systemd.be.catalog.in | 313 --- .../catalog/systemd.be@latin.catalog.in | 318 ---- src/grp-journal/catalog/systemd.bg.catalog.in | 324 ---- src/grp-journal/catalog/systemd.catalog.in | 334 ---- src/grp-journal/catalog/systemd.da.catalog.in | 261 --- src/grp-journal/catalog/systemd.fr.catalog.in | 320 ---- src/grp-journal/catalog/systemd.hr.catalog.in | 314 --- src/grp-journal/catalog/systemd.hu.catalog.in | 262 --- src/grp-journal/catalog/systemd.it.catalog.in | 254 --- src/grp-journal/catalog/systemd.ko.catalog.in | 264 --- src/grp-journal/catalog/systemd.pl.catalog.in | 315 --- src/grp-journal/catalog/systemd.pt_BR.catalog.in | 264 --- src/grp-journal/catalog/systemd.ru.catalog.in | 354 ---- src/grp-journal/catalog/systemd.sr.catalog.in | 262 --- src/grp-journal/catalog/systemd.zh_CN.catalog.in | 253 --- src/grp-journal/catalog/systemd.zh_TW.catalog.in | 263 --- src/grp-journal/grp-remote/microhttpd-util.c | 328 ---- src/grp-journal/grp-remote/microhttpd-util.h | 60 - .../grp-remote/systemd-journal-gatewayd/Makefile | 15 +- .../systemd-journal-gatewayd/journal-gatewayd.c | 22 +- .../grp-remote/systemd-journal-remote/Makefile | 19 +- .../systemd-journal-remote/journal-remote-parse.c | 10 +- .../systemd-journal-remote/journal-remote-write.c | 2 +- .../systemd-journal-remote/journal-remote.c | 32 +- .../systemd-journal-remote/journal-remote.h | 4 +- .../grp-remote/systemd-journal-upload/Makefile | 3 + .../journal-upload-journal.c | 8 +- .../systemd-journal-upload/journal-upload.c | 28 +- .../systemd-journal-upload/journal-upload.h | 2 +- src/grp-journal/journalctl/Makefile | 1 + src/grp-journal/journalctl/journalctl.c | 52 +- src/grp-journal/libjournal-core/Makefile | 32 +- .../include/journal-core/journald-audit.h | 28 + .../include/journal-core/journald-console.h | 24 + .../include/journal-core/journald-kmsg.h | 29 + .../include/journal-core/journald-native.h | 35 + .../include/journal-core/journald-rate-limit.h | 28 + .../include/journal-core/journald-server.h | 187 ++ .../include/journal-core/journald-stream.h | 32 + .../include/journal-core/journald-syslog.h | 33 + .../include/journal-core/journald-wall.h | 24 + src/grp-journal/libjournal-core/journald-audit.c | 565 ------ src/grp-journal/libjournal-core/journald-audit.h | 28 - src/grp-journal/libjournal-core/journald-console.c | 116 -- src/grp-journal/libjournal-core/journald-console.h | 24 - .../libjournal-core/journald-gperf.gperf | 48 - src/grp-journal/libjournal-core/journald-kmsg.c | 474 ----- src/grp-journal/libjournal-core/journald-kmsg.h | 29 - src/grp-journal/libjournal-core/journald-native.c | 502 ----- src/grp-journal/libjournal-core/journald-native.h | 35 - .../libjournal-core/journald-rate-limit.c | 272 --- .../libjournal-core/journald-rate-limit.h | 28 - src/grp-journal/libjournal-core/journald-server.c | 2009 -------------------- src/grp-journal/libjournal-core/journald-server.h | 187 -- src/grp-journal/libjournal-core/journald-stream.c | 786 -------- src/grp-journal/libjournal-core/journald-stream.h | 32 - src/grp-journal/libjournal-core/journald-syslog.c | 455 ----- src/grp-journal/libjournal-core/journald-syslog.h | 33 - src/grp-journal/libjournal-core/journald-wall.c | 72 - src/grp-journal/libjournal-core/journald-wall.h | 24 - src/grp-journal/libjournal-core/src/Makefile | 58 + .../libjournal-core/src/journald-audit.c | 564 ++++++ .../libjournal-core/src/journald-console.c | 115 ++ .../libjournal-core/src/journald-gperf.gperf | 47 + .../libjournal-core/src/journald-kmsg.c | 473 +++++ .../libjournal-core/src/journald-native.c | 501 +++++ .../libjournal-core/src/journald-rate-limit.c | 271 +++ .../libjournal-core/src/journald-server.c | 2008 +++++++++++++++++++ .../libjournal-core/src/journald-stream.c | 785 ++++++++ .../libjournal-core/src/journald-syslog.c | 454 +++++ .../libjournal-core/src/journald-wall.c | 71 + src/grp-journal/libjournal-core/test-audit-type.c | 43 - src/grp-journal/libjournal-core/test-catalog.c | 264 --- .../libjournal-core/test-compress-benchmark.c | 180 -- src/grp-journal/libjournal-core/test-compress.c | 308 --- .../libjournal-core/test-journal-enum.c | 53 - .../libjournal-core/test-journal-flush.c | 75 - .../libjournal-core/test-journal-init.c | 64 - .../libjournal-core/test-journal-interleaving.c | 307 --- .../libjournal-core/test-journal-match.c | 76 - .../libjournal-core/test-journal-send.c | 102 - .../libjournal-core/test-journal-stream.c | 196 -- .../libjournal-core/test-journal-syslog.c | 45 - .../libjournal-core/test-journal-verify.c | 150 -- src/grp-journal/libjournal-core/test-journal.c | 178 -- src/grp-journal/libjournal-core/test-mmap-cache.c | 79 - .../libjournal-core/test/test-audit-type.c | 43 + .../libjournal-core/test/test-catalog.c | 264 +++ .../libjournal-core/test/test-compress-benchmark.c | 180 ++ .../libjournal-core/test/test-compress.c | 308 +++ .../libjournal-core/test/test-journal-enum.c | 53 + .../libjournal-core/test/test-journal-flush.c | 75 + .../libjournal-core/test/test-journal-init.c | 64 + .../test/test-journal-interleaving.c | 307 +++ .../libjournal-core/test/test-journal-match.c | 76 + .../libjournal-core/test/test-journal-send.c | 102 + .../libjournal-core/test/test-journal-stream.c | 196 ++ .../libjournal-core/test/test-journal-syslog.c | 44 + .../libjournal-core/test/test-journal-verify.c | 150 ++ .../libjournal-core/test/test-journal.c | 178 ++ .../libjournal-core/test/test-mmap-cache.c | 79 + src/grp-journal/systemd-cat/cat.c | 10 +- src/grp-journal/systemd-journald/.gitignore | 1 + src/grp-journal/systemd-journald/Makefile | 1 + src/grp-journal/systemd-journald/journald.c | 10 +- .../systemd-journald/systemd.be.catalog.in | 313 +++ .../systemd-journald/systemd.be@latin.catalog.in | 318 ++++ .../systemd-journald/systemd.bg.catalog.in | 324 ++++ .../systemd-journald/systemd.catalog.in | 334 ++++ .../systemd-journald/systemd.da.catalog.in | 261 +++ .../systemd-journald/systemd.fr.catalog.in | 320 ++++ .../systemd-journald/systemd.hr.catalog.in | 314 +++ .../systemd-journald/systemd.hu.catalog.in | 262 +++ .../systemd-journald/systemd.it.catalog.in | 254 +++ .../systemd-journald/systemd.ko.catalog.in | 264 +++ .../systemd-journald/systemd.pl.catalog.in | 315 +++ .../systemd-journald/systemd.pt_BR.catalog.in | 264 +++ .../systemd-journald/systemd.ru.catalog.in | 354 ++++ .../systemd-journald/systemd.sr.catalog.in | 262 +++ .../systemd-journald/systemd.zh_CN.catalog.in | 253 +++ .../systemd-journald/systemd.zh_TW.catalog.in | 263 +++ 122 files changed, 12665 insertions(+), 13051 deletions(-) delete mode 100644 src/grp-journal/catalog/.gitignore delete mode 100644 src/grp-journal/catalog/systemd.be.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.be@latin.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.bg.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.da.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.fr.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.hr.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.hu.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.it.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.ko.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.pl.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.pt_BR.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.ru.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.sr.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.zh_CN.catalog.in delete mode 100644 src/grp-journal/catalog/systemd.zh_TW.catalog.in delete mode 100644 src/grp-journal/grp-remote/microhttpd-util.c delete mode 100644 src/grp-journal/grp-remote/microhttpd-util.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-audit.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-console.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-kmsg.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-native.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-rate-limit.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-server.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-stream.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-syslog.h create mode 100644 src/grp-journal/libjournal-core/include/journal-core/journald-wall.h delete mode 100644 src/grp-journal/libjournal-core/journald-audit.c delete mode 100644 src/grp-journal/libjournal-core/journald-audit.h delete mode 100644 src/grp-journal/libjournal-core/journald-console.c delete mode 100644 src/grp-journal/libjournal-core/journald-console.h delete mode 100644 src/grp-journal/libjournal-core/journald-gperf.gperf delete mode 100644 src/grp-journal/libjournal-core/journald-kmsg.c delete mode 100644 src/grp-journal/libjournal-core/journald-kmsg.h delete mode 100644 src/grp-journal/libjournal-core/journald-native.c delete mode 100644 src/grp-journal/libjournal-core/journald-native.h delete mode 100644 src/grp-journal/libjournal-core/journald-rate-limit.c delete mode 100644 src/grp-journal/libjournal-core/journald-rate-limit.h delete mode 100644 src/grp-journal/libjournal-core/journald-server.c delete mode 100644 src/grp-journal/libjournal-core/journald-server.h delete mode 100644 src/grp-journal/libjournal-core/journald-stream.c delete mode 100644 src/grp-journal/libjournal-core/journald-stream.h delete mode 100644 src/grp-journal/libjournal-core/journald-syslog.c delete mode 100644 src/grp-journal/libjournal-core/journald-syslog.h delete mode 100644 src/grp-journal/libjournal-core/journald-wall.c delete mode 100644 src/grp-journal/libjournal-core/journald-wall.h create mode 100644 src/grp-journal/libjournal-core/src/Makefile create mode 100644 src/grp-journal/libjournal-core/src/journald-audit.c create mode 100644 src/grp-journal/libjournal-core/src/journald-console.c create mode 100644 src/grp-journal/libjournal-core/src/journald-gperf.gperf create mode 100644 src/grp-journal/libjournal-core/src/journald-kmsg.c create mode 100644 src/grp-journal/libjournal-core/src/journald-native.c create mode 100644 src/grp-journal/libjournal-core/src/journald-rate-limit.c create mode 100644 src/grp-journal/libjournal-core/src/journald-server.c create mode 100644 src/grp-journal/libjournal-core/src/journald-stream.c create mode 100644 src/grp-journal/libjournal-core/src/journald-syslog.c create mode 100644 src/grp-journal/libjournal-core/src/journald-wall.c delete mode 100644 src/grp-journal/libjournal-core/test-audit-type.c delete mode 100644 src/grp-journal/libjournal-core/test-catalog.c delete mode 100644 src/grp-journal/libjournal-core/test-compress-benchmark.c delete mode 100644 src/grp-journal/libjournal-core/test-compress.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-enum.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-flush.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-init.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-interleaving.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-match.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-send.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-stream.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-syslog.c delete mode 100644 src/grp-journal/libjournal-core/test-journal-verify.c delete mode 100644 src/grp-journal/libjournal-core/test-journal.c delete mode 100644 src/grp-journal/libjournal-core/test-mmap-cache.c create mode 100644 src/grp-journal/libjournal-core/test/test-audit-type.c create mode 100644 src/grp-journal/libjournal-core/test/test-catalog.c create mode 100644 src/grp-journal/libjournal-core/test/test-compress-benchmark.c create mode 100644 src/grp-journal/libjournal-core/test/test-compress.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-enum.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-flush.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-init.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-interleaving.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-match.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-send.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-stream.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-syslog.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal-verify.c create mode 100644 src/grp-journal/libjournal-core/test/test-journal.c create mode 100644 src/grp-journal/libjournal-core/test/test-mmap-cache.c create mode 100644 src/grp-journal/systemd-journald/.gitignore create mode 100644 src/grp-journal/systemd-journald/systemd.be.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.be@latin.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.bg.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.da.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.fr.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.hr.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.hu.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.it.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.ko.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.pl.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.pt_BR.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.ru.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.sr.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.zh_CN.catalog.in create mode 100644 src/grp-journal/systemd-journald/systemd.zh_TW.catalog.in (limited to 'src/grp-journal') diff --git a/src/grp-journal/catalog/.gitignore b/src/grp-journal/catalog/.gitignore deleted file mode 100644 index ff695342e3..0000000000 --- a/src/grp-journal/catalog/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.catalog diff --git a/src/grp-journal/catalog/systemd.be.catalog.in b/src/grp-journal/catalog/systemd.be.catalog.in deleted file mode 100644 index 5b237f0558..0000000000 --- a/src/grp-journal/catalog/systemd.be.catalog.in +++ /dev/null @@ -1,313 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2015, 2016 Viktar Vaŭčkievič -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Belarusian translation - -# Фармат каталога апісаны на старонцы -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: Сэрвіс журналявання запусціўся -Defined-By: systemd -Support: %SUPPORT_URL% - -Працэс сістэмнага журналявання запусціўся, адкрыў файлы для -запісу і гатовы апрацоўваць запыты. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Сэрвіс журналявання спыніўся -Defined-By: systemd -Support: %SUPPORT_URL% - -Працэс сістэмнага журналявання спыніўся і закрыў усе файлы. - --- ec387f577b844b8fa948f33cad9a75e6 -Subject: Дыскавае месца, занятае часопісам -Defined-By: systemd -Support: %SUPPORT_URL% - -@JOURNAL_NAME@ (@JOURNAL_PATH@) цяпер займае @CURRENT_USE_PRETTY@. -Максімальна дазволены памер складае @MAX_USE_PRETTY@. -Пакідаем вольнымі не меньш за @DISK_KEEP_FREE_PRETTY@ (даступна на дыску -@DISK_AVAILABLE_PRETTY@). -Такім чынам, ліміт складае @LIMIT_PRETTY@, з якіх @AVAILABLE_PRETTY@ -даступна. - -Ліміты на памер наладжваецца з дапамогай SystemMaxUse=, SystemKeepFree=, -SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= у -файле /etc/systemd/journald.conf. Глядзіце journald.conf(5) для дэталей. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Паведамленні з сэрвісу адкінуты -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Сэрвіс адправіў занадта штат паведамленняў за кароткі прамежак часу. -Частка паведамленняў была адкінута. - -Майце на ўвазе, што былі адкінуты паведамлення толькі гэтага сэрвісу. -Паведамленні іншых сэрвісаў засталіся. - -Мяжа, пасля якой паведамленні будуць адкінуты, наладжваецца з дапамогай -RateLimitIntervalSec= і RateLimitBurst= у файле /etc/systemd/journald.conf. -Глядзіце journald.conf(5) для дэталей. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Паведамленні страчаны -Defined-By: systemd -Support: %SUPPORT_URL% - -Паведамленні ядра былі страчаны, так як сістэма журналявання не паспела -іх апрацаваць. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Працэс @COREDUMP_PID@ (@COREDUMP_COMM@) скінуў дамп памяці -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Працэс @COREDUMP_PID@ (@COREDUMP_COMM@) разбіўся і скінуў дамп памяці. - -Звычайна гэта сведчыць аб памылцы ў праграмным кодзе. -Рэкамендуецца паведаміць аб гэтым распрацоўнікам. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Новая сесія № @SESSION_ID@ створана для карыстальніка @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Новая сесія з № @SESSION_ID@ створана для карыстальніка @USER_ID@. - -Лідар гэтай сесіі пад № @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Сесія № @SESSION_ID@ спынена -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Сесія № @SESSION_ID@ спынена. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Даступна новае працоўнае месца № @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Новае працоўнае месца № @SEAT_ID@ наладжана і даступна для выкарыстання. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Працоўнае месца № @SEAT_ID@ выдалена -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Працоўнае месца № @SEAT_ID@ выдалена і больш не даступна. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Час зменены -Defined-By: systemd -Support: %SUPPORT_URL% - -Сістэмны гадзіннік зменены на @REALTIME@ мікрасекунд ад 1 студзеня 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Часавы пояс зменены на @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Сістэмны часавы пояс зменены на @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Запуск сістэмы завяршыўся -Defined-By: systemd -Support: %SUPPORT_URL% - -Усе сістэмныя сэрвісы, неабходныя для загрузкі сістэмы, паспяхова -запусціліся. Майце на ўвазе, што гэта не значыць, што машына нічога не -робіць. Магчыма, некаторыя сэрвісы яшчэ ініцыялізіруюцца. - -На запуск ядра спатрэбілася @KERNEL_USEC@ мікрасекунд. - -На запуск пачатковага RAM-дыска спатрэбілася @INITRD_USEC@ мікрасекунд. - -На запуск сістэмных сэрвісаў спатрэбілася @USERSPACE_USEC@ мікрасекунд. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Сістэма перайшла ў стан сну @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Цяпер сістэма перайшла у стан сну @SLEEP@. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Сістэма выйшла са стана сну @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Цяпер сістэма выйшла са стана сну @SLEEP@. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Сістэма завяршае работу -Defined-By: systemd -Support: %SUPPORT_URL% - -Пачаўся працэс выключэння сістэмы. -Спыняюцца ўсе сістэмныя сэрвісы і дэмантуюцца файлавыя сістэмы. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Юніт @UNIT@ запускаецца -Defined-By: systemd -Support: %SUPPORT_URL% - -Пачаўся працэс запуску юніта @UNIT@. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Юніт @UNIT@ запусціўся -Defined-By: systemd -Support: %SUPPORT_URL% - -Працэс запуску юніта @UNIT@ завершаны. - -Вынік: @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Юніт @UNIT@ спыняецца -Defined-By: systemd -Support: %SUPPORT_URL% - -Пачаўся працэс спынення юніта @UNIT@. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Юніт @UNIT@ спынены -Defined-By: systemd -Support: %SUPPORT_URL% - -Працэс спынення юніта @UNIT@ завершаны. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Збой юніта @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Збой юніта @UNIT@. - -Вынік: @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: Юніт @UNIT@ перачытвае сваю канфігурацыю -Defined-By: systemd -Support: %SUPPORT_URL% - -Юніт @UNIT@ пачаў перачытваць сваю канфігурацыю. - --- 7b05ebc668384222baa8881179cfda54 -Subject: Юніт @UNIT@ перачытаў сваю канфігурацыю -Defined-By: systemd -Support: %SUPPORT_URL% - -Юніт @UNIT@ перачытаў сваю канфігурацыю. - -Вынік: @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Працэс @EXECUTABLE@ не можа быць выкананы -Defined-By: systemd -Support: %SUPPORT_URL% - -Працэс @EXECUTABLE@ не можа быць выкананы ў выніку збою. - -Ён вярнуў памылку нумар @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Sibject: Адно ці больш паведамленняў не былі накіраваны ў syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Адно ці больш паведамленняў не былі накіраваны ў syslog сэрвіс, які -выконваецца паралельна з journald. Звычайна гэта значыць, што -рэалізацыя syslog не паспявае апрацаваць паведамленні з неабходнай -хуткасцю. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Кропка мантавання не пустая -Defined-By: systemd -Support: %SUPPORT_URL% - -Каталог @WHERE@ указаны як кропка мантавання (другое поле ў /etc/fstab ці -Where= поле ў файле юніта systemd) і не пусты. Гэта не перашкаджае -мантаванню, але існуючыя ў ім файлы будуць недаступны. Для доступу да іх, -калі ласка, змантуйце гэтую файлавую сістэму ў іншае месца. - --- 24d8d4452573402496068381a6312df2 -Subject: Віртуальная машына або кантэйнер запусціўся -Defined-By: systemd -Support: %SUPPORT_URL% - -Віртуальная машына @NAME@ з лідарам № @LEADER@ запусцілася і -гатова для выкарыстання. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Віртуальная машына або кантэйнер спынены -Defined-By: systemd -Support: %SUPPORT_URL% - -Віртуальная машына @NAME@ з лідарам № @LEADER@ спынена. - --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: Механізм DNSSEC адключаны, бо сервер не падтымлівае яго -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -Сэрвіс вызначэння імён (systemd-resolved.service) вызначыў, што DNS-сервер -не падтрымлівае механізм DNSSEC. У выніку праверка DNSSEC была адключана. - -Гэтая падзея ўзнікае калі наладжаны DNSSEC=allow-downgrade -у файле resolved.conf і DNS-сервер не падтрымлівае механізм DNSSEC. -Звярніце ўвагу, што рэжым allow-downgrade дазваляе правесці атаку -«DNSSEC downgrade», у ходзе якой зламыснік можа адключыць праверку DNSSEC -шляхам падстаноўкі падробленых DNSSEC-адказаў у камунікацыйны канал. - -Гэта падзея можа быць прыкметай таго, што DNS-сервер сапраўды несумяшчальны -з DNSSEC або што зламысніку паспяхова атрымалася правесці атаку па -адключэнню DNSSEC. - --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: Збой пры праверцы DNSSEC -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -DNS-запыт або рэсурсны запіс не прайшоў праверку DNSSEC. -Як правіла, гэта паказвае на знешняе ўздзеянне на канал сувязі. - --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: Давераны ключ DNSSEC быў ануляваны -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Давераны ключ DNSSEC быў ануляваны. Неабходна наладзіць новы давераны ключ -або абнавіць аперацыйную сістэму, каб атрымаць абноўлены давераны ключ -DNSSEC. diff --git a/src/grp-journal/catalog/systemd.be@latin.catalog.in b/src/grp-journal/catalog/systemd.be@latin.catalog.in deleted file mode 100644 index fc9f7cad16..0000000000 --- a/src/grp-journal/catalog/systemd.be@latin.catalog.in +++ /dev/null @@ -1,318 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2015, 2016 Viktar Vaŭčkievič -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Belarusian Latin translation - -# Farmat kataloha apisany na staroncy -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: Servis žurnaliavannia zapusciŭsia -Defined-By: systemd -Support: %SUPPORT_URL% - -Praces sistemnaha žurnaliavannia zapusciŭsia, adkryŭ fajly dlia -zapisu i hatovy apracoŭvać zapyty. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Servis žurnaliavannia spyniŭsia -Defined-By: systemd -Support: %SUPPORT_URL% - -Praces sistemnaha žurnaliavannia spyniŭsia i zakryŭ usie fajly. - --- ec387f577b844b8fa948f33cad9a75e6 -Subject: dyskavaje miesca, zaniataje časopisam -Defined-By: systemd -Support: %SUPPORT_URL% - -@JOURNAL_NAME@ (@JOURNAL_PATH@) ciapier zajmaje @CURRENT_USE_PRETTY@. -Maksimaĺna dazvolieny pamier skladaje @MAX_USE_PRETTY@. -Pakidajem voĺnymi nie mieńš za @DISK_KEEP_FREE_PRETTY@ (dastupna na dysku -@DISK_AVAILABLE_PRETTY@). -Takim čynam, limit skladaje @LIMIT_PRETTY@, z jakich @AVAILABLE_PRETTY@ -dastupna. - -Limity na pamier naladžvaiecca z dapamohaj SystemMaxUse=, SystemKeepFree=, -SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= u -fajlie /etc/systemd/journald.conf. Hliadzicie journald.conf(5) dlia -detaliej. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Paviedamlienni z servisu adkinuty -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Servis adpraviŭ zanadta štat paviedamlienniaŭ za karotki pramiežak času. -Častka paviedamlienniaŭ byla adkinuta. - -Majcie na ŭvazie, što byli adkinuty paviedamliennia toĺki hetaha servisu. -Paviedamlienni inšych servisaŭ zastalisia. - -Miaža, paslia jakoj paviedamlienni buduć adkinuty, naladžvajecca z dapamohaj -RateLimitIntervalSec= i RateLimitBurst= u fajlie /etc/systemd/journald.conf. -Hliadzicie journald.conf(5) dlia detaliej. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Paviedamlienni stračany -Defined-By: systemd -Support: %SUPPORT_URL% - -Paviedamlienni jadra byli stračany, tak jak sistema žurnaliavannia nie -paspiela ich apracavać. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Praces @COREDUMP_PID@ (@COREDUMP_COMM@) skinuŭ damp pamiaci -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Praces @COREDUMP_PID@ (@COREDUMP_COMM@) razbiŭsia i skinuŭ damp pamiaci. - -Zvyčajna heta sviedčyć ab pamylcy ŭ prahramnym kodzie. -Rekamiendujecca paviedamić ab hetym raspracoŭnikam. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Novaja siesija № @SESSION_ID@ stvorana dlia karystaĺnika @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Novaja siesija z № @SESSION_ID@ stvorana dlia karystaĺnika @USER_ID@. - -Lidar hetaj siesii pad № @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Siesija № @SESSION_ID@ spyniena -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Siesija № @SESSION_ID@ spyniena. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Dastupna novaje pracoŭnaje miesca № @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Novaje pracoŭnaje miesca № @SEAT_ID@ naladžana i dastupna dlia -vykarystannia. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Pracoŭnaje miesca № @SEAT_ID@ vydaliena -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Pracoŭnaje miesca № @SEAT_ID@ vydaliena i boĺš nie dastupna. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Čas zmienieny -Defined-By: systemd -Support: %SUPPORT_URL% - -Sistemny hadzinnik zmienieny na @REALTIME@ mikrasiekund ad 1 studzienia -1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Časavy pojas zmienieny na @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Sistemny časavy pojas zmienieny na @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Zapusk sistemy zaviaršyŭsia -Defined-By: systemd -Support: %SUPPORT_URL% - -Usie sistemnyja servisy, nieabchodnyja dlia zahruzki sistemy, paspiachova -zapuscilisia. Majcie na ŭvazie, što heta nie značyć, što mašyna ničoha nie -robić. Mahčyma, niekatoryja servisy jašče inicyjalizirujucca. - -Na zapusk jadra spatrebilasia @KERNEL_USEC@ mikrasiekund. - -Na zapusk pačatkovaha RAM-dyska spatrebilasia @INITRD_USEC@ mikrasiekund. - -Na zapusk sistemnych servisaŭ spatrebilasia @USERSPACE_USEC@ mikrasiekund. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Sistema pierajšla ŭ stan snu @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Ciapier sistema pierajšla u stan snu @SLEEP@. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Sistema vyjšla sa stana snu @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Ciapier sistema vyjšla sa stana snu @SLEEP@. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Sistema zaviaršaje rabotu -Defined-By: systemd -Support: %SUPPORT_URL% - -Pačaŭsia praces vykliučennia sistemy. -Spyniajucca ŭsie sistemnyja servisy i demantujucca fajlavyja sistemy. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Junit @UNIT@ zapuskajecca -Defined-By: systemd -Support: %SUPPORT_URL% - -Pačaŭsia praces zapusku junita @UNIT@. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Junit @UNIT@ zapusciŭsia -Defined-By: systemd -Support: %SUPPORT_URL% - -Praces zapusku junita @UNIT@ zavieršany. - -Vynik: @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Junit @UNIT@ spyniajecca -Defined-By: systemd -Support: %SUPPORT_URL% - -Pačaŭsia praces spyniennia junita @UNIT@. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Junit @UNIT@ spynieny -Defined-By: systemd -Support: %SUPPORT_URL% - -Praces spyniennia junita @UNIT@ zavieršany. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Zboj junita @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Zboj junita @UNIT@. - -Vynik: @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: Junit @UNIT@ pieračytvaje svaju kanfihuracyju -Defined-By: systemd -Support: %SUPPORT_URL% - -Junit @UNIT@ pačaŭ pieračytvać svaju kanfihuracyju. - --- 7b05ebc668384222baa8881179cfda54 -Subject: Junit @UNIT@ pieračytaŭ svaju kanfihuracyju -Defined-By: systemd -Support: %SUPPORT_URL% - -Junit @UNIT@ pieračytaŭ svaju kanfihuracyju. - -Vynik: @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Praces @EXECUTABLE@ nie moža być vykanany -Defined-By: systemd -Support: %SUPPORT_URL% - -Praces @EXECUTABLE@ nie moža być vykanany ŭ vyniku zboju. - -Jon viarnuŭ pamylku numar @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Sibject: Adno ci boĺš paviedamlienniaŭ nie byli nakiravany ŭ syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Adno ci boĺš paviedamlienniaŭ nie byli nakiravany ŭ syslog servis, jaki -vykonvajecca paralieĺna z journald. Zvyčajna heta značyć, što -realizacyja syslog nie paspiavaje apracavać paviedamlienni z nieabchodnaj -chutkasciu. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Kropka mantavannia nie pustaja -Defined-By: systemd -Support: %SUPPORT_URL% - -Kataloh @WHERE@ ukazany jak kropka mantavannia (druhoje polie ŭ /etc/fstab -ci Where= polie ŭ fajlie junita systemd) i nie pusty. Heta nie pieraškadžaje -mantavanniu, alie isnujučyja ŭ im fajly buduć niedastupny. Dlia dostupu da -ich, kali laska, zmantujcie hetuju fajlavuju sistemu ŭ inšaje miesca. - --- 24d8d4452573402496068381a6312df2 -Subject: Virtuaĺnaja mašyna abo kantejnier zapusciŭsia -Defined-By: systemd -Support: %SUPPORT_URL% - -Virtuaĺnaja mašyna @NAME@ z lidaram № @LEADER@ zapuscilasia i -hatova dlia vykarystannia. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Virtuaĺnaja mašyna abo kantejnier spynieny -Defined-By: systemd -Support: %SUPPORT_URL% - -Virtuaĺnaja mašyna @NAME@ z lidaram № @LEADER@ spyniena. - --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: Miechanizm DNSSEC adkliučany, bo siervier nie padtrymlivaje jaho -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -Servis vyznačennia imion (systemd-resolved.service) vyznačyŭ, što -DNS-siervier nie padtrymlivaje miechanizm DNSSEC. U vyniku pravierka DNSSEC -byla adkliučana. - -Hetaja padzieja ŭznikaje kali naladžany DNSSEC=allow-downgrade -u fajlie resolved.conf i DNS-siervier nie padtrymlivaje miechanizm DNSSEC. -Zviarnicie ŭvahu, što režym allow-downgrade dazvaliaje praviesci ataku -«DNSSEC downgrade», u chodzie jakoj zlamysnik moža adkliučyć pravierku -DNSSEC šliacham padstanoŭki padroblienych DNSSEC-adkazaŭ u kamunikacyjny -kanal. - -Heta padzieja moža być prykmietaj taho, što DNS-siervier sapraŭdy -niesumiaščaĺny z DNSSEC abo što zlamysniku paspiachova atrymalasia praviesci -ataku pa adkliučenniu DNSSEC. - --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: Zboj pry praviercy DNSSEC -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -DNS-zapyt abo resursny zapis nie prajšoŭ pravierku DNSSEC. -Jak pravila, heta pakazvaje na zniešniaje ŭzdziejannie na kanal suviazi. - --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: Davierany kliuč DNSSEC byŭ anuliavany -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Davierany kliuč DNSSEC byŭ anuliavany. Nieabchodna naladzić novy davierany -kliuč abo abnavić apieracyjnuju sistemu, kab atrymać abnoŭlieny davierany -kliuč DNSSEC. diff --git a/src/grp-journal/catalog/systemd.bg.catalog.in b/src/grp-journal/catalog/systemd.bg.catalog.in deleted file mode 100644 index 76b0ce8f17..0000000000 --- a/src/grp-journal/catalog/systemd.bg.catalog.in +++ /dev/null @@ -1,324 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2016 Alexander Shopov -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages - -# The catalog format is documented on -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: Журналният процес е пуснат -Defined-By: systemd -Support: %SUPPORT_URL% - -Журналният процес на системата е стартирал, отворил е журналните файлове -за запис и може да приема заявки. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Журналният процес е спрян -Defined-By: systemd -Support: %SUPPORT_URL% - -Журналният процес на системата е спрян, затворени са всички отворени -журнални файлове. - --- ec387f577b844b8fa948f33cad9a75e6 -Subject: Пространството върху диска заето от журналните файлове -Defined-By: systemd -Support: %SUPPORT_URL% - -@JOURNAL_NAME@ (@JOURNAL_PATH@) в момента заема @CURRENT_USE_PRETTY@. -Максималният зададен размер е @MAX_USE_PRETTY@. -Свободни се оставят поне @DISK_KEEP_FREE_PRETTY@ (от текущо наличните @DISK_AVAILABLE_PRETTY@). -Максималният наложен размер е @LIMIT_PRETTY@, от който @AVAILABLE_PRETTY@ са свободни. - -Настройките за максималния размер на журнала върху диска се -управляват чрез директивите „SystemMaxUse=“, „SystemKeepFree=“, -„SystemMaxFileSize=“, „RuntimeMaxUse=“, „RuntimeKeepFree=“ и -„RuntimeMaxFileSize=“ във файла „/etc/systemd/journald.conf“. -За повече информация прегледайте „journald.conf(5)“ от ръководството. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Съобщенията от някоя услуга не са допуснати -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Някоя услуга генерира прекалено много съобщения за кратък период. -Част само от нейните съобщения са отхвърляни. - -Съобщенията от другите услуги не са засегнати. - -Настройките за максималния брой съобщения, които ще се обработят, се -управляват чрез директивите „RateLimitInterval=“ и „RateLimitBurst=“ във -файла „/etc/systemd/journald.conf“. За повече информация прегледайте -„journald.conf(5)“ от ръководството. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Пропуснати журнални съобщения -Defined-By: systemd -Support: %SUPPORT_URL% - -Някои от съобщенията на ядрото може и да са пропуснати, защото системата не -смогваше да ги обработи достатъчно бързо. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Процес № @COREDUMP_PID@ (@COREDUMP_COMM@) запази освободената памет -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Процес № @COREDUMP_PID@ (@COREDUMP_COMM@) заби, представянето му в паметта -бе запазено. - -Най-често това се дължи на грешка в забилата програма и следва да я -докладвате на създателите на програмата. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Създадена е нова сесия № @SESSION_ID@ за потребителя „@USER_ID@“ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -За потребителя „@USER_ID@“ е създадена нова сесия № @SESSION_ID@. - -Водещият процес на сесията е: @LEADER@ - --- 3354939424b4456d9802ca8333ed424a -Subject: Сесия № @SESSION_ID@ приключи -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Сесия № @SESSION_ID@ приключи работа. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Налично е ново работно място № @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Новото работно място № @SEAT_ID@ е настроено и готово за работа. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Работното място № @SEAT_ID@ е премахнато -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Работното място № @SEAT_ID@ вече не е налично. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Смяна на системното време -Defined-By: systemd -Support: %SUPPORT_URL% - -Часовникът на системата е сверен да сочи @REALTIME@ микросекунди след -1 януари 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Смяна на часовия пояс да е „@TIMEZONE@“ -Defined-By: systemd -Support: %SUPPORT_URL% - -Часовият пояс на системата е сменен на „@TIMEZONE@“. - --- b07a249cd024414a82dd00cd181378ff -Subject: Стартирането на системата завърши -Defined-By: systemd -Support: %SUPPORT_URL% - -Успешно са стартирали всички услуги, които са посочени за задействане при -стартиране на системата. Това не означава, че системата бездейства, защото -някои от услугите може да извършват специфични действия при стартиране. - -Стартирането на ядрото отне @KERNEL_USEC@ микросекунди. - -Стартирането на RAM диска за първоначално зареждане отне @INITRD_USEC@ -микросекунди. - -Стартирането на потребителските програми отне @USERSPACE_USEC@ микросекунди. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Системата е приспана на ниво „@SLEEP@“ -Defined-By: systemd -Support: %SUPPORT_URL% - -Системата премина в състояние на приспиване „@SLEEP@“. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Системата се събуди след приспиване на ниво„@SLEEP@“ -Defined-By: systemd -Support: %SUPPORT_URL% - -Системата се събуди от състояние на приспиване „@SLEEP@“. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Започна процедура на спиране на системата -Defined-By: systemd -Support: %SUPPORT_URL% - -Започна процедурата на Systemd за спиране на системата. Всички процеси и -услуги се спират, всички файлови системи се демонтират. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Модул „@UNIT@“ се стартира -Defined-By: systemd -Support: %SUPPORT_URL% - -Модулът „@UNIT@“ се стартира в момента - --- 39f53479d3a045ac8e11786248231fbf -Subject: Модул „@UNIT@“ вече е стартиран -Defined-By: systemd -Support: %SUPPORT_URL% - -Стартирането на модул „@UNIT@“ завърши. - -Резултатът е: @RESULT@ - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Модул „@UNIT@“ се спира -Defined-By: systemd -Support: %SUPPORT_URL% - -Модулът „@UNIT@“ се спира в момента. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Модул „@UNIT@“ вече е спрян -Defined-By: systemd -Support: %SUPPORT_URL% - -Спирането на модул „@UNIT@“ завърши. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Модулът „@UNIT@“ не успя да стартира -Defined-By: systemd -Support: %SUPPORT_URL% - -Модулът „@UNIT@“ не успя да стартира. - -Резултатът е: @RESULT@ - --- d34d037fff1847e6ae669a370e694725 -Subject: Модулът „@UNIT@“ започна презареждане на настройките си -Defined-By: systemd -Support: %SUPPORT_URL% - -Модулът „@UNIT@“ започна презареждане на настройките си. - --- 7b05ebc668384222baa8881179cfda54 -Subject: Модулът „@UNIT@“ завърши презареждането на настройките си -Defined-By: systemd -Support: %SUPPORT_URL% - -Модулът „@UNIT@“ завърши презареждането на настройките си. - -Резултатът e: @RESULT@ - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Програмата „@EXECUTABLE@“ не успя да се стартира -Defined-By: systemd -Support: %SUPPORT_URL% - -Програмата „@EXECUTABLE@“ не успя да се стартира. - -Върнатият номер на грешка е: @ERRNO@ - --- 0027229ca0644181a76c4e92458afa2e -Subject: Поне едно съобщение не бе препратено към syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Поне едно съобщение не бе препратено към журналната услуга syslog, която -работи успоредно с journald. - -Най-често това указва, че тази реализация на syslog не може да поеме текущия -обем съобщения. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Точката за монтиране не е празна -Defined-By: systemd -Support: %SUPPORT_URL% - -Директорията „@WHERE@“ не е празна. - -Тя е указана като точка за монтиране — или като второ поле във файла -„/etc/fstab“, или чрез директивата „Where=“ в някой от файловете за -модул на Systemd. - -Това не пречи на самото монтиране, но вече съществуващите там файлове и -директории няма да се виждат повече, освен ако ръчно не монтирате тази -непразна директория някъде другаде. - --- 24d8d4452573402496068381a6312df2 -Subject: Стартирана е виртуална машина или контейнер -Defined-By: systemd -Support: %SUPPORT_URL% - -Виртуалната машина „@NAME@“ с идентификатор на водещия процес @LEADER@ -е стартирана и готова за работа. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Спряна е виртуална машина или контейнер -Defined-By: systemd -Support: %SUPPORT_URL% - -Виртуалната машина „@NAME@“ с идентификатор на водещия процес @LEADER@ -е спряна. - --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: Режимът DNSSEC е изключен, защото сървърът не го поддържа -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -Локалната услуга за имена (systemd-resolved.service) установи, че -настроения сървър за DNS не поддържа DNSSEC, затова този режим е изключен. - -Това се случва, когато директивата „DNSSEC=allow-downgrade“ е включена във -файла „resolved.conf“ и зададеният сървър за DNS не е съвместим с DNSSEC. - -Внимавайте, защото това може да позволи атака, при която трета страна ви -връща отговори, които да предизвикат понижаването на сигурността от DNSSEC -до DNS. - -Такова събитие означава, че или сървърът за DNS не е съвместим с DNSSEC, -или някой успешно ви е атакувал за понижаване на сигурността на имената. - --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: Неуспешна проверка на DNSSEC -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Заявка или запис в DNS не издържа проверка с DNSSEC. - -Това обикновено показва вмешателство на трета страна в канала ви за връзка. - --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: Анулирана доверена котва в DNSSEC -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Анулирана е доверена котва за DNSSEC и трябва да настроите нова. - -Понякога новата идва с обновяване на системата. diff --git a/src/grp-journal/catalog/systemd.catalog.in b/src/grp-journal/catalog/systemd.catalog.in deleted file mode 100644 index 8de8597fe9..0000000000 --- a/src/grp-journal/catalog/systemd.catalog.in +++ /dev/null @@ -1,334 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages - -# The catalog format is documented on -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: The journal has been started -Defined-By: systemd -Support: %SUPPORT_URL% - -The system journal process has started up, opened the journal -files for writing and is now ready to process requests. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: The journal has been stopped -Defined-By: systemd -Support: %SUPPORT_URL% - -The system journal process has shut down and closed all currently -active journal files. - --- ec387f577b844b8fa948f33cad9a75e6 -Subject: Disk space used by the journal -Defined-By: systemd -Support: %SUPPORT_URL% - -@JOURNAL_NAME@ (@JOURNAL_PATH@) is currently using @CURRENT_USE_PRETTY@. -Maximum allowed usage is set to @MAX_USE_PRETTY@. -Leaving at least @DISK_KEEP_FREE_PRETTY@ free (of currently available @DISK_AVAILABLE_PRETTY@ of disk space). -Enforced usage limit is thus @LIMIT_PRETTY@, of which @AVAILABLE_PRETTY@ are still available. - -The limits controlling how much disk space is used by the journal may -be configured with SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, -RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= settings in -/etc/systemd/journald.conf. See journald.conf(5) for details. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Messages from a service have been suppressed -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -A service has logged too many messages within a time period. Messages -from the service have been dropped. - -Note that only messages from the service in question have been -dropped, other services' messages are unaffected. - -The limits controlling when messages are dropped may be configured -with RateLimitIntervalSec= and RateLimitBurst= in -/etc/systemd/journald.conf. See journald.conf(5) for details. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Journal messages have been missed -Defined-By: systemd -Support: %SUPPORT_URL% - -Kernel messages have been lost as the journal system has been unable -to process them quickly enough. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Process @COREDUMP_PID@ (@COREDUMP_COMM@) dumped core -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Process @COREDUMP_PID@ (@COREDUMP_COMM@) crashed and dumped core. - -This usually indicates a programming error in the crashing program and -should be reported to its vendor as a bug. - --- fc2e22bc6ee647b6b90729ab34a250b1 de -Subject: Speicherabbild für Prozess @COREDUMP_PID@ (@COREDUMP_COMM) generiert -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Prozess @COREDUMP_PID@ (@COREDUMP_COMM@) ist abgebrochen worden und -ein Speicherabbild wurde generiert. - -Üblicherweise ist dies ein Hinweis auf einen Programmfehler und sollte -als Fehler dem jeweiligen Hersteller gemeldet werden. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: A new session @SESSION_ID@ has been created for user @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -A new session with the ID @SESSION_ID@ has been created for the user @USER_ID@. - -The leading process of the session is @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Session @SESSION_ID@ has been terminated -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -A session with the ID @SESSION_ID@ has been terminated. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: A new seat @SEAT_ID@ is now available -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -A new seat @SEAT_ID@ has been configured and is now available. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Seat @SEAT_ID@ has now been removed -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -A seat @SEAT_ID@ has been removed and is no longer available. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Time change -Defined-By: systemd -Support: %SUPPORT_URL% - -The system clock has been changed to @REALTIME@ microseconds after January 1st, 1970. - --- c7a787079b354eaaa9e77b371893cd27 de -Subject: Zeitänderung -Defined-By: systemd -Support: %SUPPORT_URL% - -Die System-Zeit wurde geändert auf @REALTIME@ Mikrosekunden nach dem 1. Januar 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Time zone change to @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -The system timezone has been changed to @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: System start-up is now complete -Defined-By: systemd -Support: %SUPPORT_URL% - -All system services necessary queued for starting at boot have been -successfully started. Note that this does not mean that the machine is -now idle as services might still be busy with completing start-up. - -Kernel start-up required @KERNEL_USEC@ microseconds. - -Initial RAM disk start-up required @INITRD_USEC@ microseconds. - -Userspace start-up required @USERSPACE_USEC@ microseconds. - --- 6bbd95ee977941e497c48be27c254128 -Subject: System sleep state @SLEEP@ entered -Defined-By: systemd -Support: %SUPPORT_URL% - -The system has now entered the @SLEEP@ sleep state. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: System sleep state @SLEEP@ left -Defined-By: systemd -Support: %SUPPORT_URL% - -The system has now left the @SLEEP@ sleep state. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: System shutdown initiated -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemd shutdown has been initiated. The shutdown has now begun and -all system services are terminated and all file systems unmounted. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Unit @UNIT@ has begun start-up -Defined-By: systemd -Support: %SUPPORT_URL% - -Unit @UNIT@ has begun starting up. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Unit @UNIT@ has finished start-up -Defined-By: systemd -Support: %SUPPORT_URL% - -Unit @UNIT@ has finished starting up. - -The start-up result is @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Unit @UNIT@ has begun shutting down -Defined-By: systemd -Support: %SUPPORT_URL% - -Unit @UNIT@ has begun shutting down. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Unit @UNIT@ has finished shutting down -Defined-By: systemd -Support: %SUPPORT_URL% - -Unit @UNIT@ has finished shutting down. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Unit @UNIT@ has failed -Defined-By: systemd -Support: %SUPPORT_URL% - -Unit @UNIT@ has failed. - -The result is @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: Unit @UNIT@ has begun reloading its configuration -Defined-By: systemd -Support: %SUPPORT_URL% - -Unit @UNIT@ has begun reloading its configuration - --- 7b05ebc668384222baa8881179cfda54 -Subject: Unit @UNIT@ has finished reloading its configuration -Defined-By: systemd -Support: %SUPPORT_URL% - -Unit @UNIT@ has finished reloading its configuration - -The result is @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Process @EXECUTABLE@ could not be executed -Defined-By: systemd -Support: %SUPPORT_URL% - -The process @EXECUTABLE@ could not be executed and failed. - -The error number returned by this process is @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: One or more messages could not be forwarded to syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -One or more messages could not be forwarded to the syslog service -running side-by-side with journald. This usually indicates that the -syslog implementation has not been able to keep up with the speed of -messages queued. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Mount point is not empty -Defined-By: systemd -Support: %SUPPORT_URL% - -The directory @WHERE@ is specified as the mount point (second field in -/etc/fstab or Where= field in systemd unit file) and is not empty. -This does not interfere with mounting, but the pre-exisiting files in -this directory become inaccessible. To see those over-mounted files, -please manually mount the underlying file system to a secondary -location. - --- 24d8d4452573402496068381a6312df2 -Subject: A virtual machine or container has been started -Defined-By: systemd -Support: %SUPPORT_URL% - -The virtual machine @NAME@ with its leader PID @LEADER@ has been -started is now ready to use. - --- 58432bd3bace477cb514b56381b8a758 -Subject: A virtual machine or container has been terminated -Defined-By: systemd -Support: %SUPPORT_URL% - -The virtual machine @NAME@ with its leader PID @LEADER@ has been -shut down. - --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: DNSSEC mode has been turned off, as server doesn't support it -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -The resolver service (systemd-resolved.service) has detected that the -configured DNS server does not support DNSSEC, and DNSSEC validation has been -turned off as result. - -This event will take place if DNSSEC=allow-downgrade is configured in -resolved.conf and the configured DNS server is incompatible with DNSSEC. Note -that using this mode permits DNSSEC downgrade attacks, as an attacker might be -able turn off DNSSEC validation on the system by inserting DNS replies in the -communication channel that result in a downgrade like this. - -This event might be indication that the DNS server is indeed incompatible with -DNSSEC or that an attacker has successfully managed to stage such a downgrade -attack. - --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: DNSSEC validation failed -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -A DNS query or resource record set failed DNSSEC validation. This is usually -indication that the communication channel used was tampered with. - --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: A DNSSEC trust anchor has been revoked -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -A DNSSEC trust anchor has been revoked. A new trust anchor has to be -configured, or the operating system needs to be updated, to provide an updated -DNSSEC trust anchor. diff --git a/src/grp-journal/catalog/systemd.da.catalog.in b/src/grp-journal/catalog/systemd.da.catalog.in deleted file mode 100644 index bc7d94476f..0000000000 --- a/src/grp-journal/catalog/systemd.da.catalog.in +++ /dev/null @@ -1,261 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Danish translation - -# The catalog format is documented on -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: Journalen er blevet startet -Defined-By: systemd -Support: %SUPPORT_URL% - -System-journal processen har startet op, åbnet journal filerne for -tilskrivning og er nu klar til at modtage anmodninger. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Journalen er blevet stoppet -Defined-By: systemd -Support: %SUPPORT_URL% - -System-journal processen er stoppet og har lukket alle aktive journal -filer. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Beskeder fra en service er blevet undertrykt -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -En service har logget for mange beskeder inden for en given tidsperiode. -Beskeder fra omtalte service er blevet smidt væk. - -Kun beskeder fra omtalte service er smidt væk. Beskeder fra andre -services er ikke påvirket. - -Grænsen for hvornår beskeder bliver smidt væk kan konfigureres -med RateLimitIntervalSec= og RateLimitBurst= i -/etc/systemd/journald.conf. Se journald.conf(5) for detaljer herom. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Journal beskeder er gået tabt -Defined-By: systemd -Support: %SUPPORT_URL% - -Kernel beskeder er gået tabt da journal systemet ikke har været i stand -til at håndtere dem hurtigt nok. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Fejl-fil genereret for process @COREDUMP_PID@ (@COREDUMP_COMM@) -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Process @COREDUMP_PID@ (@COREDUMP_COMM@) har lukket ned og genereret en -fejl-fil. - -Dette indikerer som regel en programmeringsfejl i det nedlukkede program -og burde blive reporteret som en bug til folkene bag - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: En ny session @SESSION_ID@ er blevet lavet for bruger @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -En ny session med ID @SESSION_ID@ er blevet lavet for brugeren @USER_ID@. - -Den ledende process for sessionen er @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Session @SESSION_ID@ er blevet lukket ned -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -En session med ID @SESSION_ID@ er blevet lukket ned. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: En ny arbejdsstation $SEAT_ID@ er nu tilgængelig -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -En ny arbejdsstation @SEAT_ID@ er blevet konfigureret og er nu tilgængelig. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Arbejdsstation @SEAT_ID@ er nu blevet fjernet -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -En arbejdsstation @SEAT_ID@ er blevet fjernet og er ikke længere tilgængelig. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Tidsændring -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemtiden er blevet ændret til @REALTIME@ mikrosekunder efter d. 1. Januar 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Tidszoneændring til @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Tidszonen for systemet er blevet ændret til @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Opstart af systemet er nu fuldført -Defined-By: systemd -Support: %SUPPORT_URL% - -Alle system services i kø til at køre ved opstart, er blevet startet -med success. Bemærk at dette ikke betyder at maskinen er i dvale, da -services stadig kan være i gang med at færdiggøre deres opstart. - -Opstart af kernel tog @KERNEL_USEC@ mikrosekunder. - -Opstart af initrd tog @INITRD_USEC@ mikrosekunder. - -Opstart af userspace tog @USERSPACE_USEC@ mikrosekunder. - --- 6bbd95ee977941e497c48be27c254128 -Subject: System slumretilstand @SLEEP@ trådt i kraft -Defined-By: systemd -Support: %SUPPORT_URL% - -System er nu gået i @SLEEP@ slumretilstand. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: System slumretilstand @SLEEP@ forladt -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemet har nu forladt @SLEEP@ slumretilstand. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Systemnedlukning påbegyndt -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemnedlukning er blevet påbegyndt. Nedlukningen er nu begyndt og -alle system services er blevet afbrudt og alle filsystemer afmonteret. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Enhed @UNIT@ har påbegyndt opstart -Defined-By: systemd -Support: %SUPPORT_URL% - -Enhed @UNIT@ er begyndt at starte op. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Enhed @UNIT har færdiggjort opstart -Defined-By: systemd -Support: %SUPPORT_URL% - -Enhed @UNIT@ er færdig med at starte op. - -Resultat for opstart er @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Enhed @UNIT@ har påbegyndt nedlukning -Defined-By: systemd -Support: %SUPPORT_URL% - -Enhed @UNIT@ har påbegyndt nedlukning. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Enhed @UNIT@ har færdiggjort nedlukning -Defined-By: systemd -Support: %SUPPORT_URL% - -Enhed @UNIT@ har færdiggjort nedlukning. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Enhed @UNIT@ har fejlet -Defined-By: systemd -Support: %SUPPORT_URL% - -Enhed @UNIT@ har fejlet. - -Resultatet er @RESULT@ - --- d34d037fff1847e6ae669a370e694725 -Subject: Enhed @UNIT@ har påbegyndt genindlæsning af sin konfiguration -Defined-By: systemd -Support: %SUPPORT_URL% - -Enhed @UNIT@ er begyndt at genindlæse sin konfiguration - --- 7b05ebc668384222baa8881179cfda54 -Subject: Enhed @UNIT@ har færdiggjort genindlæsning af sin konfiguration -Defined-By: systemd -Support: %SUPPORT_URL% - -Enhed @UNIT@ er færdig med at genindlæse sin konfiguration - -Resultatet er: @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Process @EXECUTABLE@ kunne ikke eksekveres -Defined-By: systemd -Support: %SUPPORT_URL% - -Processen @EXECUTABLE@ kunne ikke eksekveres og fejlede. - -Processens returnerede fejlkode er @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Èn eller flere beskeder kunne ikke videresendes til syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Èn eller flere beskeder kunne ikke videresendes til syslog servicen -der kører side-om-side med journald. Dette indikerer typisk at syslog -implementationen ikke har kunnet følge med mængden af ventende beskeder. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Monteringspunkt er ikke tomt -Defined-By: systemd -Support: %SUPPORT_URL% - -Folderen @WHERE@ er specificeret som monteringspunkt (andet felt i -/etc/fstab eller Where= feltet i systemd enhedsfil) men er ikke tom. -Dette forstyrrer ikke monteringen, men de pre-eksisterende filer i folderen -bliver utilgængelige. For at se de over-monterede filer; montér det -underlæggende filsystem til en anden lokation. - --- 24d8d4452573402496068381a6312df2 -Subject: En virtuel maskine eller container er blevet startet -Defined-By: systemd -Support: %SUPPORT_URL% - -Den virtuelle maskine @NAME@ med dens leder PID @LEADER@ er blevet -startet og er klar til brug. - --- 58432bd3bace477cb514b56381b8a758 -Subject: En virtuel maskine eller container er blevet afbrudt -Defined-By: systemd -Support: %SUPPORT_URL% - -Den virtuelle maskine @NAME@ med dens leder PID @LEADER@ er blevet -nedlukket. diff --git a/src/grp-journal/catalog/systemd.fr.catalog.in b/src/grp-journal/catalog/systemd.fr.catalog.in deleted file mode 100644 index 573b288e74..0000000000 --- a/src/grp-journal/catalog/systemd.fr.catalog.in +++ /dev/null @@ -1,320 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2013-2015 Sylvain Plantefève -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# French translation - -# Le format du catalogue de messages est décrit (en anglais) içi : -# http://www.freedesktop.org/wiki/Software/systemd/catalog - --- f77379a8490b408bbe5f6940505a777b -Subject: Le journal a été démarré -Defined-By: systemd -Support: %SUPPORT_URL% - -Le processus du journal système a démarré, ouvert ses fichiers en écriture -et est prêt à traiter les requêtes. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Le journal a été arrêté -Defined-By: systemd -Support: %SUPPORT_URL% - -Le processus du journal système a été arrêté et tous ses fichiers actifs -ont été fermés. - --- ec387f577b844b8fa948f33cad9a75e6 -Subject: Espace disque utilisé par le journal -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -@JOURNAL_NAME@ (@JOURNAL_PATH@) utilise actuellement @CURRENT_USE_PRETTY@. -Le maximum autorisé est défini à @MAX_USE_PRETTY@. -Au moins @DISK_KEEP_FREE_PRETTY@ doivent être laissés libres -(sur @DISK_AVAILABLE_PRETTY@ d'espace disque actuellement libre). -La limite appliquée est donc @LIMIT_PRETTY@, dont @AVAILABLE_PRETTY@ -sont toujours disponibles. - -Les limites définissant la quantité d'espace disque que peut utiliser le -journal peuvent être configurées avec les paramètres SystemMaxUse=, -SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, -RuntimeMaxFileSize= dans le fichier /etc/systemd/journald.conf. -Voir journald.conf(5) pour plus de détails. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Des messages d'un service ont été supprimés -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Un service a essayé d'enregistrer un trop grand nombre de messages sur un -intervalle de temps donné. Des messages de ce service ont été évincés. - -Notez que seuls des messages de ce service ont été évincés, les messages des -autres services ne sont pas affectés. - -Les limites définissant ce comportement peuvent être configurées avec les -paramètres RateLimitIntervalSec= et RateLimitBurst= dans le fichier -/etc/systemd/journald.conf. Voir journald.conf(5) pour plus de détails. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Des messages du journal ont été manqués -Defined-By: systemd -Support: %SUPPORT_URL% - -Des messages du noyau ont été manqués car le journal système n'a pas été -capable de les traiter suffisamment vite. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Le processus @COREDUMP_PID@ (@COREDUMP_COMM@) a généré un fichier « core » -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Le processus @COREDUMP_PID@ (@COREDUMP_COMM@) a planté et généré un fichier « core ». - -Cela indique généralement une erreur de programmation dans le programme -incriminé, et cela devrait être notifié à son concepteur comme un défaut (bug). - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Une nouvelle session @SESSION_ID@ a été créée pour l'utilisateur @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Une nouvelle session a été créée pour l'utilisateur @USER_ID@ avec -l'identifiant (ID) @SESSION_ID@. - -Le processus maître de la session est @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: La session @SESSION_ID@ s'est terminée -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -La session d'identifiant (ID) @SESSION_ID@ s'est terminée. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Un nouveau poste (seat) @SEAT_ID@ est disponible -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Un nouveau poste (seat) @SEAT_ID@ a été configuré et est maintenant -disponible. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Le poste (seat) @SEAT_ID@ a été retiré -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Le poste (seat) @SEAT_ID@ a été retiré et n'est plus disponible. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Changement d'heure -Defined-By: systemd -Support: %SUPPORT_URL% - -L'horloge système a été modifiée et positionnée à @REALTIME@ microsecondes -après le 1er janvier 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Fuseau horaire modifié en @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Le fuseau horaire du système a été modifié et positionné à @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Le démarrage du système est terminé -Defined-By: systemd -Support: %SUPPORT_URL% - -Tous les services nécessaires au démarrage du système ont été lancés avec -succès. Notez que cela ne signifie pas que le système est maintenant au -repos, car des services peuvent encore être en train de terminer leur -démarrage. - -Le chargement du noyau a nécessité @KERNEL_USEC@ microsecondes. - -Le chargement du « RAM disk » initial a nécessité @INITRD_USEC@ microsecondes. - -Le chargement de l'espace utilisateur a nécessité @USERSPACE_USEC@ microsecondes. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Le système entre dans l'état de repos (sleep state) @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Le système est maintenant à l'état de repos (sleep state) @SLEEP@. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Le système sorti de l'état de repos (sleep state) @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Le système est maintenant sorti de l'état de repos (sleep state) @SLEEP@. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Arrêt du système amorcé -Defined-By: systemd -Support: %SUPPORT_URL% - -L'arrêt du système a été amorcé. L'arrêt a maintenant commencé, tous les -services du système sont terminés et tous les systèmes de fichiers sont -démontés. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: L'unité (unit) @UNIT@ a commencé à démarrer -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unité (unit) @UNIT@ a commencé à démarrer. - --- 39f53479d3a045ac8e11786248231fbf -Subject: L'unité (unit) @UNIT@ a terminé son démarrage -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unité (unit) @UNIT@ a terminé son démarrage, avec le résultat @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: L'unité (unit) @UNIT@ a commencé à s'arrêter -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unité (unit) @UNIT@ a commencé à s'arrêter. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: L'unité (unit) @UNIT@ a terminé son arrêt -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unité (unit) @UNIT@ a terminé son arrêt. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: L'unité (unit) @UNIT@ a échoué -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unité (unit) @UNIT@ a échoué, avec le résultat @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: L'unité (unit) @UNIT@ a commencé à recharger sa configuration -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unité (unit) @UNIT@ a commencé à recharger sa configuration. - --- 7b05ebc668384222baa8881179cfda54 -Subject: L'unité (unit) @UNIT@ a terminé de recharger configuration -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unité (unit) @UNIT@ a terminé de recharger configuration, -avec le résultat @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Le processus @EXECUTABLE@ n'a pas pu être exécuté -Defined-By: systemd -Support: %SUPPORT_URL% - -Le processus @EXECUTABLE@ n'a pas pu être exécuté, et a donc échoué. - -Le code d'erreur renvoyé est @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Un ou plusieurs messages n'ont pas pu être transmis à syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Un ou plusieurs messages n'ont pas pu être transmis au service syslog -s'exécutant conjointement avec journald. Cela indique généralement que -l'implémentation de syslog utilisée n'a pas été capable de suivre -la cadence du flux de messages. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Le point de montage n'est pas vide -Defined-By: systemd -Support: %SUPPORT_URL% - -Le répertoire @WHERE@ est spécifié comme point de montage (second champ du -fichier /etc/fstab, ou champ Where= dans une unité (unit) systemd) et n'est -pas vide. -Cela ne perturbe pas le montage du système de fichiers, mais les fichiers -préalablement présents dans ce répertoire sont devenus inaccessibles. -Pour atteindre ces fichiers, veuillez monter manuellement le système de -fichiers sous-jacent à un autre emplacement. - --- 24d8d4452573402496068381a6312df2 -Subject: Une machine virtuelle ou un conteneur (container) a été démarré -Defined-By: systemd -Support: %SUPPORT_URL% - -La machine virtuelle @NAME@ a été démarrée avec le PID maître @LEADER@, -et est maintenant prête à l'emploi. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Une machine virtuelle ou un conteneur (container) a été arrêté -Defined-By: systemd -Support: %SUPPORT_URL% - -La machine virtuelle @NAME@ avec le PID maître @LEADER@ a été arrêtée. - --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: Le mode DNSSEC a été désactivé, car il n'est pas supporté par le serveur -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -Le service de résolution (systemd-resolved.service) a détecté que le serveur -DNS configuré ne supporte pas DNSSEC, et la validation DNSSEC a donc été -désactivée. - -Cet évènement se produit si DNSSEC=allow-downgrade est configuré dans -resolved.conf et que le serveur DNS configuré n'est pas compatible avec -DNSSEC. -Veuillez noter que ce mode permet des attaques de rétrogradation DNSSEC, -car un attaquant peut être capable de désactiver la validation DNSSEC sur -le système en injectant des réponses DNS dans le canal de communication. - -Cet évènement indique que le serveur DNS est effectivement incompatible avec -DNSSEC, ou qu'un attaquant a peut-être conduit une telle attaque avec succès. - --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: La validation DNSSEC a échoué -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Une requête ou une ressource DNS n'a pas passé la validation DNSSEC. -Ceci est généralement une indication que le canal de communication a été -altéré. - --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: Une ancre de confiance DNSSEC a été révoquée -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Une ancre de confiance DNSSEC a été révoquée. Une nouvelle ancre de -confiance doit être configurée, ou le système d'exploitation a besoin -d'être mis à jour, pour fournir une version à jour de l'ancre de confiance. diff --git a/src/grp-journal/catalog/systemd.hr.catalog.in b/src/grp-journal/catalog/systemd.hr.catalog.in deleted file mode 100644 index 7502aed741..0000000000 --- a/src/grp-journal/catalog/systemd.hr.catalog.in +++ /dev/null @@ -1,314 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Croatian translation - -# Format kataloga je dokumentiran na -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# Za pojašnjenje zašto ovo radimo, posjetite https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: journal je pokrenut -Defined-By: systemd -Support: %SUPPORT_URL% - -Journal proces sustava se pokrenuo, otvorio je journal - datoteke za upis i spreman je za obradu zahtjeva. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: journal je zaustavljen -Defined-By: systemd -Support: %SUPPORT_URL% - -Journal proces sustava je isključio i zatvorio sve trenutno -aktivne journal datoteke. - --- ec387f577b844b8fa948f33cad9a75e6 -Subject: Diskovni prostor koji koristi journal -Defined-By: systemd -Support: %SUPPORT_URL% - -@JOURNAL_NAME@ (@JOURNAL_PATH@) trenutno koristi @CURRENT_USE_PRETTY@. -Najveća dopuštena upotreba je postavljena na @MAX_USE_PRETTY@. -Ostavljam najmanje @DISK_KEEP_FREE_PRETTY@ slobodno (trenutno dostupno @DISK_AVAILABLE_PRETTY@ diskovnog prostora). -Prisilno ograničenje upotrebe je @LIMIT_PRETTY@, od kojeg je @AVAILABLE_PRETTY@ još dostupno. - -Ograničenja kontroliraju koliko diskovnog prostora koristi journal mogu -se podesiti sa SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, -RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= settings u -/etc/systemd/journald.conf. Pogledajte journald.conf(5) za više pojedinosti. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Poruka iz usluge je potisnuta -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Usluga je prijavila previše poruka u određenom vremenskom razdoblju. Poruke -iz usluge su odbačene. - -Zapamtite da samo poruke iz usluge u upitu su -odbačene, ostale poruke usluga nisu zahvaćene. - -Ograničenja koja kontroliraju kada je poruka odbačena mogu se podesiti -sa RateLimitIntervalSec= i RateLimitBurst= u -/etc/systemd/journald.conf. Pogledajte journald.conf(5) za više pojedinosti. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Journal poruka je propuštena -Defined-By: systemd -Support: %SUPPORT_URL% - -Kernel poruka je izgubljena zato jer ih journal sustav nije mogao -dovoljno brzo obraditi. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Proces @COREDUMP_PID@ (@COREDUMP_COMM@) je izbacio jezgru -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Proces @COREDUMP_PID@ (@COREDUMP_COMM@) se srušio i izbacio jezgru. - -Rušenje programa je uobičajeno uzrokovano greškom u programiranju i -trebalo bi se prijaviti razvijatelju kao greška. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Nova sesija @SESSION_ID@ je stvorena za korisnika @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Nova sesija sa ID @SESSION_ID@ je stvorena za korisnika @USER_ID@. - -Glavni proces sesije je @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Sesija @SESSION_ID@ je prekinuta -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Sesija sa ID @SESSION_ID@ je prekinuta. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Novo sjedište @SEAT_ID@ je sada dostupno -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Novo sjedište @SEAT_ID@ je podešeno i sada je dostupno. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Sjedište @SEAT_ID@ je sada uklonjeno -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Sjedište @SEAT_ID@ je uklonjeno i više nije dostupno. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Vrijeme promjene -Defined-By: systemd -Support: %SUPPORT_URL% - -Sat sustava je promijenjen na @REALTIME@ microsekundi nakon 1. Siječnja, 1970 godine. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Vremenska zona je promijenjena u @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Vremenska zona je promijenjena u @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Pokretanje sustava je sada završeno -Defined-By: systemd -Support: %SUPPORT_URL% - -Sve usluge sustava koje su zadane za pokretanje pri pokretanju sustava -su uspješno pokrenute. Zapamtite da ovo ne znači da sada računalo -miruje zato jer se neke usluge još uvijek mogu pokretati. - -Pokretanje kernela zahtijeva @KERNEL_USEC@ mikrosekundi. - -Pokretanje početnog RAM diska zahtijeva @INITRD_USEC@ mikrosekundi. - -Pokretanje prostora korisnika zahtijeva @USERSPACE_USEC@ mikrosekundi. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Pokrenuto je stanje spavanja @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Sustav je sada pokrenuo stanje spavanja @SLEEP@ - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Završeno je stanje spavanja @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Sustav je sada završio stanje spavanja @SLEEP@ - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Pokrenuto je isključivanje sustava -Defined-By: systemd -Support: %SUPPORT_URL% - -Pokrenuto je isključivanje sustava. Isključivanje je sada pokrenuto, -sve usluge sustava su prekinute i svi datotečni sustavi su odmontirani. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Jedinica @UNIT@ je započela pokretanje -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedinica @UNIT@ je započela pokretanje. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Jedinica @UNIT@ je završila pokretanje -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedinica @UNIT@ je završila pokretanje. - -Rezultat pokretanja je @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Jedinica @UNIT@ je započela isključivanje -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedinica @UNIT@ je započela isključivanje. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Jedinica @UNIT@ je završila isključivanje -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedinica @UNIT@ je završila isključivanje. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Jedinica @UNIT@ nije uspjela -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedinica @UNIT@ nije uspjela. - -Rezultat je @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: Jedinica @UNIT@ je započela ponovno učitavati podešavanja -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedinica @UNIT@ je započela ponovno učitavati podešavanja - --- 7b05ebc668384222baa8881179cfda54 -Subject: Jedinica @UNIT@ je završila ponovno učitavati podešavanja -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedinica @UNIT@ je završila ponovno učitavati podešavanja - -Rezultat je @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Proces @EXECUTABLE@ se ne može pokrenuti -Defined-By: systemd -Support: %SUPPORT_URL% - -Proces @EXECUTABLE@ se ne može pokrenuti i nije uspio. - -Broj greške vraćen ovim procesom je @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Jedna ili više poruka se ne mogu proslijediti u dnevnik sustava -Defined-By: systemd -Support: %SUPPORT_URL% - -Jedna ili više poruka se ne mogu proslijediti u dnevnik sustava, usluge -su pokrenute istovremeno s journalom. Ovo uobičajeno označava da -implementacija dnevnika sustava ne može slijediti brzinu -zahtjeva poruka. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Točka montiranja nije prazna -Defined-By: systemd -Support: %SUPPORT_URL% - -Direktorij @WHERE@ je određen za točku montiranja (drugi redak u -/etc/fstab ili Where= redak u datoteci systemd jedinice) i nije prazan. -To ne utječe na montiranje, ali postojeće datoteke u ovom direktoriju -postaju nedostupne. Kako bi vidjeli datoteke preko kojih je montirano, -ručno montirajte osnovni datotečni sustav na drugu lokaciju. - --- 24d8d4452573402496068381a6312df2 -Subject: Virtualni stroj ili spremnik su pokrenuti -Defined-By: systemd -Support: %SUPPORT_URL% - -Virtualni stroj @NAME@ sa vodećim @LEADER@ PID-om je -pokrenut i spreman je za korištenje. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Virtualni stroj ili spremnik su isključeni -Defined-By: systemd -Support: %SUPPORT_URL% - -Virtualni stroj @NAME@ sa vodećim PID-om @LEADER@ je -isključen. - --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: DNSSEC način je isključen, jer ga poslužitelj ne podržava -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -Usluga razrješavanja (systemd-resolved.service) je otkrila da -podešeni DNS poslužitelj ne podržava DNSSEC, i DNSSEC, kao rezultat -provjera je isključena. - -Ovaj događaj će zauzeti mjesto ako je DNSSEC=allow-downgrade podešen u -resolved.conf i podešeni DNS poslužitelj je nekompatibilan s DNSSEC. Zapamtite -da korištenje ovog načina dopušta povećanje DNSSEC napada, napadač bi mogao -isključiti DNSSEC provjeru na sustavu umetanjem DNS odgovora u -komunikacijski kanal što rezultira povećanjem napada poput ovog. - -Ovaj događaj bi mogao označavati da je DNS poslužitelj uistinu nekompatibilan s -DNSSEC ili da je napadač uspješno izvršio takav napad. - --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: DNSSEC provjera neuspješna -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -DNS zahtjev ili snimak resursa nije prošao DNSSEC provjeru. To uobičajeno -označava da je komunikacijski kanal mijenjan. - --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: DNSSEC pouzdano sidro je opozvano -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -A DNSSEC trust anchor has been revoked. A new trust anchor has to be -configured, or the operating system needs to be updated, to provide an updated -DNSSEC trust anchor. diff --git a/src/grp-journal/catalog/systemd.hu.catalog.in b/src/grp-journal/catalog/systemd.hu.catalog.in deleted file mode 100644 index f538b7f958..0000000000 --- a/src/grp-journal/catalog/systemd.hu.catalog.in +++ /dev/null @@ -1,262 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2016 Gabor Kelemen -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages - -# The catalog format is documented on -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: A napló elindult -Defined-By: systemd -Support: %SUPPORT_URL% - -A rendszernapló folyamat elindult, megnyitotta írásra a naplófájlokat, -és most készen áll kérések feldolgozására. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: A napló leállt -Defined-By: systemd -Support: %SUPPORT_URL% - -A rendszernapló folyamat leállt, és bezárt minden jelenleg aktív naplófájlt. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Egy szolgáltatás üzenetei elnémítva -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Egy szolgáltatás túl sok üzenetet naplózott adott idő alatt. A -szolgáltatástól származó üzenetek eldobásra kerültek. - -Ne feledje, hogy csak a kérdéses szolgáltatás üzenetei kerültek eldobásra, - más szolgáltatások üzeneteit ez nem befolyásolja. - -Az üzenetek eldobását vezérlő korlátok az /etc/systemd/journald.conf -RateLimitIntervalSec= és RateLimitBurst= beállításaival adhatók meg. -Részletekért lásd a journald.conf(5) man oldalt. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Naplóüzenetek vesztek el -Defined-By: systemd -Support: %SUPPORT_URL% - -Kernelüzenetek vesztek el, mert a naplózó rendszer nem tudta elég gyorsan -feldolgozni azokat. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Egy folyamat összeomlott: @COREDUMP_PID@ (@COREDUMP_COMM@) -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Ez a folyamat: @COREDUMP_PID@ (@COREDUMP_COMM@) összeomlott, és core fájlt - írt ki. - -Ez általában programozási hibát jelez az összeomló programban, és -a szállítója felé kell bejelenteni. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Új munkamenet (@SESSION_ID@) létrehozva, felhasználója: @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Létrejött egy új munkamenet @SESSION_ID@ azonosítóval ezen felhasználóhoz: -@USER_ID@. - -A munkamenet vezető folyamata: @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Munkamenet (@SESSION_ID@) befejezve -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -A következő azonosítójú munkamenet befejeződött: @SESSION_ID@. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Elérhető egy új munkaállomás: @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Beállításra kerül és használható egy új munkaállomás: @SEAT_ID@. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: A munkaállomás eltávolítva: @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -A munkaállomás el lett távolítva, és már nem érhető el: @SEAT_ID@ - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Időmódosítás -Defined-By: systemd -Support: %SUPPORT_URL% - -A rendszeróra beállítva @REALTIME@ ezredmásodpercre 1970. január 1. után. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Időzóna-módosítás erre: @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -A rendszer időzónája módosítva lett erre: @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: A rendszer indítása kész -Defined-By: systemd -Support: %SUPPORT_URL% - -A rendszerindításkor szükséges indításhoz sorba állított összes -rendszerszolgáltatás elindult. Ne feledje, hogy ez nem jelenti, hogy a -gép üresjáratban van, mivel egyes szolgáltatások még az indítás -befejezésével lehetnek elfoglalva. - -A kernel indítása @KERNEL_USEC@ ezredmásodpercet igényelt. - -A kiinduló RAM lemez indítása @INITRD_USEC@ ezredmásodpercet igényelt. - -A felhasználói programok indítása @USERSPACE_USEC@ ezredmásodpercet igényelt. - --- 6bbd95ee977941e497c48be27c254128 -Subject: A rendszer „@SLEEP@” alvási állapotba lépett -Defined-By: systemd -Support: %SUPPORT_URL% - -A rendszer belépett ebbe az alvási állapotba: @SLEEP@. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: A rendszer „@SLEEP@” alvási állapotból kilépett -Defined-By: systemd -Support: %SUPPORT_URL% - -A rendszer kilépett ebből az alvási állapotból: @SLEEP@. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Rendszer leállítása kezdeményezve -Defined-By: systemd -Support: %SUPPORT_URL% - -A systemd leállítása kezdeményezve. A leállítás megkezdődött, minden -rendszerszolgáltatás befejeződik, minden fájlrendszer leválasztásra kerül. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: A(z) @UNIT@ egység indítása megkezdődött -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @UNIT@ egység megkezdte az indulást. - --- 39f53479d3a045ac8e11786248231fbf -Subject: A(z) @UNIT@ egység befejezte az indulást -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @UNIT@ egység befejezte az indulást - -Az indítás eredménye: @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: A(z) @UNIT@ egység megkezdte a leállást -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @UNIT@ egység megkezdte a leállást. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: A(z) @UNIT@ egység befejezte a leállást -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @UNIT@ egység befejezte a leállást. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: A(z) @UNIT@ egység hibát jelzett -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @UNIT@ egység hibát jelzett. - -Az eredmény: @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: A(z) @UNIT@ egység megkezdte a beállításainak újratöltését -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @UNIT@ egység megkezdte a beállításainak újratöltését. - --- 7b05ebc668384222baa8881179cfda54 -Subject: A(z) @UNIT@ egység befejezte a beállításainak újratöltését -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @UNIT@ egység befejezte a beállításainak újratöltését. - -Az eredmény: @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: A folyamat végrehajtása sikertelen: @EXECUTABLE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -A folyamat végrehajtása sikertelen volt, és hibát jelzett: @EXECUTABLE@. - -A folyamat által visszaadott hibaszám: @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Legalább egy üzenet nem továbbítható a rendszernaplónak -Defined-By: systemd -Support: %SUPPORT_URL% - -Legalább egy üzenet nem volt továbbítható a journald-vel párhuzamosan futó -syslog szolgáltatásnak. Ez általában azt jelenti, hogy a syslog -megvalósítás nem volt képes lépést tartani a sorba állított -üzenetek sebességével. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: A csatolási pont nem üres -Defined-By: systemd -Support: %SUPPORT_URL% - -A csatolási pontként megadott @WHERE@ könyvtár (második mező az /etc/fstab -fájlban, vagy a Where= sor a systemd egységfájlban) nem üres. Ez nem -akadályozza meg a csatolást, de a könyvtárban már meglévő fájlok -elérhetetlenné válnak. A fájlok láthatóvá tételéhez csatolja -az azokat tartalmazó fájlrendszert egy másodlagos helyre. - --- 24d8d4452573402496068381a6312df2 -Subject: Egy virtuális gép vagy konténer elindult -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @NAME@ nevű virtuális gép (vezető PID: @LEADER@) elindult, és -használatra kész. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Egy virtuális gép vagy konténer befejeződött -Defined-By: systemd -Support: %SUPPORT_URL% - -A(z) @NAME@ nevű virtuális gép (vezető PID: @LEADER@) leállt. diff --git a/src/grp-journal/catalog/systemd.it.catalog.in b/src/grp-journal/catalog/systemd.it.catalog.in deleted file mode 100644 index 86e44a604d..0000000000 --- a/src/grp-journal/catalog/systemd.it.catalog.in +++ /dev/null @@ -1,254 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2013 Daniele Medri -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages - --- f77379a8490b408bbe5f6940505a777b -Subject: Il registro è stato avviato -Defined-By: systemd -Support: %SUPPORT_URL% - -Il processo relativo al registro di sistema è stato avviato, ha aperto i -file in scrittura ed è ora pronto a gestire richieste. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Il registro è stato terminato -Defined-By: systemd -Support: %SUPPORT_URL% - -Il processo relativo al registro di sistema è stato terminato e ha chiuso -tutti i file attivi. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: I messaggi di un servizio sono stati soppressi -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Un servizio ha registrato troppi messaggi in un dato periodo di tempo. -I messaggi del servizio sono stati eliminati. - -Solo i messaggi del servizio indicato sono stati -eliminati, i messaggi degli altri servizi rimangono invariati. - -I limiti oltre i quali i messaggi si eliminano si configurano -con RateLimitIntervalSec= e RateLimitBurst= in -/etc/systemd/journald.conf. Vedi journald.conf(5) per maggiori informazioni. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: I messaggi di un servizio sono stati perduti -Defined-By: systemd -Support: %SUPPORT_URL% - -I messaggi del kernel sono stati perduti perché, il registro di sistema -non è stato in grado di gestirli abbastanza velocemente. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Il processo @COREDUMP_PID@ (@COREDUMP_COMM@) ha generato un dump. -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Il processo @COREDUMP_PID@ (@COREDUMP_COMM@) si è bloccato generando un dump. - -Questo di solito capita per un errore di programmazione nell'applicazione e -dovrebbe essere segnalato al vendor come un bug. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: La nuova sessione @SESSION_ID@ è stata creata per l'utente @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Una nuova sessione con ID @SESSION_ID@ è stata creata per l'utente @USER_ID@. - -Il processo primario della sessione è @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: La sessione @SESSION_ID@ è terminata -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -La sessione con ID @SESSION_ID@ è terminata. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: La nuova postazione @SEAT_ID@ è ora disponibile -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -La nuova postazione @SEAT_ID@ è stata configurata ed è ora disponibile. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: La postazione @SEAT_ID@ è stata rimossa -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -La postazione @SEAT_ID@ è stata rimossa e non è più disponibile. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Cambio d'orario -Defined-By: systemd -Support: %SUPPORT_URL% - -L'orologio di sistema è cambiato in @REALTIME@ microsecondi dal 1 gennaio, 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Il fuso orario è cambiato in @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Il fuso orario di sistema è cambiato in @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Avvio del sistema completato. -Defined-By: systemd -Support: %SUPPORT_URL% - -Tutti i servizi di sistema richiesti per la fase di avvio sono stati eseguiti -con successo. Nota che la macchina potrebbe non essere ancora pronta in quanto -i servizi attivati sono in fase di completamento. - -L'avvio del kernel ha richiesto @KERNEL_USEC@ microsecondi. - -L'avvio del disco RAM ha richiesto @INITRD_USEC@ microsecondi. - -L'avvio dello userspace ha richiesto @USERSPACE_USEC@ microsecondi. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Il sistema è entrato in fase di pausa @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Il sistema è entrato nello stato di pausa @SLEEP@. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Il sistema è uscito dalla fase di pausa @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Il sistema è uscito dallo stato di pausa @SLEEP@. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Il sistema è in fase di spegnimento -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemd è in fase di spegnimento. Tutti i servizi di sistema -saranno terminati e tutti i file systems smontati. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: L'unità @UNIT@ inizia la fase di avvio -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unità @UNIT@ ha iniziato la fase di avvio. - --- 39f53479d3a045ac8e11786248231fbf -Subject: L'unità @UNIT@ termina la fase di avvio -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unità @UNIT@ ha terminato la fase di avvio. - -La fase di avvio è @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: L'unità @UNIT@ inizia la fase di spegnimento -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unità @UNIT@ ha iniziato la fase di spegnimento. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: L'unità @UNIT@ termina la fase di spegnimento -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unità @UNIT@ ha terminato la fase di spegnimento. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: L'unità @UNIT@ è fallita -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unità @UNIT@ è fallita. - -Il risultato è @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: L'unità @UNIT@ inizia a caricare la propria configurazione -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unità @UNIT@ è iniziata ricaricando la propria configurazione - --- 7b05ebc668384222baa8881179cfda54 -Subject: L'unità @UNIT@ termina il caricamento della propria configurazione -Defined-By: systemd -Support: %SUPPORT_URL% - -L'unità @UNIT@ è terminata ricaricando la propria configurazione - -Il risultato è @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Il processo @EXECUTABLE@ non può essere eseguito -Defined-By: systemd -Support: %SUPPORT_URL% - -Il processo @EXECUTABLE@ non può essere eseguito e termina. - -Il numero di errore restituito durante l'esecuzione del processo è @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Uno o più messaggi non possono essere inoltrati a syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Uno o più messaggi non possono essere inviati al servizio syslog -eseguito in parallelo a journald. Questo di solito capita perché, -l'implementazione di syslog non sta al passo con la -velocità dei messaggi accodati. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Il punto di montaggio non è vuoto -Defined-By: systemd -Support: %SUPPORT_URL% - -La directory @WHERE@ è specificata come punto di montaggio (secondo campo -in /etc/fstab o nel campo Where= del file unità di systemd) e non è vuoto. -Questo non interferisce con il montaggio, ma i file pre-esistenti in questa -directory diventano inaccessibili. Per visualizzare i file, si suggerisce -di montare manualmente il file system indicato in una posizione secondaria. - --- 24d8d4452573402496068381a6312df2 -Subject: Avviata macchina virtuale o container -Defined-By: systemd -Support: %SUPPORT_URL% - -La macchina virtuale @NAME@ con PID primario @LEADER@ è stata -avviata ed è pronta all'uso. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Terminata macchina virtuale o container -Defined-By: systemd -Support: %SUPPORT_URL% - -La macchina virtuale @NAME@ con PID primario @LEADER@ è stata spenta. diff --git a/src/grp-journal/catalog/systemd.ko.catalog.in b/src/grp-journal/catalog/systemd.ko.catalog.in deleted file mode 100644 index 8a053254ee..0000000000 --- a/src/grp-journal/catalog/systemd.ko.catalog.in +++ /dev/null @@ -1,264 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Korean translation - -# The catalog format is documented on -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ -# -# Translator : -# Seong-ho Cho , 2015. - --- f77379a8490b408bbe5f6940505a777b -Subject: 저널 시작 -Defined-By: systemd -Support: %SUPPORT_URL% - -시스템 저널 프로세스를 시작했고 기록목적으로 저널 파일을 열었으며, -프로세스 요청을 기다리고 있습니다. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: 저널 멈춤 -Defined-By: systemd -Support: %SUPPORT_URL% - -시스템 저널 프로세스를 껐고 현재 활성화 중인 저널 파일을 모두 -닫았습니다. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: 서비스의 메시지를 거절함 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -일정 시간동안 서비스에서 너무 많은 메시지를 기록했습니다. -서비스에서 오는 메시지를 거절했습니다. - -의문점이 있는 서비스로부터 오는 메시지만 거절했음을 참고하십시오 -다른 서비스의 메시지에는 영향을 주지 않습니다. - -메시지 거절 제어 제한 값은 /etc/systemd/journald.conf 의 -RateLimitIntervalSec= 변수와 RateLimitBurst= 변수로 설정합니다. -자세한 내용은 ournald.conf(5)를 살펴보십시오. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: 저널 메시지 놓침 -Defined-By: systemd -Support: %SUPPORT_URL% - -저널 시스템에서 커널 메시지를 충분히 빠르게 처리할 수 없어 커널 - 메시지를 잃었습니다. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: 프로세스 @COREDUMP_PID@번 코어 덤프(@COREDUMP_COMM@) 생성함 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -프로세스 @COREDUMP_PID@번 (@COREDUMP_COMM@)이 비정상적으로 끝나 -코어 덤프를 생성했습니다. - -보통 비정상 종료 관리 프로그램에서 프로그래밍 오류를 나타내며, -제작자에게 버그로 보고해야합니다. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: @USER_ID@ 사용자의 새 @SESSION_ID@ 세션 만듦 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -@USER_ID@ 사용자의 새 @SESSION_ID@ 세션을 만들었습니다. - -이 세션의 관리 프로세스는 @LEADER@ 입니다. - --- 3354939424b4456d9802ca8333ed424a -Subject: @SESSION_ID@ 세션 마침 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -@SESSION_ID@ 세션을 끝냈습니다. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: 새 @SEAT_ID@ 시트 사용할 수 있음 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -새 @SEAT_ID@ 시트를 설정했고 사용할 수 있습니다. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: @SEAT_ID@ 시트 제거함 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -@SEAT_ID@ 시트를 제거했으며 더이상 사용할 수 없습니다. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: 시간 바꿈 -Defined-By: systemd -Support: %SUPPORT_URL% - -시스템 시계를 1970년 1월 1일 이후로 @REALTIME@ 마이크로초 지난 값으로 -설정했습니다. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: @TIMEZONE@ 시간대로 시간대 바꿈 -Defined-By: systemd -Support: %SUPPORT_URL% - -시스템 시간대를 @TIMEZONE@ 시간대로 바꾸었습니다. - --- b07a249cd024414a82dd00cd181378ff -Subject: 시스템 시동 마침 -Defined-By: systemd -Support: %SUPPORT_URL% - -부팅 과정에 시작하려고 준비한 모든 시스템 서비스를 성공적으로 - 시작했습니다. 머신이 서비스처럼 대기중이라는 의미는 아니며 -지동을 완전히 마칠 때까지 사용중일 수도 있는 점 참고하십시오. - -커널 시동에 @KERNEL_USEC@ 마이크로초가 걸립니다. - -초기 램 디스크 시동에 @INITRD_USEC@ 마이크로초가 걸립니다. - -사용자 영역 시동에 @USERSPACE_USEC@ 마이크로초가 걸립니다. - --- 6bbd95ee977941e497c48be27c254128 -Subject: @SLEEP@ 대기 상태 진입 -Defined-By: systemd -Support: %SUPPORT_URL% - -@SLEEP@ 대기 상태로 진입했습니다. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: @SLEEP@ 대기 상태 마침 -Defined-By: systemd -Support: %SUPPORT_URL% - -@SLEEP@ 대기 상태를 마쳤습니다. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: 컴퓨터 끄기 시작 -Defined-By: systemd -Support: %SUPPORT_URL% - -컴퓨터 끄기 동작을 시작했습니다. 모든 시스템 동작을 멈추고 -모든 파일 시스템의 마운트를 해제합니다. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: @UNIT@ 유닛 시작 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 유닛을 시작했습니다. - --- 39f53479d3a045ac8e11786248231fbf -Subject: @UNIT@ 유닛 시동 마침 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 유닛 시동을 마쳤습니다. - -시동 결과는 @RESULT@ 입니다. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: @UNIT@ 유닛 끝내기 동작 시작 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 유닛 끝내기 동작을 시작했습니다. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: @UNIT@ 유닛 끝내기 동작 마침 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 유닛 끝내기 동작을 마쳤습니다. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: @UNIT@ 유닛 동작 실패 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 유닛 동작에 실패했습니다. - -결과는 @RESULT@ 입니다. - --- d34d037fff1847e6ae669a370e694725 -Subject: @UNIT@ 유닛 설정 다시 읽기 시작 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 유닛의 설정 다시 읽기를 시작했습니다 - --- 7b05ebc668384222baa8881179cfda54 -Subject: @UNIT@ 유닛 설정 다시 읽기 완료 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 유닛의 설정 다시 읽기 동작을 끝냈습니다. - -결과는 @RESULT@ 입니다. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: @EXECUTABLE@ 프로세스 시작할 수 없음 -Defined-By: systemd -Support: %SUPPORT_URL% - -@EXECUTABLE@ 프로세스를 시작할 수 없어 실행에 실패했습니다. - -이 프로세스에서 반환한 오류 번호는 @ERRNO@번 입니다. - --- 0027229ca0644181a76c4e92458afa2e -Subject: 하나 이상의 메시지를 syslog에 전달할 수 없음 -Defined-By: systemd -Support: %SUPPORT_URL% - -journald 서비스와 동시에 실행중인 syslog 서비스에 하나 이상의 메시지를 -전달할 수 없습니다. 보통 순차적으로 오는 메시지의 속도를 syslog 구현체가 -따라가지 못함을 의미합니다. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: 마운트 지점 비어있지 않음 -Defined-By: systemd -Support: %SUPPORT_URL% - -@WHERE@ 디렉터리를 마운트 지점으로 지정했으며 (/etc/fstab 파일의 - 두번째 필드 또는 systemd 유닛 파일의 Where= 필드) 비어있지 않습니다. -마운트 과정에 방해가 되진 않지만 이전에 이 디렉터리에 존재하는 파일에 - 접근할 수 없게 됩니다. 중복으로 마운트한 파일을 보려면, 근본 파일 -시스템의 다음 위치에 직접 마운트하십시오. - --- 24d8d4452573402496068381a6312df2 -Subject: 가상 머신 또는 컨테이너 시작 -Defined-By: systemd -Support: %SUPPORT_URL% - -@LEADER@ 프로세스 ID로 동작하는 @NAME@ 가상 머신을 시작했으며, -이제부터 사용할 수 있습니다. - --- 58432bd3bace477cb514b56381b8a758 -Subject: 가상 머신 또는 컨테이너 마침 -Defined-By: systemd -Support: %SUPPORT_URL% - -@LEADER@ 프로세스 ID로 동작하는 @NAME@ 가상 머신을 껐습니다. diff --git a/src/grp-journal/catalog/systemd.pl.catalog.in b/src/grp-journal/catalog/systemd.pl.catalog.in deleted file mode 100644 index 33c2122974..0000000000 --- a/src/grp-journal/catalog/systemd.pl.catalog.in +++ /dev/null @@ -1,315 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2014, 2015, 2016 Piotr Drąg -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Polish translation - -# The catalog format is documented on -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: Uruchomiono dziennik -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemowy proces dziennika został uruchomiony, otworzył pliki dziennika do -zapisu i jest gotowy do przetwarzania żądań. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Zatrzymano dziennik -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemowy proces dziennika został wyłączony i zamknął wszystkie obecnie -aktywne pliki dziennika. - --- ec387f577b844b8fa948f33cad9a75e6 -Subject: Miejsce na dysku używane przez dziennik -Defined-By: systemd -Support: %SUPPORT_URL% - -@JOURNAL_NAME@ (@JOURNAL_PATH@) obecnie używa @CURRENT_USE_PRETTY@. -Maksymalnie może używać @MAX_USE_PRETTY@. -Zostawianie co najmniej @DISK_KEEP_FREE_PRETTY@ wolnego (z obecnie dostępnego @DISK_AVAILABLE_PRETTY@ miejsca na dysku). -Wymuszone ograniczenie użycia wynosi więc @LIMIT_PRETTY@, z czego @AVAILABLE_PRETTY@ jest nadal dostępne. - -Ograniczenia kontrolujące ilość miejsca na dysku używanego przez dziennik -można konfigurować za pomocą ustawień SystemMaxUse=, SystemKeepFree=, -SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= -w pliku /etc/systemd/journald.conf. Strona journald.conf(5) zawiera więcej -informacji. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Ograniczono komunikaty z usługi -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Usługa zapisała za dużo komunikatów w określonym czasie. Komunikaty z usługi -zostały pominięte. - -Proszę zauważyć, że tylko komunikaty z danej usługi zostały pominięte. Nie ma -to wpływu na komunikaty innych usług. - -Ograniczenia kontrolujące pomijanie komunikatów mogą być konfigurowane -za pomocą opcji RateLimitIntervalSec= i RateLimitBurst= w pliku -/etc/systemd/journald.conf. Strona journald.conf(5) zawiera więcej informacji. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Utracono komunikaty dziennika -Defined-By: systemd -Support: %SUPPORT_URL% - -Komunikaty jądra zostały utracone, ponieważ system dziennika nie mógł -przetworzyć ich odpowiednio szybko. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Proces @COREDUMP_PID@ (@COREDUMP_COMM@) zrzucił plik core -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Proces @COREDUMP_PID@ (@COREDUMP_COMM@) uległ awarii i zrzucił plik core. - -Zwykle wskazuje to na błąd programistyczny w danym programie i powinno zostać -zgłoszone jego producentowi jako błąd. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Utworzono nową sesję @SESSION_ID@ dla użytkownika @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Nowa sesja o identyfikatorze @SESSION_ID@ została utworzona dla użytkownika -@USER_ID@. - -Proces prowadzący sesji: @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Zakończono sesję @SESSION_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Sesja o identyfikatorze @SESSION_ID@ została zakończona. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Dostępne jest nowe stanowisko @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Nowe stanowisko @SEAT_ID@ zostało skonfigurowane i jest teraz dostępne. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Usunięto stanowisko @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Stanowisko @SEAT_ID@ zostało usunięte i nie jest już dostępne. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Zmiana czasu -Defined-By: systemd -Support: %SUPPORT_URL% - -Zegar systemowy został zmieniony na @REALTIME@ μs po 1 stycznia 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Zmiana strefy czasowej na @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemowa strefa czasowa została zmieniona na @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Ukończono uruchamianie systemu -Defined-By: systemd -Support: %SUPPORT_URL% - -Wszystkie usługi systemowe obowiązkowo zakolejkowane do włączenia podczas -uruchamiania systemu zostały pomyślnie uruchomione. Proszę zauważyć, że nie -oznacza to, że komputer jest bezczynny, jako że usługi mogą wciąż kończyć -proces uruchamiania. - -Uruchamianie jądra zajęło @KERNEL_USEC@ μs. - -Uruchamianie początkowego dysku RAM zajęło @INITRD_USEC@ μs. - -Uruchamianie przestrzeni użytkownika zajęło @USERSPACE_USEC@ μs. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Przejście do stanu uśpienia @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -System przeszedł do stanu uśpienia @SLEEP@. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Wyjście ze stanu uśpienia @SLEEP@ -Defined-By: systemd -Support: %SUPPORT_URL% - -System wyszedł ze stanu uśpienia @SLEEP@. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Zainicjowano wyłączenie systemu -Defined-By: systemd -Support: %SUPPORT_URL% - -Zainicjowano wyłączenie systemd. Wyłączenie zostało rozpoczęte i wszystkie -usługi systemowe zostały zakończone, a wszystkie systemy plików odmontowane. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Rozpoczęto uruchamianie jednostki @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Jednostka @UNIT@ rozpoczęła uruchamianie. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Ukończono uruchamianie jednostki @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Jednostka @UNIT@ ukończyła uruchamianie. - -Wynik uruchamiania: @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Rozpoczęto wyłączanie jednostki @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Jednostka @UNIT@ rozpoczęła wyłączanie. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Ukończono wyłączanie jednostki @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Jednostka @UNIT@ ukończyła wyłączanie. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Jednostka @UNIT@ się nie powiodła -Defined-By: systemd -Support: %SUPPORT_URL% - -Jednostka @UNIT@ się nie powiodła. - -Wynik: @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: Rozpoczęto ponowne wczytywanie konfiguracji jednostki @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Jednostka @UNIT@ rozpoczęła ponowne wczytywanie swojej konfiguracji. - --- 7b05ebc668384222baa8881179cfda54 -Subject: Ukończono ponowne wczytywanie konfiguracji jednostki @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Jednostka @UNIT@ ukończyła ponowne wczytywanie swojej konfiguracji. - -Wynik: @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Nie można wykonać procesu @EXECUTABLE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Proces @EXECUTABLE@ nie mógł zostać wykonany i się nie powiódł. - -Numer błędu zwrócony przez ten proces: @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Nie można przekazać jednego lub więcej komunikatów do syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Jeden lub więcej komunikatów nie może zostać przekazanych do usługi syslog -uruchomionej obok journald. Zwykle oznacza to, że implementacja syslog nie -jest w stanie nadążyć za prędkością kolejki komunikatów. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Punkt montowania nie jest pusty -Defined-By: systemd -Support: %SUPPORT_URL% - -Katalog @WHERE@ został podany jako punkt montowania (drugie pole w pliku -/etc/fstab lub pole Where= w pliku jednostki systemd) i nie jest pusty. Nie -wpływa to na montowanie, ale wcześniej istniejące pliki w tym katalogu stają -się niedostępne. Aby zobaczyć te pliki, proszę ręcznie zamontować system -plików w innym położeniu. - --- 24d8d4452573402496068381a6312df2 -Subject: Uruchomiono maszynę wirtualną lub kontener -Defined-By: systemd -Support: %SUPPORT_URL% - -Maszyna wirtualna @NAME@ (PID prowadzący @LEADER@) została uruchomiona i jest -gotowa do użycia. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Zakończono maszynę wirtualną lub kontener -Defined-By: systemd -Support: %SUPPORT_URL% - -Maszyna wirtualna @NAME@ (PID prowadzący @LEADER@) została wyłączona. - --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: Wyłączono tryb DNSSEC, ponieważ serwer go nie obsługuje -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -Usługa resolver (systemd-resolved.service) wykryła, że skonfigurowany serwer -DNS nie obsługuje DNSSEC, w wyniku czego walidacja DNSSEC została wyłączona. - -To zdarzenie będzie miało miejsce, jeśli skonfigurowano DNSSEC=allow-downgrade -w pliku resolved.conf, a skonfigurowany serwer DNS jest niezgodny z DNSSEC. -Proszę zauważyć, że używanie tego trybu umożliwia ataki wyłączające DNSSEC, -ponieważ atakujący będzie mógł wyłączyć walidację DNSSEC na komputerze przez -umieszczenie odpowiednich odpowiedzi DNS w kanale komunikacji. - -To zdarzenie może wskazywać, że serwer DNS jest faktycznie niezgodny z DNSSEC, -albo że atakującemu udało się upozorować atak tego typu. - --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: Walidacja DNSSEC się nie powiodła -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Zapytanie DNS lub ustawiony wpis zasobu nie przeszedł walidacji DNSSEC. -Zwykle wskazuje to, że ktoś manipulował używanym kanałem komunikacji. - --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: Unieważniono kotwicę zaufania DNSSEC -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Kotwica zaufania DNSSEC została unieważniona. Należy skonfigurować nową, albo -system operacyjny musi zostać zaktualizowany, aby dostarczyć zaktualizowaną -kotwicę zaufania DNSSEC. diff --git a/src/grp-journal/catalog/systemd.pt_BR.catalog.in b/src/grp-journal/catalog/systemd.pt_BR.catalog.in deleted file mode 100644 index e461c2b2ba..0000000000 --- a/src/grp-journal/catalog/systemd.pt_BR.catalog.in +++ /dev/null @@ -1,264 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2015 Rafael Ferreira (translation) -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Catálogo de mensagens para as mensagens do próprio systemd - -# O formato do catálogo está documentado em -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# Para uma explicação do porquê de fazermos tudo isso, veja -# https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: O jornal foi inciado -Defined-By: systemd -Support: %SUPPORT_URL% - -O processo jornal do sistema foi iniciado, arquivos foram abertos e está -pronto para processar requisições. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: O jornal foi interrompido -Defined-By: systemd -Support: %SUPPORT_URL% - -O processo do jornal do sistema foi desligado e todos os arquivos de jornal -do sistema foram fechados. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Mensagens de um serviço foram suprimidas -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Um serviço registrou no log um número excessivo de mensagens dentro de um -período de tempo. Mensagens do serviço foram descartadas. - -Note que apenas mensagens de um serviço em questão foram descartadas; outras -mensagens dos serviços não foram afetadas. - -Os controles de limites de quando as mensagens são descartadas pode ser -configurado com RateLimitIntervalSec= e RateLimitBurst= no -/etc/systemd/journald.conf. Veja journald.conf(5) para detalhes. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Mensagens do jornal foram perdidas -Defined-By: systemd -Support: %SUPPORT_URL% - -Mensagens do kernel foram perdidas pois o sistema do jornal não pôde -processá-las em velocidade suficiente para a demanda. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Processo @COREDUMP_PID@ (@COREDUMP_COMM@) despejou núcleo -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Processo @COREDUMP_PID@ (@COREDUMP_COMM@) travou e despejou o núcleo. - -Isso normalmente indica um erro de programação no programa que travou e -deveria ser relatado para seu fabricante como um erro. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: A nova sessão @SESSION_ID@ foi criada para usuário o @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Uma nova sessão com o ID @SESSION_ID@ foi criada para o usuário @USER_ID@. - -O processo originador da sessão é @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Sessão @SESSION_ID@ foi terminada -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Um sessão com o ID @SESSION_ID@ foi terminada. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Um novo seat @SEAT_ID@ está disponível -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Um novo seat @SEAT_ID@ foi configurado e está disponível. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Seat @SEAT_ID@ foi removido agora -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Um seat @SEAT_ID@ foi removido e não está mais disponível. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Time change -Defined-By: systemd -Support: %SUPPORT_URL% - -O relógio do sistema foi alterado para @REALTIME@ microssegundos após 1º de -janeiro de 1970. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Fuso horário alterado para @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -O fuso horário do sistema foi alterado para @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Inicialização do sistema foi concluída -Defined-By: systemd -Support: %SUPPORT_URL% - -Todos os serviços do sistema necessários que estão enfileirados para -executar na inicialização do sistema, foram iniciados com sucesso. Note -que isso não significa que a máquina está ociosa, pois os serviços podem -ainda estar ocupados com a inicialização completa. - -Inicialização do kernel precisou @KERNEL_USEC@ microssegundos. - -Disco de RAM inicial precisou de @INITRD_USEC@ microssegundos. - -Inicialização do espaço do usuário precisou de @USERSPACE_USEC@ microssegundos. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Estado de suspensão do sistema @SLEEP@ iniciado -Defined-By: systemd -Support: %SUPPORT_URL% - -O sistema entrou agora no estado de suspensão @SLEEP@. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Estado de suspensão do sistema @SLEEP@ finalizado -Defined-By: systemd -Support: %SUPPORT_URL% - -O sistema saiu agora do estado de suspensão @SLEEP@. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Desligamento do sistema iniciado -Defined-By: systemd -Support: %SUPPORT_URL% - -Desligamento do sistema foi inicializado. O desligamento se iniciou e todos -os serviços do sistema foram terminados e todos os sistemas desmontados. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Unidade @UNIT@ sendo iniciado -Defined-By: systemd -Support: %SUPPORT_URL% - -A unidade @UNIT@ está sendo iniciada. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Unidade @UNIT@ concluiu a inicialização -Defined-By: systemd -Support: %SUPPORT_URL% - -A unidade @UNIT@ concluiu a inicialização. - -The start-up result is @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Unidade @UNIT@ sendo desligado -Defined-By: systemd -Support: %SUPPORT_URL% - -A unidade @UNIT@ está sendo desligada. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: A unidade @UNIT@ concluiu o desligamento -Defined-By: systemd -Support: %SUPPORT_URL% - -A unidade @UNIT@ concluiu o desligamento. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: A unidade @UNIT@ falhou -Defined-By: systemd -Support: %SUPPORT_URL% - -A unidade @UNIT@ falhou. - -O resultado é @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: Unidade @UNIT@ iniciou recarregamento de sua configuração -Defined-By: systemd -Support: %SUPPORT_URL% - -A unidade @UNIT@ iniciou o recarregamento de sua configuração. - --- 7b05ebc668384222baa8881179cfda54 -Subject: Unidade @UNIT@ concluiu recarregamento de sua configuração -Defined-By: systemd -Support: %SUPPORT_URL% - -A unidade @UNIT@ concluiu o recarregamento de sua configuração. - -O resultado é @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Processo @EXECUTABLE@ não pôde ser executado -Defined-By: systemd -Support: %SUPPORT_URL% - -O processo @EXECUTABLE@ não pôde ser executado e falhou. - -O número de erro retornado por este processo é @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Uma ou mais mensagens não puderam ser encaminhadas para o syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Uma ou mais mensagens não puderam ser encaminhadas para o serviço do syslog -em execução paralela ao journald. Isso normalmente indica que a implementação -do syslog não foi capaz de se manter com a velocidade das mensagens -enfileiradas. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Ponto de montagem não está vazio -Defined-By: systemd -Support: %SUPPORT_URL% - -O diretório @WHERE@ está especificado como ponto de montagem (o segundo campo -no /etc/fstab ou campo Where= no arquivo de unidade do systemd) e não está -vazio. Isso não interfere com a montagem, mas os arquivos pré-existentes -neste diretório se tornaram inacessívels. Para ver aqueles arquivos, sobre os -quais foi realizada a montagem, por favor monte manualmente o sistema de -arquivos subjacente para uma localização secundária. - --- 24d8d4452573402496068381a6312df2 -Subject: Uma máquina virtual ou contêiner foi iniciado -Defined-By: systemd -Support: %SUPPORT_URL% - -A máquina virtual @NAME@ com seu PID @LEADER@ incial foi iniciada e está -pronto para ser usad. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Uma máquina virtual ou contêiner foi terminado -Defined-By: systemd -Support: %SUPPORT_URL% - -A máquina virtual @NAME@ com seu PID @LEADER@ incial foi desligada. diff --git a/src/grp-journal/catalog/systemd.ru.catalog.in b/src/grp-journal/catalog/systemd.ru.catalog.in deleted file mode 100644 index df55478592..0000000000 --- a/src/grp-journal/catalog/systemd.ru.catalog.in +++ /dev/null @@ -1,354 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2013-2016 Sergey Ptashnick -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Russian translation - -# Формат каталога сообщений описан по ссылке -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# Перед каждым элементом в комментарии указан Subject исходного -# сообщения (на английском). - -# Subject: The Journal has been started --- f77379a8490b408bbe5f6940505a777b -Subject: Запущена служба журналирования -Defined-By: systemd -Support: %SUPPORT_URL% - -Процесс, отвечающий за журналирование системных событий, успешно запустился, -открыл для записи файлы журнала, и готов обрабатывать запросы. - -# Subject: The Journal has been stopped --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Служба журналирования остановлена -Defined-By: systemd -Support: %SUPPORT_URL% - -Процесс, отвечающий за журналирование системных событий, завершил работу и -закрыл все свои файлы. - -# Subject: Disk space used by the journal --- ec387f577b844b8fa948f33cad9a75e6 -Subject: Место на диске, занятое журналом -Defined-By: systemd -Support: %SUPPORT_URL% - -@JOURNAL_NAME@ (@JOURNAL_PATH@) сейчас занимает @CURRENT_USE_PRETTY@. -Максимальный разрешенный размер составляет @MAX_USE_PRETTY@. -Оставляем свободными как минимум @DISK_KEEP_FREE_PRETTY@ (сейчас на диске -свободно @DISK_AVAILABLE_PRETTY@). -Таким образом, предел использования составляет @LIMIT_PRETTY@, из которых -@AVAILABLE_PRETTY@ пока свободно. - -Ограничения на размер журнала настраиваются при помощи параметров -SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, -RuntimeKeepFree=, RuntimeMaxFileSize= в файле /etc/systemd/journald.conf. -Более подробные сведения вы можете получить на справочной странице -journald.conf(5). - -# Subject: Messages from a service have been suppressed --- a596d6fe7bfa4994828e72309e95d61e -Subject: Часть сообщений от службы пропущена -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Служба отправила слишком много сообщений за короткий промежуток времени. -Часть сообщений была пропущена. - -Обратите внимание, что были пропущены сообщения только от этой службы, -сообщения других служб не затронуты. - -Предел, после которого служба журнала начинает игнорировать сообщения, -настраивается параметрами RateLimitIntervalSec= и RateLimitBurst= в файле -/etc/systemd/journald.conf. Подробности смотрите на странице руководства -journald.conf(5). - -# Subject: Journal messages have been missed --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Часть сообщений ядра пропущена -Defined-By: systemd -Support: %SUPPORT_URL% - -Часть сообщений, поступивших от ядра, была потеряна, так как служба -журналирования не успела их обработать. - -# Subject: Process @COREDUMP_PID@ (@COREDUMP_COMM@) dumped core --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Процесс @COREDUMP_PID@ (@COREDUMP_COMM@) сбросил дамп памяти -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Процесс @COREDUMP_PID@ (@COREDUMP_COMM@) завершился из-за критической ошибки. -Записан дамп памяти. - -Вероятно, это произошло из-за ошибки, допущенной в коде программы. -Рекомендуется сообщить её разработчикам о возникшей проблеме. - -# Subject: A new session @SESSION_ID@ has been created for user @USER_ID@ --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Для пользователя @USER_ID@ создан новый сеанс @SESSION_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Для пользователя @USER_ID@ создан новый сеанс с идентификатором @SESSION_ID@. - -Главный процесс нового сеанса имеет индентификатор @LEADER@. - -# Subject: A session @SESSION_ID@ has been terminated --- 3354939424b4456d9802ca8333ed424a -Subject: Сеанс @SESSION_ID@ завершен -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Сеанс с идентификатором @SESSION_ID@ завершился. - -# Subject: A new seat @SEAT_ID@ is now available --- fcbefc5da23d428093f97c82a9290f7b -Subject: Добавлено новое рабочее место @SEAT_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Новое рабочее место (seat) @SEAT_ID@ полностью настроено и готово к -использованию. - -# Subject: A seat @SEAT_ID@ has now been removed --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Рабочее место @SEAT_ID@ отключено -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Рабочее место (seat) @SEAT_ID@ было отключено. - -# Subject: Time change --- c7a787079b354eaaa9e77b371893cd27 -Subject: Переведены системные часы -Defined-By: systemd -Support: %SUPPORT_URL% - -Системные часы были переведены. Сейчас они показывают @REALTIME@ микросекунд -с момента 00:00:00 1 января 1970 года. - -# Subject: Time zone change to @TIMEZONE@ --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Часовой пояс изменен на @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Системный часовой пояс был изменен. Новое значение: @TIMEZONE@. - -# Subject: System start-up is now complete --- b07a249cd024414a82dd00cd181378ff -Subject: Запуск системы завершен -Defined-By: systemd -Support: %SUPPORT_URL% - -Все системные службы, запуск которых предписан настройками, были запущены. -Впрочем, это ещё не означает, что система в данный момент ничем не занята, -так как некоторые службы могут продолжать инициализацию даже после того, как -отчитались о своем запуске. - -Запуск ядра занял @KERNEL_USEC@ микросекунд. - -Процессы начального RAM-диска (initrd) отработали за @INITRD_USEC@ микросекунд. - -Запуск системных служб занял @USERSPACE_USEC@ микросекунд. - -# Subject: System sleep state @SLEEP@ entered --- 6bbd95ee977941e497c48be27c254128 -Subject: Система перешла в состояние сна (@SLEEP@) -Defined-By: systemd -Support: %SUPPORT_URL% - -Система была переведена в состояние сна (@SLEEP@). - -# Subject: System sleep state @SLEEP@ left --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Система вышла из состояния сна (@SLEEP@) -Defined-By: systemd -Support: %SUPPORT_URL% - -Система была выведена из состояния сна (@SLEEP@). - -# Subject: System shutdown initiated --- 98268866d1d54a499c4e98921d93bc40 -Subject: Подготовка системы к выключению -Defined-By: systemd -Support: %SUPPORT_URL% - -Начат процесс подготовки к выключению компьютера. Останавливаются все системные -службы, отмонтируются все файловые системы. - -# Subject: Unit @UNIT@ has begun with start-up --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Начинается запуск юнита @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Начат процесс запуска юнита @UNIT@. - -# Subject: Unit @UNIT@ has finished start-up --- 39f53479d3a045ac8e11786248231fbf -Subject: Запуск юнита @UNIT@ завершен -Defined-By: systemd -Support: %SUPPORT_URL% - -Процесс запуска юнита @UNIT@ был завершен. - -Результат: @RESULT@. - -# Subject: Unit @UNIT@ has begun shutting down --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Начинается остановка юнита @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Начат процесс остановки юнита @UNIT@. - -# Subject: Unit @UNIT@ has finished shutting down --- 9d1aaa27d60140bd96365438aad20286 -Subject: Завершена остановка юнита @UNIT@. -Defined-By: systemd -Support: %SUPPORT_URL% - -Процесс остановки юнита @UNIT@ был завершен. - -# Subject: Unit @UNIT@ has failed --- be02cf6855d2428ba40df7e9d022f03d -Subject: Ошибка юнита @UNIT@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Произошел сбой юнита @UNIT@. - -Результат: @RESULT@. - -# Subject: Unit @UNIT@ has begun with reloading its configuration --- d34d037fff1847e6ae669a370e694725 -Subject: Юнит @UNIT@ начал перечитывать свои настройки -Defined-By: systemd -Support: %SUPPORT_URL% - -Юнит @UNIT@ начал процесс перечитывания своей конфигурации. - -# Subject: Unit @UNIT@ has finished reloading its configuration --- 7b05ebc668384222baa8881179cfda54 -Subject: Юнит @UNIT@ завершил перечитывание своих настроек -Defined-By: systemd -Support: %SUPPORT_URL% - -Юнит @UNIT@ завершил процесс перечитывания своей конфигурации. - -Результат: @RESULT@. - -# Subject: Process @EXECUTABLE@ could not be executed --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Не удалось запустить процесс @EXECUTABLE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Сбой: не удалось запустить процесс @EXECUTABLE@. - -Код ошибки: @ERRNO@. - -# Subject: One or more messages could not be forwarded to syslog --- 0027229ca0644181a76c4e92458afa2e -Subject: Часть сообщений не удалось передать процессу syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -Не удалось передать некоторые сообщения демону системного лога (syslog), -дублирующему работу службы системного журнала. Скорее всего, причина в том, что -используемая реализация syslog не успевает обрабатывать сообщения с достаточной -скоростью. - -# Subject: Mount point is not empty --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Каталог, являющийся точкой монтирования, не пуст -Defined-By: systemd -Support: %SUPPORT_URL% - -Каталог @WHERE@, который был указан в качестве точки монтирования (во втором -столбце файла /etc/fstab, либо в параметре Where= файла конфигурации юнита), -не является пустым. Это никак не мешает монтированию, однако ранее находившиеся -в нем файлы будут недоступны. Чтобы получить к ним доступ, вы можете вручную -перемонтировать эту файловую систему в другую точку. - -# Subject: A virtual machine or container has been started --- 24d8d4452573402496068381a6312df2 -Subject: Запущена виртуальная машина/контейнер -Defined-By: systemd -Support: %SUPPORT_URL% - -Виртуальная машина @NAME@ (идентификатор главного процесса: @LEADER@) запущена и -готова к работе. - -# Subject: A virtual machine or container has been terminated --- 58432bd3bace477cb514b56381b8a758 -Subject: Остановлена виртуальная машина/контейнер -Defined-By: systemd -Support: %SUPPORT_URL% - -Виртуальная машина @NAME@ (идентификатор главного процесса: @LEADER@) выключена. - -# Subject: DNSSEC mode has been turned off, as server doesn't support it --- 36db2dfa5a9045e1bd4af5f93e1cf057 -Subject: Механизм DNSSEC был отключен, так как DNS-сервер его не поддерживает -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) resolved.conf(5) - -Служба разрешения имен хостов (systemd-resolved.service) определила, что -указанный в настойках DNS-сервер не поддерживает технологию DNSSEC, и -автоматически отключила DNSSEC-проверки. - -Данное событие возникает, если в файле resolved.conf указан параметр -DNSSEC=allow-downgrade, и вышестоящий DNS-сервер не поддерживает DNSSEC. -Обратите внимание, что режим allow-downgrade допускает возможность атаки -"DNSSEC downgrade", в ходе которой атакующий хакер блокирует проверки DNSSEC -путем отправки ложных сообщений от имени DNS-сервера. - -Возникновение данного события может свидетельствовать как о том, что ваш -DNS-сервер не поддерживает DNSSEC, так и о том, что некий хакер успешно провел -против вас атаку, направленную на блокировку DNSSEC-проверок. - -# Subject: DNSSEC validation failed --- 1675d7f172174098b1108bf8c7dc8f5d -Subject: Проверка DNSSEC провалена -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -DNS-запрос или отдельная ресурсная запись не прошла проверку DNSSEC. -Как правило, это свидетельствует о постороннем вмешательстве в канал связи. - -# Subject: A DNSSEC trust anchor has been revoked --- 4d4408cfd0d144859184d1e65d7c8a65 -Subject: Открытый ключ DNSSEC был отозван -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:systemd-resolved.service(8) - -Открытый ключ (trust ahcnor) DNSSEC был отозван. Необходимо настроить новый -открытый ключ, либо обновить систему, чтобы получить обновленный открытый ключ. diff --git a/src/grp-journal/catalog/systemd.sr.catalog.in b/src/grp-journal/catalog/systemd.sr.catalog.in deleted file mode 100644 index 06a0ff648c..0000000000 --- a/src/grp-journal/catalog/systemd.sr.catalog.in +++ /dev/null @@ -1,262 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Serbian translation - -# Формат каталога је документован на -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# Да бисте видели зашто ово радимо, погледајте https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: Журнал је покренут -Defined-By: systemd -Support: %SUPPORT_URL% - -Системски журналски процес се покренуо, отворио журналске -датотеке за упис и спреман је за обраду захтева. - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: Журнал је заустављен -Defined-By: systemd -Support: %SUPPORT_URL% - -Системски журналски процес се зауставио и затворио све тренутно -отворене журналске датотеке. - --- a596d6fe7bfa4994828e72309e95d61e -Subject: Поруке од услуге су утишане -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -Услуга је уписала сувише порука за једно време. Поруке -од услуге су одбачене. - -Знајте да су само поруке од ове услуге одбачене, друге -услуге нису захваћене овим. - -Ограничења која подешавају начин на који се поруке одбацују се могу подесити -помоћу „RateLimitIntervalSec=“ и „RateLimitBurst=“ параметара унутар датотеке -/etc/systemd/journald.conf. Погледајте journald.conf(5) за појединости. - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: Журналске поруке су изгубљене -Defined-By: systemd -Support: %SUPPORT_URL% - -Поруке кернела су изгубљене јер журналски систем није могао да их -обради довољно брзо. - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: Процес @COREDUMP_PID@ (@COREDUMP_COMM@) је избацио своје језгро -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -Процес @COREDUMP_PID@ (@COREDUMP_COMM@) је пао и избацио своје језгро. - -Ово обично значи да постоји грешка у програму који је пао и ова -грешка треба да се пријави продавцу. - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: Нова сесија @SESSION_ID@ је направљена за корисника @USER_ID@ -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Нова сесија са ИБ-ом @SESSION_ID@ је направљена за корисника @USER_ID@. - -Водећи процес сесије је @LEADER@. - --- 3354939424b4456d9802ca8333ed424a -Subject: Сесија @SESSION_ID@ је окончана -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Сесија са ИБ-ом @SESSION_ID@ је окончана. - --- fcbefc5da23d428093f97c82a9290f7b -Subject: Ново седиште @SEAT_ID@ је сада доступно -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Ново седиште @SEAT_ID@ је исподешавано и сада је доступно. - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: Седиште @SEAT_ID@ је сада уклоњено -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -Седиште @SEAT_ID@ је сада уклоњено и више није доступно. - --- c7a787079b354eaaa9e77b371893cd27 -Subject: Време је промењено -Defined-By: systemd -Support: %SUPPORT_URL% - -Системски сат је сада подешен на @REALTIME@ микросекунде након 1. јануара 1970. године. - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: Временска зона је промењена на @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -Временска зона је промењена на @TIMEZONE@. - --- b07a249cd024414a82dd00cd181378ff -Subject: Подизање система је сада готово -Defined-By: systemd -Support: %SUPPORT_URL% - -Све системске услуге које су заказане за подизање су успешно покренуте. -Знајте да ово не значи да је машина сада беспослена јер услуге могу -и даље бити заузете завршавањем покретања система. - -Подизање кернела је трајало @KERNEL_USEC@ микросекунде. - -Подизање почетног РАМ диска је трајало @INITRD_USEC@ микросекунде. - -Подизање корисничких програма је трајало @USERSPACE_USEC@ микросекунде. - --- 6bbd95ee977941e497c48be27c254128 -Subject: Системско стање спавања @SLEEP@ започето -Defined-By: systemd -Support: %SUPPORT_URL% - -Систем је сада ушао у @SLEEP@ стање спавања. - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: Системско стање спавања @SLEEP@ напуштено -Defined-By: systemd -Support: %SUPPORT_URL% - -Систем је изашао из @SLEEP@ стања спавања. - --- 98268866d1d54a499c4e98921d93bc40 -Subject: Гашење система започето -Defined-By: systemd -Support: %SUPPORT_URL% - -Систем-де гашење је започето. Гашење је сада почело и све -системске услуге су окончане и сви системи датотека откачени. - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: Јединица @UNIT@ је почела са покретањем -Defined-By: systemd -Support: %SUPPORT_URL% - -Јединица @UNIT@ је почела са покретањем. - --- 39f53479d3a045ac8e11786248231fbf -Subject: Јединица @UNIT@ је завршила са покретањем -Defined-By: systemd -Support: %SUPPORT_URL% - -Јединица @UNIT@ је завршила са покретањем. - -Исход покретања је @RESULT@. - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: Јединица @UNIT@ је почела са гашењем -Defined-By: systemd -Support: %SUPPORT_URL% - -Јединица @UNIT@ је почела са гашењем. - --- 9d1aaa27d60140bd96365438aad20286 -Subject: Јединица @UNIT@ је завршила са гашењем -Defined-By: systemd -Support: %SUPPORT_URL% - -Јединица @UNIT@ је завршила са гашењем. - --- be02cf6855d2428ba40df7e9d022f03d -Subject: Јединица @UNIT@ је пукла -Defined-By: systemd -Support: %SUPPORT_URL% - -Јединица @UNIT@ је пукла. - -Исход је @RESULT@. - --- d34d037fff1847e6ae669a370e694725 -Subject: Јединица @UNIT@ је почела са поновним учитавањем свог подешавања -Defined-By: systemd -Support: %SUPPORT_URL% - -Јединица @UNIT@ је почела са поновним учитавањем свог подешавања - --- 7b05ebc668384222baa8881179cfda54 -Subject: Јединица @UNIT@ је завршила са поновним учитавањем свог подешавања -Defined-By: systemd -Support: %SUPPORT_URL% - -Јединица @UNIT@ је завршила са поновним учитавањем свог подешавања - -Исход је @RESULT@. - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: Процес @EXECUTABLE@ није могао бити извршен -Defined-By: systemd -Support: %SUPPORT_URL% - -Процес @EXECUTABLE@ није могао бити извршен и пукао је. - -Овај процес је вратио број грешке @ERRNO@. - --- 0027229ca0644181a76c4e92458afa2e -Subject: Једна или више порука није могло бити прослеђено системском записнику -Defined-By: systemd -Support: %SUPPORT_URL% - -Једна или више порука није могло бити прослеђено „syslog“ услузи -која ради упоредно са журнал-деом. Ово обично значи да спроведена -„syslog“ услуга није могла да издржи брзину свих надолазећих -порука у реду. - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: Тачка качења није празна -Defined-By: systemd -Support: %SUPPORT_URL% - -Директоријум @WHERE@ је наведен као тачка качења (друго поље у -/etc/fstab датотеци или у „Where=“ пољу систем-де јединичне датотеке) -и он није празан. Ово не утиче на качење али ће већ постојеће датотеке у -овом директоријуму постати недоступне. Да бисте видели ове недоступне -датотеке, ручно прикачите основни систем датотека у другу -путању. - --- 24d8d4452573402496068381a6312df2 -Subject: Виртуелна машина или контејнер је покренут(а) -Defined-By: systemd -Support: %SUPPORT_URL% - -Виртуелна машина @NAME@ са водећим ПИБ-ом @LEADER@ је -покренута и сада је спремна за коришћење. - --- 58432bd3bace477cb514b56381b8a758 -Subject: Виртуелна машина или контејнер је окончан(а) -Defined-By: systemd -Support: %SUPPORT_URL% - -Виртуелна машина @NAME@ са водећим ПИБ-ом @LEADER@ је -угашена. diff --git a/src/grp-journal/catalog/systemd.zh_CN.catalog.in b/src/grp-journal/catalog/systemd.zh_CN.catalog.in deleted file mode 100644 index ba7c697c16..0000000000 --- a/src/grp-journal/catalog/systemd.zh_CN.catalog.in +++ /dev/null @@ -1,253 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2015 Boyuan Yang -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Simplified Chinese translation - -# 本 catalog 文档格式被记载在 -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# 如需了解我们为什么做这些工作,请见 https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: 日志已开始 -Defined-By: systemd -Support: %SUPPORT_URL% - -系统日志进程已启动,已打开供写入的日志文件并准备好处理请求。 - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: 日志已停止 -Defined-By: systemd -Support: %SUPPORT_URL% - -系统日志进程已终止,并已关闭所有当前活动的日志文件。 - --- a596d6fe7bfa4994828e72309e95d61e -Subject: 由某个服务而来的消息已被抑制 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -某个服务在一个时间周期内记录了太多消息。 -从该服务而来的消息已被丢弃。 - -请注意只有由有问题的服务传来的消息被丢弃, -其它服务的消息不受影响。 - -可以在 /etc/systemd/journald.conf 中设定 RateLimitIntervalSec= -以及 RateLimitBurst = 的值以控制丢弃信息的限制。 -请参见 journald.conf(5) 以了解详情。 - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: 日志消息已遗失 -Defined-By: systemd -Support: %SUPPORT_URL% - -因日志系统对内核消息的处理速度不够快, -部分信息已经遗失。 - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: 进程 @COREDUMP_PID@ (@COREDUMP_COMM@) 核心已转储 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -进程 @COREDUMP_PID@ (@COREDUMP_COMM@) 已崩溃并进行核心转储。 - -这通常意味着崩溃程序中存在编程错误,并应当将此错误向其开发者报告。 - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: 一个新会话 @SESSION_ID@ 已为用户 @USER_ID@ 建立 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -一个 ID 为 @SESSION_ID@ 的新会话已为用户 @USER_ID@ 建立。 - -该会话的首进程为 @LEADER@。 - --- 3354939424b4456d9802ca8333ed424a -Subject: 会话 @SESSION_ID@ 已终止 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -一个 ID 为 @SESSION_ID@ 的会话已终止。 - --- fcbefc5da23d428093f97c82a9290f7b -Subject: 一个新的座位 @SEAT_ID@ 可用 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -一个新的座位 @SEAT_ID@ 已被配置并已可用。 - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: 座位 @SEAT_ID@ 已被移除 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -座位 @SEAT_ID@ 已被移除并不再可用。 - --- c7a787079b354eaaa9e77b371893cd27 -Subject: 时间已变更 -Defined-By: systemd -Support: %SUPPORT_URL% - -系统时钟已变更为1970年1月1日后 @REALTIME@ 微秒。 - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: 时区变更为 @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -系统时区已变更为 @TIMEZONE@。 - --- b07a249cd024414a82dd00cd181378ff -Subject: 系统启动已完成 -Defined-By: systemd -Support: %SUPPORT_URL% - -所有系统启动时需要的系统服务均已成功启动。 -请注意这并不代表现在机器已经空闲,因为某些服务可能仍处于完成启动的过程中。 - -内核启动使用了 @KERNEL_USEC@ 毫秒。 - -初始内存盘启动使用了 @INITRD_USEC@ 毫秒。 - -用户空间启动使用了 @USERSPACE_USEC@ 毫秒。 - --- 6bbd95ee977941e497c48be27c254128 -Subject: 系统已进入 @SLEEP@ 睡眠状态 -Defined-By: systemd -Support: http://lists.freedesktop.org/mailman/listinfo/systemd-deve - -系统现已进入 @SLEEP@ 睡眠状态。 - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: 系统已离开 @SLEEP@ 睡眠状态 -Defined-By: systemd -Support: %SUPPORT_URL% - -系统现已离开 @SLEEP@ 睡眠状态。 - --- 98268866d1d54a499c4e98921d93bc40 -Subject: 系统关机已开始 -Defined-By: systemd -Support: %SUPPORT_URL% - -系统关机操作已初始化。 -关机已开始,所有系统服务均已结束,所有文件系统已卸载。 - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: @UNIT@ 单元已开始启动 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 单元已开始启动。 - --- 39f53479d3a045ac8e11786248231fbf -Subject: @UNIT@ 单元已结束启动 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 单元已结束启动。 - -启动结果为“@RESULT@”。 - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: @UNIT@ 单元已开始停止操作 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 单元已开始停止操作。 - --- 9d1aaa27d60140bd96365438aad20286 -Subject: @UNIT@ 单元已结束停止操作 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 单元已结束停止操作。 - --- be02cf6855d2428ba40df7e9d022f03d -Subject: @UNIT@ 单元已失败 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 单元已失败。 - -结果为“@RESULT@”。 - --- d34d037fff1847e6ae669a370e694725 -Subject: @UNIT@ 单元已开始重新载入其配置 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 单元已开始重新载入其配置。 - --- 7b05ebc668384222baa8881179cfda54 -Subject: @UNIT@ 单元已结束配置重载入 -Defined-By: systemd -Support: %SUPPORT_URL% - -@UNIT@ 单元已结束配置重载入操作。 - -结果为“@RESULT@”。 - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: 进程 @EXECUTABLE@ 无法执行 -Defined-By: systemd -Support: %SUPPORT_URL% - -进程 @EXECUTABLE@ 无法被执行并已失败。 - -该进程返回的错误代码为 @ERRNO@。 - --- 0027229ca0644181a76c4e92458afa2e -Subject: 一个或更多消息无法被转发至 syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -有一条或更多的消息无法被转发至与 journald 同时运行的 syslog 服务。 -这通常意味着 syslog 实现无法跟上队列中消息进入的速度。 - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: 挂载点不为空 -Defined-By: systemd -Support: %SUPPORT_URL% - -目录 @WHERE@ 被指定为挂载点(即 /etc/fstab 文件的第二栏,或 systemd 单元 -文件的 Where= 字段),且该目录非空。 -这并不会影响挂载行为,但该目录中先前已存在的文件将无法被访问。 -如需查看这些文件,请手动将其下的文件系统挂载到另一个位置。 - --- 24d8d4452573402496068381a6312df2 -Subject: 一个虚拟机或容器已启动 -Defined-By: systemd -Support: %SUPPORT_URL% - -虚拟机 @NAME@,以及其首进程 PID @LEADER@,已被启动并可被使用。 - --- 58432bd3bace477cb514b56381b8a758 -Subject: 一个虚拟机或容器已被终止 -Defined-By: systemd -Support: %SUPPORT_URL% - -虚拟机 @NAME@,以及其首进程 PID @LEADER@,已被关闭并停止。 diff --git a/src/grp-journal/catalog/systemd.zh_TW.catalog.in b/src/grp-journal/catalog/systemd.zh_TW.catalog.in deleted file mode 100644 index f7b42fa1c7..0000000000 --- a/src/grp-journal/catalog/systemd.zh_TW.catalog.in +++ /dev/null @@ -1,263 +0,0 @@ -# This file is part of systemd. -# -# Copyright 2012 Lennart Poettering -# Copyright 2015 Jeff Huang -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -# Message catalog for systemd's own messages -# Traditional Chinese translation - -# Catalog 的格式記錄於 -# http://www.freedesktop.org/wiki/Software/systemd/catalog - -# For an explanation why we do all this, see https://xkcd.com/1024/ - --- f77379a8490b408bbe5f6940505a777b -Subject: 日誌已開始 -Defined-By: systemd -Support: %SUPPORT_URL% - -系統日誌行程已啟動,已開啟日誌 -檔案供寫入並準備好對行程的要求做出回應。 - --- d93fb3c9c24d451a97cea615ce59c00b -Subject: 日誌已停止 -Defined-By: systemd -Support: %SUPPORT_URL% - -系統日誌行程已關閉,且關閉所有目前 -活躍的日誌檔案。 - --- a596d6fe7bfa4994828e72309e95d61e -Subject: 從服務而來的訊息已被抑制 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:journald.conf(5) - -有一個服務在一個時間週期內記錄了太多訊息。 -從該服務而來的訊息已被丟棄。 - -注意,只有有問題的服務之訊息被丟棄, -其他服務的訊息則不受影響。 - -可以在 /etc/systemd/journald.conf 中設定 -RateLimitIntervalSec= 以及 RateLimitBurst= -來控制當訊息要開始被丟棄時的限制。參見 journald.conf(5) 以獲得更多資訊。 - --- e9bf28e6e834481bb6f48f548ad13606 -Subject: 日誌訊息已遺失 -Defined-By: systemd -Support: %SUPPORT_URL% - -因日誌系統對核心訊息的處理不夠快速, -部份訊息已遺失。 - --- fc2e22bc6ee647b6b90729ab34a250b1 -Subject: 行程 @COREDUMP_PID@ (@COREDUMP_COMM@) 核心傾印 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: man:core(5) - -行程 @COREDUMP_PID@ (@COREDUMP_COMM@) 當掉並核心傾印。 - -這通常代表了在當掉的程式中的一個程式錯誤 -並需要回報錯誤給其開發者。 - --- 8d45620c1a4348dbb17410da57c60c66 -Subject: 新的工作階段 @SESSION_ID@ 已為使用者 @USER_ID@ 建立 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -一個新的工作階段,ID @SESSION_ID@ 已為使用者 @USER_ID@ 建立。 - -這個工作階段的領導行程為 @LEADER@。 - --- 3354939424b4456d9802ca8333ed424a -Subject: 工作階段 @SESSION_ID@ 已結束 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -一個工作階段,ID @SESSION_ID@ 已結束。 - --- fcbefc5da23d428093f97c82a9290f7b -Subject: 新的座位 @SEAT_ID@ 可用 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -一個新的座位 @SEAT_ID@ 已被設定且現在可用。 - --- e7852bfe46784ed0accde04bc864c2d5 -Subject: 座位 @SEAT_ID@ 已被移除 -Defined-By: systemd -Support: %SUPPORT_URL% -Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat - -座位 @SEAT_ID@ 已被移除且不再可用。 - --- c7a787079b354eaaa9e77b371893cd27 -Subject: 時間變更 -Defined-By: systemd -Support: %SUPPORT_URL% - -系統時間已變更為1970年1月1日後 @REALTIME@ 微秒。 - --- 45f82f4aef7a4bbf942ce861d1f20990 -Subject: 時區變更為 @TIMEZONE@ -Defined-By: systemd -Support: %SUPPORT_URL% - -系統時區已變更為 @TIMEZONE@。 - --- b07a249cd024414a82dd00cd181378ff -Subject: 系統啟動已完成 -Defined-By: systemd -Support: %SUPPORT_URL% - -所有開機所必要的系統服務都已成功啟動。 -注意這並不代表這臺機器有空閒的時間 -可以服務,可能仍忙於完成啟動。 - -核心啟動需要 @KERNEL_USEC@ 微秒。 - -初始 RAM 磁碟啟動需要 @INITRD_USEC@ 微秒。 - -使用者空間啟動需要 @USERSPACE_USEC@ 微秒。 - --- 6bbd95ee977941e497c48be27c254128 -Subject: 系統進入 @SLEEP@ 睡眠狀態 -Defined-By: systemd -Support: %SUPPORT_URL% - -系統現在已進入 @SLEEP@ 睡眠狀態。 - --- 8811e6df2a8e40f58a94cea26f8ebf14 -Subject: 系統離開 @SLEEP@ 睡眠狀態 -Defined-By: systemd -Support: %SUPPORT_URL% - -系統現在已離開 @SLEEP@ 睡眠狀態。 - --- 98268866d1d54a499c4e98921d93bc40 -Subject: 系統關機開始 -Defined-By: systemd -Support: %SUPPORT_URL% - -Systemd 關閉已經開始。關閉已開始且所有系統服務 -都已結束,所有的檔案系統也都已被卸載。 - --- 7d4958e842da4a758f6c1cdc7b36dcc5 -Subject: 單位 @UNIT@ 已開始啟動 -Defined-By: systemd -Support: %SUPPORT_URL% - -單位 @UNIT@ 已開始啟動。 - --- 39f53479d3a045ac8e11786248231fbf -Subject: 單位 @UNIT@ 啟動已結束 -Defined-By: systemd -Support: %SUPPORT_URL% - -單位 @UNIT@ 啟動已結束。 - -啟動結果為 @RESULT@。 - --- de5b426a63be47a7b6ac3eaac82e2f6f -Subject: 單位 @UNIT@ 已開始關閉 -Defined-By: systemd -Support: %SUPPORT_URL% - -單位 @UNIT@ 已開始關閉。 - --- 9d1aaa27d60140bd96365438aad20286 -Subject: 單位 @UNIT@ 已關閉結束 -Defined-By: systemd -Support: %SUPPORT_URL% - -單位 @UNIT@ 已關閉結束。 - --- be02cf6855d2428ba40df7e9d022f03d -Subject: 單位 @UNIT@ 已失敗 -Defined-By: systemd -Support: %SUPPORT_URL% - -單位 @UNIT@ 已失敗。 - -結果為 @RESULT@。 - --- d34d037fff1847e6ae669a370e694725 -Subject: 單位 @UNIT@ 已開始重新載入其設定 -Defined-By: systemd -Support: %SUPPORT_URL% - -單位 @UNIT@ 已開始重新載入其設定 - --- 7b05ebc668384222baa8881179cfda54 -Subject: 單位 @UNIT@ 已結束重新載入其設定 -Defined-By: systemd -Support: %SUPPORT_URL% - -單位 @UNIT@ 已結束重新載入其設定 - -結果為 @RESULT@。 - --- 641257651c1b4ec9a8624d7a40a9e1e7 -Subject: 行程 @EXECUTABLE@ 無法執行 -Defined-By: systemd -Support: %SUPPORT_URL% - -行程 @EXECUTABLE@ 無法執行且失敗。 - -由該行程所回傳的錯誤碼為 @ERRNO@。 - --- 0027229ca0644181a76c4e92458afa2e -Subject: 一個或更多訊息無法被轉發到 syslog -Defined-By: systemd -Support: %SUPPORT_URL% - -一個或更多訊息無法被轉發到 syslog 服務 -以及並行執行的 journald。這通常代表著 -syslog 實作並無未跟上佇列中訊息 -的速度。 - --- 1dee0369c7fc4736b7099b38ecb46ee7 -Subject: 掛載點不為空 -Defined-By: systemd -Support: %SUPPORT_URL% - -目錄 @WHERE@ 被指定為掛載點(在 /etc/fstab 中的 -第二欄或是在 systemd 單位檔案中的 Where= 欄位)且其不為空。 -這並不會干擾掛載,但在此目錄中已存在的檔案 -會變成無法存取的狀態。要檢視這些 over-mounted 的檔案, -請手動掛載下面的檔案系統到次要 -位置。 - --- 24d8d4452573402496068381a6312df2 -Subject: 虛擬機器或容器已啟動 -Defined-By: systemd -Support: %SUPPORT_URL% - -虛擬機器 @NAME@ 包含它的領導 PID @LEADER@ 現在 -已經開始並已經可以使用。 - --- 58432bd3bace477cb514b56381b8a758 -Subject: 虛擬機器或容器已結束 -Defined-By: systemd -Support: %SUPPORT_URL% - -虛擬機器 @NAME@ 包含它的領導 PID @LEADER@ 已經 -關閉。 diff --git a/src/grp-journal/grp-remote/microhttpd-util.c b/src/grp-journal/grp-remote/microhttpd-util.c deleted file mode 100644 index 3fc5e13b71..0000000000 --- a/src/grp-journal/grp-remote/microhttpd-util.c +++ /dev/null @@ -1,328 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2012 Lennart Poettering - Copyright 2012 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include - -#ifdef HAVE_GNUTLS -#include -#include -#endif - -#include "basic/alloc-util.h" -#include "basic/log.h" -#include "basic/macro.h" -#include "basic/string-util.h" -#include "basic/strv.h" -#include "basic/util.h" - -#include "microhttpd-util.h" - -void microhttpd_logger(void *arg, const char *fmt, va_list ap) { - char *f; - - f = strjoina("microhttpd: ", fmt); - - DISABLE_WARNING_FORMAT_NONLITERAL; - log_internalv(LOG_INFO, 0, NULL, 0, NULL, f, ap); - REENABLE_WARNING; -} - - -static int mhd_respond_internal(struct MHD_Connection *connection, - enum MHD_RequestTerminationCode code, - char *buffer, - size_t size, - enum MHD_ResponseMemoryMode mode) { - struct MHD_Response *response; - int r; - - assert(connection); - - response = MHD_create_response_from_buffer(size, buffer, mode); - if (!response) - return MHD_NO; - - log_debug("Queueing response %u: %s", code, buffer); - MHD_add_response_header(response, "Content-Type", "text/plain"); - r = MHD_queue_response(connection, code, response); - MHD_destroy_response(response); - - return r; -} - -int mhd_respond(struct MHD_Connection *connection, - enum MHD_RequestTerminationCode code, - const char *message) { - - return mhd_respond_internal(connection, code, - (char*) message, strlen(message), - MHD_RESPMEM_PERSISTENT); -} - -int mhd_respond_oom(struct MHD_Connection *connection) { - return mhd_respond(connection, MHD_HTTP_SERVICE_UNAVAILABLE, "Out of memory.\n"); -} - -int mhd_respondf(struct MHD_Connection *connection, - enum MHD_RequestTerminationCode code, - const char *format, ...) { - - char *m; - int r; - va_list ap; - - assert(connection); - assert(format); - - va_start(ap, format); - r = vasprintf(&m, format, ap); - va_end(ap); - - if (r < 0) - return respond_oom(connection); - - return mhd_respond_internal(connection, code, m, r, MHD_RESPMEM_MUST_FREE); -} - -#ifdef HAVE_GNUTLS - -static struct { - const char *const names[4]; - int level; - bool enabled; -} gnutls_log_map[] = { - { {"0"}, LOG_DEBUG }, - { {"1", "audit"}, LOG_WARNING, true}, /* gnutls session audit */ - { {"2", "assert"}, LOG_DEBUG }, /* gnutls assert log */ - { {"3", "hsk", "ext"}, LOG_DEBUG }, /* gnutls handshake log */ - { {"4", "rec"}, LOG_DEBUG }, /* gnutls record log */ - { {"5", "dtls"}, LOG_DEBUG }, /* gnutls DTLS log */ - { {"6", "buf"}, LOG_DEBUG }, - { {"7", "write", "read"}, LOG_DEBUG }, - { {"8"}, LOG_DEBUG }, - { {"9", "enc", "int"}, LOG_DEBUG }, -}; - -static void log_func_gnutls(int level, const char *message) { - assert_se(message); - - if (0 <= level && level < (int) ELEMENTSOF(gnutls_log_map)) { - if (gnutls_log_map[level].enabled) - log_internal(gnutls_log_map[level].level, 0, NULL, 0, NULL, "gnutls %d/%s: %s", level, gnutls_log_map[level].names[1], message); - } else { - log_debug("Received GNUTLS message with unknown level %d.", level); - log_internal(LOG_DEBUG, 0, NULL, 0, NULL, "gnutls: %s", message); - } -} - -static void log_reset_gnutls_level(void) { - int i; - - for (i = ELEMENTSOF(gnutls_log_map) - 1; i >= 0; i--) - if (gnutls_log_map[i].enabled) { - log_debug("Setting gnutls log level to %d", i); - gnutls_global_set_log_level(i); - break; - } -} - -static int log_enable_gnutls_category(const char *cat) { - unsigned i; - - if (streq(cat, "all")) { - for (i = 0; i < ELEMENTSOF(gnutls_log_map); i++) - gnutls_log_map[i].enabled = true; - log_reset_gnutls_level(); - return 0; - } else - for (i = 0; i < ELEMENTSOF(gnutls_log_map); i++) - if (strv_contains((char**)gnutls_log_map[i].names, cat)) { - gnutls_log_map[i].enabled = true; - log_reset_gnutls_level(); - return 0; - } - log_error("No such log category: %s", cat); - return -EINVAL; -} - -int setup_gnutls_logger(char **categories) { - char **cat; - int r; - - gnutls_global_set_log_function(log_func_gnutls); - - if (categories) { - STRV_FOREACH(cat, categories) { - r = log_enable_gnutls_category(*cat); - if (r < 0) - return r; - } - } else - log_reset_gnutls_level(); - - return 0; -} - -static int verify_cert_authorized(gnutls_session_t session) { - unsigned status; - gnutls_certificate_type_t type; - gnutls_datum_t out; - int r; - - r = gnutls_certificate_verify_peers2(session, &status); - if (r < 0) - return log_error_errno(r, "gnutls_certificate_verify_peers2 failed: %m"); - - type = gnutls_certificate_type_get(session); - r = gnutls_certificate_verification_status_print(status, type, &out, 0); - if (r < 0) - return log_error_errno(r, "gnutls_certificate_verification_status_print failed: %m"); - - log_debug("Certificate status: %s", out.data); - gnutls_free(out.data); - - return status == 0 ? 0 : -EPERM; -} - -static int get_client_cert(gnutls_session_t session, gnutls_x509_crt_t *client_cert) { - const gnutls_datum_t *pcert; - unsigned listsize; - gnutls_x509_crt_t cert; - int r; - - assert(session); - assert(client_cert); - - pcert = gnutls_certificate_get_peers(session, &listsize); - if (!pcert || !listsize) { - log_error("Failed to retrieve certificate chain"); - return -EINVAL; - } - - r = gnutls_x509_crt_init(&cert); - if (r < 0) { - log_error("Failed to initialize client certificate"); - return r; - } - - /* Note that by passing values between 0 and listsize here, you - can get access to the CA's certs */ - r = gnutls_x509_crt_import(cert, &pcert[0], GNUTLS_X509_FMT_DER); - if (r < 0) { - log_error("Failed to import client certificate"); - gnutls_x509_crt_deinit(cert); - return r; - } - - *client_cert = cert; - return 0; -} - -static int get_auth_dn(gnutls_x509_crt_t client_cert, char **buf) { - size_t len = 0; - int r; - - assert(buf); - assert(*buf == NULL); - - r = gnutls_x509_crt_get_dn(client_cert, NULL, &len); - if (r != GNUTLS_E_SHORT_MEMORY_BUFFER) { - log_error("gnutls_x509_crt_get_dn failed"); - return r; - } - - *buf = malloc(len); - if (!*buf) - return log_oom(); - - gnutls_x509_crt_get_dn(client_cert, *buf, &len); - return 0; -} - -static inline void gnutls_x509_crt_deinitp(gnutls_x509_crt_t *p) { - gnutls_x509_crt_deinit(*p); -} - -int check_permissions(struct MHD_Connection *connection, int *code, char **hostname) { - const union MHD_ConnectionInfo *ci; - gnutls_session_t session; - _cleanup_(gnutls_x509_crt_deinitp) gnutls_x509_crt_t client_cert = NULL; - _cleanup_free_ char *buf = NULL; - int r; - - assert(connection); - assert(code); - - *code = 0; - - ci = MHD_get_connection_info(connection, - MHD_CONNECTION_INFO_GNUTLS_SESSION); - if (!ci) { - log_error("MHD_get_connection_info failed: session is unencrypted"); - *code = mhd_respond(connection, MHD_HTTP_FORBIDDEN, - "Encrypted connection is required"); - return -EPERM; - } - session = ci->tls_session; - assert(session); - - r = get_client_cert(session, &client_cert); - if (r < 0) { - *code = mhd_respond(connection, MHD_HTTP_UNAUTHORIZED, - "Authorization through certificate is required"); - return -EPERM; - } - - r = get_auth_dn(client_cert, &buf); - if (r < 0) { - *code = mhd_respond(connection, MHD_HTTP_UNAUTHORIZED, - "Failed to determine distinguished name from certificate"); - return -EPERM; - } - - log_debug("Connection from %s", buf); - - if (hostname) { - *hostname = buf; - buf = NULL; - } - - r = verify_cert_authorized(session); - if (r < 0) { - log_warning("Client is not authorized"); - *code = mhd_respond(connection, MHD_HTTP_UNAUTHORIZED, - "Client certificate not signed by recognized authority"); - } - return r; -} - -#else -int check_permissions(struct MHD_Connection *connection, int *code, char **hostname) { - return -EPERM; -} - -int setup_gnutls_logger(char **categories) { - if (categories) - log_notice("Ignoring specified gnutls logging categories — gnutls not available."); - return 0; -} -#endif diff --git a/src/grp-journal/grp-remote/microhttpd-util.h b/src/grp-journal/grp-remote/microhttpd-util.h deleted file mode 100644 index 178e78f892..0000000000 --- a/src/grp-journal/grp-remote/microhttpd-util.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2012 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#include "basic/macro.h" - -/* Compatiblity with libmicrohttpd < 0.9.38 */ -#ifndef MHD_HTTP_NOT_ACCEPTABLE -#define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE -#endif - -#if MHD_VERSION < 0x00094203 -#define MHD_create_response_from_fd_at_offset64 MHD_create_response_from_fd_at_offset -#endif - -void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_(2, 0); - -/* respond_oom() must be usable with return, hence this form. */ -#define respond_oom(connection) log_oom(), mhd_respond_oom(connection) - -int mhd_respondf(struct MHD_Connection *connection, - unsigned code, - const char *format, ...) _printf_(3,4); - -int mhd_respond(struct MHD_Connection *connection, - unsigned code, - const char *message); - -int mhd_respond_oom(struct MHD_Connection *connection); - -int check_permissions(struct MHD_Connection *connection, int *code, char **hostname); - -/* Set gnutls internal logging function to a callback which uses our - * own logging framework. - * - * gnutls categories are additionally filtered by our internal log - * level, so it should be set fairly high to capture all potentially - * interesting events without overwhelming detail. - */ -int setup_gnutls_logger(char **categories); diff --git a/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile b/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile index 1daedbd8dd..723dfa7ac7 100644 --- a/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile +++ b/src/grp-journal/grp-remote/systemd-journal-gatewayd/Makefile @@ -30,21 +30,12 @@ rootlibexec_PROGRAMS += \ systemd-journal-gatewayd systemd_journal_gatewayd_SOURCES = \ - src/journal-remote/journal-gatewayd.c \ - src/journal-remote/microhttpd-util.h \ - src/journal-remote/microhttpd-util.c + src/journal-remote/journal-gatewayd.c systemd_journal_gatewayd_LDADD = \ + libsystemd-internal.la \ libsystemd-shared.la \ - $(MICROHTTPD_LIBS) - -ifneq ($(HAVE_GNUTLS),) -systemd_journal_gatewayd_LDADD += \ - $(GNUTLS_LIBS) -endif # HAVE_GNUTLS - -systemd_journal_gatewayd_CFLAGS = \ - $(MICROHTTPD_CFLAGS) + libsystemd-microhttpd.la systemd_journal_gatewayd_CPPFLAGS = \ -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\" diff --git a/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c b/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c index 76b241a14b..b92945455b 100644 --- a/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c +++ b/src/grp-journal/grp-remote/systemd-journal-gatewayd/journal-gatewayd.c @@ -31,17 +31,17 @@ #include #include -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/hostname-util.h" -#include "basic/log.h" -#include "basic/parse-util.h" -#include "basic/sigbus.h" -#include "basic/util.h" -#include "microhttpd-util.h" -#include "shared/bus-util.h" -#include "shared/logs-show.h" +#include "sd-bus/bus-util.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/hostname-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/sigbus.h" +#include "systemd-basic/util.h" +#include "systemd-microhttpd/microhttpd-util.h" +#include "systemd-shared/logs-show.h" #define JOURNAL_WAIT_TIMEOUT (10*USEC_PER_SEC) diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/Makefile b/src/grp-journal/grp-remote/systemd-journal-remote/Makefile index ebfa101c97..601bad9b5f 100644 --- a/src/grp-journal/grp-remote/systemd-journal-remote/Makefile +++ b/src/grp-journal/grp-remote/systemd-journal-remote/Makefile @@ -36,28 +36,14 @@ systemd_journal_remote_SOURCES = \ src/journal-remote/journal-remote.c systemd_journal_remote_LDADD = \ + libsystemd-microhttpd.la \ libjournal-core.la -systemd_journal_remote_SOURCES += \ - src/journal-remote/microhttpd-util.h \ - src/journal-remote/microhttpd-util.c - -systemd_journal_remote_CFLAGS = \ - $(MICROHTTPD_CFLAGS) - -systemd_journal_remote_LDADD += \ - $(MICROHTTPD_LIBS) - ifneq ($(ENABLE_TMPFILES),) dist_tmpfiles_DATA += \ tmpfiles.d/systemd-remote.conf endif # ENABLE_TMPFILES -ifneq ($(HAVE_GNUTLS),) -systemd_journal_remote_LDADD += \ - $(GNUTLS_LIBS) -endif # HAVE_GNUTLS - # systemd-journal-remote make sense mostly with full crypto stack dist_systemunit_DATA += \ units/systemd-journal-remote.socket @@ -81,4 +67,7 @@ EXTRA_DIST += \ src/journal-remote/log-generator.py endif # HAVE_MICROHTTPD +sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" +sd.CPPFLAGS += -DCERTIFICATE_ROOT=\"$(CERTIFICATEROOT)\" + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c index c71fedd816..fdfa692214 100644 --- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c +++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-parse.c @@ -17,11 +17,11 @@ along with systemd; If not, see . ***/ -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/parse-util.h" -#include "basic/string-util.h" -#include "journald-native.h" +#include "journal-core/journald-native.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/string-util.h" #include "journal-remote-parse.h" diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c index 4e05eda103..31abdc76d2 100644 --- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c +++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote-write.c @@ -17,7 +17,7 @@ along with systemd; If not, see . ***/ -#include "basic/alloc-util.h" +#include "systemd-basic/alloc-util.h" #include "journal-remote.h" diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c index ac1ba30310..b77abfc184 100644 --- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c +++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.c @@ -33,23 +33,23 @@ #include -#include "basic/alloc-util.h" -#include "basic/def.h" -#include "basic/escape.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/macro.h" -#include "basic/parse-util.h" -#include "basic/signal-util.h" -#include "basic/socket-util.h" -#include "basic/stat-util.h" -#include "basic/stdio-util.h" -#include "basic/string-table.h" -#include "basic/string-util.h" -#include "basic/strv.h" -#include "journald-native.h" +#include "journal-core/journald-native.h" #include "sd-journal/journal-file.h" -#include "shared/conf-parser.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/def.h" +#include "systemd-basic/escape.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/signal-util.h" +#include "systemd-basic/socket-util.h" +#include "systemd-basic/stat-util.h" +#include "systemd-basic/stdio-util.h" +#include "systemd-basic/string-table.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/strv.h" +#include "systemd-shared/conf-parser.h" #include "journal-remote-write.h" #include "journal-remote.h" diff --git a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h index 6abfc1019d..1c090ccdfc 100644 --- a/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h +++ b/src/grp-journal/grp-remote/systemd-journal-remote/journal-remote.h @@ -21,8 +21,8 @@ #include -#include "basic/hashmap.h" -#include "microhttpd-util.h" +#include "systemd-basic/hashmap.h" +#include "systemd-microhttpd/microhttpd-util.h" #include "journal-remote-parse.h" #include "journal-remote-write.h" diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/Makefile b/src/grp-journal/grp-remote/systemd-journal-upload/Makefile index acfcbd22df..bc272e52da 100644 --- a/src/grp-journal/grp-remote/systemd-journal-upload/Makefile +++ b/src/grp-journal/grp-remote/systemd-journal-upload/Makefile @@ -54,4 +54,7 @@ EXTRA_DIST += \ units/systemd-journal-upload.service.in \ src/journal-remote/journal-upload.conf.in +sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" +sd.CPPFLAGS += -DCERTIFICATE_ROOT=\"$(CERTIFICATEROOT)\" + include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c index 61d287da97..3a5e450e35 100644 --- a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c +++ b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload-journal.c @@ -22,10 +22,10 @@ #include -#include "basic/alloc-util.h" -#include "basic/log.h" -#include "basic/utf8.h" -#include "basic/util.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/utf8.h" +#include "systemd-basic/util.h" #include "journal-upload.h" diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c index 82d8331e76..52964bd03a 100644 --- a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c +++ b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.c @@ -25,20 +25,20 @@ #include -#include "basic/alloc-util.h" -#include "basic/def.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/formats-util.h" -#include "basic/glob-util.h" -#include "basic/log.h" -#include "basic/mkdir.h" -#include "basic/parse-util.h" -#include "basic/sigbus.h" -#include "basic/signal-util.h" -#include "basic/string-util.h" -#include "basic/util.h" -#include "shared/conf-parser.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/def.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/formats-util.h" +#include "systemd-basic/glob-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/mkdir.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/sigbus.h" +#include "systemd-basic/signal-util.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/util.h" +#include "systemd-shared/conf-parser.h" #include "journal-upload.h" diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h index 9eeb8d2123..f1fd95e22c 100644 --- a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h +++ b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h @@ -6,7 +6,7 @@ #include #include -#include "basic/time-util.h" +#include "systemd-basic/time-util.h" typedef enum { ENTRY_CURSOR = 0, /* Nothing actually written yet. */ diff --git a/src/grp-journal/journalctl/Makefile b/src/grp-journal/journalctl/Makefile index 11cfe17107..880827b85d 100644 --- a/src/grp-journal/journalctl/Makefile +++ b/src/grp-journal/journalctl/Makefile @@ -30,6 +30,7 @@ journalctl_SOURCES = \ src/journal/journalctl.c journalctl_LDADD = \ + libsystemd-internal.la \ libsystemd-shared.la \ libudev-core.la diff --git a/src/grp-journal/journalctl/journalctl.c b/src/grp-journal/journalctl/journalctl.c index e50c21d681..4317c05b33 100644 --- a/src/grp-journal/journalctl/journalctl.c +++ b/src/grp-journal/journalctl/journalctl.c @@ -37,39 +37,39 @@ #include #include -#include "basic/alloc-util.h" -#include "basic/chattr-util.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/fs-util.h" -#include "basic/glob-util.h" -#include "basic/hostname-util.h" -#include "basic/io-util.h" -#include "basic/locale-util.h" -#include "basic/log.h" -#include "basic/mkdir.h" -#include "basic/parse-util.h" -#include "basic/path-util.h" -#include "basic/rlimit-util.h" -#include "basic/set.h" -#include "basic/sigbus.h" -#include "basic/strv.h" -#include "basic/syslog-util.h" -#include "basic/terminal-util.h" -#include "basic/unit-name.h" -#include "basic/user-util.h" #include "sd-bus/bus-error.h" +#include "sd-bus/bus-util.h" #include "sd-journal/catalog.h" #include "sd-journal/fsprg.h" #include "sd-journal/journal-def.h" #include "sd-journal/journal-internal.h" #include "sd-journal/journal-vacuum.h" #include "sd-journal/journal-verify.h" -#include "shared/acl-util.h" -#include "shared/bus-util.h" -#include "shared/logs-show.h" -#include "shared/pager.h" -#include "shared/udev-util.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/chattr-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/fs-util.h" +#include "systemd-basic/glob-util.h" +#include "systemd-basic/hostname-util.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/locale-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/mkdir.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/path-util.h" +#include "systemd-basic/rlimit-util.h" +#include "systemd-basic/set.h" +#include "systemd-basic/sigbus.h" +#include "systemd-basic/strv.h" +#include "systemd-basic/syslog-util.h" +#include "systemd-basic/terminal-util.h" +#include "systemd-basic/unit-name.h" +#include "systemd-basic/user-util.h" +#include "systemd-shared/acl-util.h" +#include "systemd-shared/logs-show.h" +#include "systemd-shared/pager.h" +#include "systemd-shared/udev-util.h" #include "udev.h" #include "journal-qrcode.h" diff --git a/src/grp-journal/libjournal-core/Makefile b/src/grp-journal/libjournal-core/Makefile index 330620bbd9..76e6e9ddee 100644 --- a/src/grp-journal/libjournal-core/Makefile +++ b/src/grp-journal/libjournal-core/Makefile @@ -23,36 +23,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -libjournal_core_la_SOURCES = \ - src/journal/journald-kmsg.c \ - src/journal/journald-kmsg.h \ - src/journal/journald-syslog.c \ - src/journal/journald-syslog.h \ - src/journal/journald-stream.c \ - src/journal/journald-stream.h \ - src/journal/journald-server.c \ - src/journal/journald-server.h \ - src/journal/journald-console.c \ - src/journal/journald-console.h \ - src/journal/journald-wall.c \ - src/journal/journald-wall.h \ - src/journal/journald-native.c \ - src/journal/journald-native.h \ - src/journal/journald-audit.c \ - src/journal/journald-audit.h \ - src/journal/journald-rate-limit.c \ - src/journal/journald-rate-limit.h \ - src/journal/journal-internal.h - -nodist_libjournal_core_la_SOURCES = \ - src/journal/journald-gperf.c - -libjournal_core_la_LIBADD = \ - libsystemd-shared.la - -noinst_LTLIBRARIES += \ - libjournal-core.la - -sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" +nested.subdirs += src include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-audit.h b/src/grp-journal/libjournal-core/include/journal-core/journald-audit.h new file mode 100644 index 0000000000..4d5d359d6a --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-audit.h @@ -0,0 +1,28 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "systemd-basic/socket-util.h" + +#include "journald-server.h" + +void server_process_audit_message(Server *s, const void *buffer, size_t buffer_size, const struct ucred *ucred, const union sockaddr_union *sa, socklen_t salen); + +int server_open_audit(Server*s); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-console.h b/src/grp-journal/libjournal-core/include/journal-core/journald-console.h new file mode 100644 index 0000000000..dda07e2c28 --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-console.h @@ -0,0 +1,24 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journald-server.h" + +void server_forward_console(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-kmsg.h b/src/grp-journal/libjournal-core/include/journal-core/journald-kmsg.h new file mode 100644 index 0000000000..dab49f1e8c --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-kmsg.h @@ -0,0 +1,29 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journald-server.h" + +int server_open_dev_kmsg(Server *s); +int server_flush_dev_kmsg(Server *s); + +void server_forward_kmsg(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred); + +int server_open_kernel_seqnum(Server *s); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-native.h b/src/grp-journal/libjournal-core/include/journal-core/journald-native.h new file mode 100644 index 0000000000..c13b80aa4f --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-native.h @@ -0,0 +1,35 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journald-server.h" + +/* Make sure not to make this smaller than the maximum coredump + * size. See COREDUMP_MAX in coredump.c */ +#define ENTRY_SIZE_MAX (1024*1024*770u) +#define DATA_SIZE_MAX (1024*1024*768u) + +bool valid_user_field(const char *p, size_t l, bool allow_protected); + +void server_process_native_message(Server *s, const void *buffer, size_t buffer_size, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); + +void server_process_native_file(Server *s, int fd, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); + +int server_open_native_socket(Server*s); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-rate-limit.h b/src/grp-journal/libjournal-core/include/journal-core/journald-rate-limit.h new file mode 100644 index 0000000000..4f7764eb1d --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-rate-limit.h @@ -0,0 +1,28 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "systemd-basic/util.h" + +typedef struct JournalRateLimit JournalRateLimit; + +JournalRateLimit *journal_rate_limit_new(usec_t interval, unsigned burst); +void journal_rate_limit_free(JournalRateLimit *r); +int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, uint64_t available); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-server.h b/src/grp-journal/libjournal-core/include/journal-core/journald-server.h new file mode 100644 index 0000000000..a621d707ca --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-server.h @@ -0,0 +1,187 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#include + +#include "sd-journal/journal-file.h" +#include "systemd-basic/hashmap.h" +#include "systemd-basic/list.h" + +typedef struct Server Server; + +#include "journald-rate-limit.h" +#include "journald-stream.h" + +typedef enum Storage { + STORAGE_AUTO, + STORAGE_VOLATILE, + STORAGE_PERSISTENT, + STORAGE_NONE, + _STORAGE_MAX, + _STORAGE_INVALID = -1 +} Storage; + +typedef enum SplitMode { + SPLIT_UID, + SPLIT_LOGIN, + SPLIT_NONE, + _SPLIT_MAX, + _SPLIT_INVALID = -1 +} SplitMode; + +struct Server { + int syslog_fd; + int native_fd; + int stdout_fd; + int dev_kmsg_fd; + int audit_fd; + int hostname_fd; + int notify_fd; + + sd_event *event; + + sd_event_source *syslog_event_source; + sd_event_source *native_event_source; + sd_event_source *stdout_event_source; + sd_event_source *dev_kmsg_event_source; + sd_event_source *audit_event_source; + sd_event_source *sync_event_source; + sd_event_source *sigusr1_event_source; + sd_event_source *sigusr2_event_source; + sd_event_source *sigterm_event_source; + sd_event_source *sigint_event_source; + sd_event_source *sigrtmin1_event_source; + sd_event_source *hostname_event_source; + sd_event_source *notify_event_source; + sd_event_source *watchdog_event_source; + + JournalFile *runtime_journal; + JournalFile *system_journal; + OrderedHashmap *user_journals; + + uint64_t seqnum; + + char *buffer; + size_t buffer_size; + + JournalRateLimit *rate_limit; + usec_t sync_interval_usec; + usec_t rate_limit_interval; + unsigned rate_limit_burst; + + JournalMetrics runtime_metrics; + JournalMetrics system_metrics; + + bool compress; + bool seal; + + bool forward_to_kmsg; + bool forward_to_syslog; + bool forward_to_console; + bool forward_to_wall; + + unsigned n_forward_syslog_missed; + usec_t last_warn_forward_syslog_missed; + + uint64_t cached_space_available; + uint64_t cached_space_limit; + usec_t cached_space_timestamp; + + uint64_t var_available_timestamp; + + usec_t max_retention_usec; + usec_t max_file_usec; + usec_t oldest_file_usec; + + LIST_HEAD(StdoutStream, stdout_streams); + LIST_HEAD(StdoutStream, stdout_streams_notify_queue); + unsigned n_stdout_streams; + + char *tty_path; + + int max_level_store; + int max_level_syslog; + int max_level_kmsg; + int max_level_console; + int max_level_wall; + + Storage storage; + SplitMode split_mode; + + MMapCache *mmap; + + Set *deferred_closes; + + struct udev *udev; + + uint64_t *kernel_seqnum; + bool dev_kmsg_readable:1; + + bool send_watchdog:1; + bool sent_notify_ready:1; + bool sync_scheduled:1; + + char machine_id_field[sizeof("_MACHINE_ID=") + 32]; + char boot_id_field[sizeof("_BOOT_ID=") + 32]; + char *hostname_field; + + /* Cached cgroup root, so that we don't have to query that all the time */ + char *cgroup_root; + + usec_t watchdog_usec; +}; + +#define SERVER_MACHINE_ID(s) ((s)->machine_id_field + strlen("_MACHINE_ID=")) + +#define N_IOVEC_META_FIELDS 20 +#define N_IOVEC_KERNEL_FIELDS 64 +#define N_IOVEC_UDEV_FIELDS 32 +#define N_IOVEC_OBJECT_FIELDS 12 +#define N_IOVEC_PAYLOAD_FIELDS 15 + +void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigned m, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len, const char *unit_id, int priority, pid_t object_pid); +void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) _printf_(3,0) _sentinel_; + +/* gperf lookup function */ +const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length); + +int config_parse_storage(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +const char *storage_to_string(Storage s) _const_; +Storage storage_from_string(const char *s) _pure_; + +int config_parse_split_mode(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +const char *split_mode_to_string(SplitMode s) _const_; +SplitMode split_mode_from_string(const char *s) _pure_; + +int server_init(Server *s); +void server_done(Server *s); +void server_sync(Server *s); +int server_vacuum(Server *s, bool verbose, bool patch_min_use); +void server_rotate(Server *s); +int server_schedule_sync(Server *s, int priority); +int server_flush_to_var(Server *s); +void server_maybe_append_tags(Server *s); +int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-stream.h b/src/grp-journal/libjournal-core/include/journal-core/journald-stream.h new file mode 100644 index 0000000000..ff38effb1d --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-stream.h @@ -0,0 +1,32 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "systemd-shared/fdset.h" + +typedef struct StdoutStream StdoutStream; + +#include "journald-server.h" + +int server_open_stdout_socket(Server *s); +int server_restore_streams(Server *s, FDSet *fds); + +void stdout_stream_free(StdoutStream *s); +void stdout_stream_send_notify(StdoutStream *s); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-syslog.h b/src/grp-journal/libjournal-core/include/journal-core/journald-syslog.h new file mode 100644 index 0000000000..46ad715314 --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-syslog.h @@ -0,0 +1,33 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journald-server.h" + +int syslog_fixup_facility(int priority) _const_; + +size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid); + +void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv); + +void server_process_syslog_message(Server *s, const char *buf, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); +int server_open_syslog_socket(Server *s); + +void server_maybe_warn_forward_syslog_missed(Server *s); diff --git a/src/grp-journal/libjournal-core/include/journal-core/journald-wall.h b/src/grp-journal/libjournal-core/include/journal-core/journald-wall.h new file mode 100644 index 0000000000..ebc2b89fa8 --- /dev/null +++ b/src/grp-journal/libjournal-core/include/journal-core/journald-wall.h @@ -0,0 +1,24 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2014 Sebastian Thorarensen + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journald-server.h" + +void server_forward_wall(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred); diff --git a/src/grp-journal/libjournal-core/journald-audit.c b/src/grp-journal/libjournal-core/journald-audit.c deleted file mode 100644 index 74ad0c017e..0000000000 --- a/src/grp-journal/libjournal-core/journald-audit.c +++ /dev/null @@ -1,565 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2014 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/hexdecoct.h" -#include "basic/io-util.h" -#include "basic/missing.h" -#include "basic/string-util.h" -#include "sd-journal/audit-type.h" - -#include "journald-audit.h" - -typedef struct MapField { - const char *audit_field; - const char *journal_field; - int (*map)(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov); -} MapField; - -static int map_simple_field(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { - _cleanup_free_ char *c = NULL; - size_t l = 0, allocated = 0; - const char *e; - - assert(field); - assert(p); - assert(iov); - assert(n_iov); - - l = strlen(field); - allocated = l + 1; - c = malloc(allocated); - if (!c) - return -ENOMEM; - - memcpy(c, field, l); - for (e = *p; *e != ' ' && *e != 0; e++) { - if (!GREEDY_REALLOC(c, allocated, l+2)) - return -ENOMEM; - - c[l++] = *e; - } - - c[l] = 0; - - if (!GREEDY_REALLOC(*iov, *n_iov_allocated, *n_iov + 1)) - return -ENOMEM; - - (*iov)[*n_iov].iov_base = c; - (*iov)[*n_iov].iov_len = l; - (*n_iov)++; - - *p = e; - c = NULL; - - return 1; -} - -static int map_string_field_internal(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov, bool filter_printable) { - _cleanup_free_ char *c = NULL; - const char *s, *e; - size_t l; - - assert(field); - assert(p); - assert(iov); - assert(n_iov); - - /* The kernel formats string fields in one of two formats. */ - - if (**p == '"') { - /* Normal quoted syntax */ - s = *p + 1; - e = strchr(s, '"'); - if (!e) - return 0; - - l = strlen(field) + (e - s); - c = malloc(l+1); - if (!c) - return -ENOMEM; - - *((char*) mempcpy(stpcpy(c, field), s, e - s)) = 0; - - e += 1; - - } else if (unhexchar(**p) >= 0) { - /* Hexadecimal escaping */ - size_t allocated = 0; - - l = strlen(field); - allocated = l + 2; - c = malloc(allocated); - if (!c) - return -ENOMEM; - - memcpy(c, field, l); - for (e = *p; *e != ' ' && *e != 0; e += 2) { - int a, b; - uint8_t x; - - a = unhexchar(e[0]); - if (a < 0) - return 0; - - b = unhexchar(e[1]); - if (b < 0) - return 0; - - x = ((uint8_t) a << 4 | (uint8_t) b); - - if (filter_printable && x < (uint8_t) ' ') - x = (uint8_t) ' '; - - if (!GREEDY_REALLOC(c, allocated, l+2)) - return -ENOMEM; - - c[l++] = (char) x; - } - - c[l] = 0; - } else - return 0; - - if (!GREEDY_REALLOC(*iov, *n_iov_allocated, *n_iov + 1)) - return -ENOMEM; - - (*iov)[*n_iov].iov_base = c; - (*iov)[*n_iov].iov_len = l; - (*n_iov)++; - - *p = e; - c = NULL; - - return 1; -} - -static int map_string_field(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { - return map_string_field_internal(field, p, iov, n_iov_allocated, n_iov, false); -} - -static int map_string_field_printable(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { - return map_string_field_internal(field, p, iov, n_iov_allocated, n_iov, true); -} - -static int map_generic_field(const char *prefix, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { - const char *e, *f; - char *c, *t; - int r; - - /* Implements fallback mappings for all fields we don't know */ - - for (e = *p; e < *p + 16; e++) { - - if (*e == 0 || *e == ' ') - return 0; - - if (*e == '=') - break; - - if (!((*e >= 'a' && *e <= 'z') || - (*e >= 'A' && *e <= 'Z') || - (*e >= '0' && *e <= '9') || - *e == '_' || *e == '-')) - return 0; - } - - if (e <= *p || e >= *p + 16) - return 0; - - c = alloca(strlen(prefix) + (e - *p) + 2); - - t = stpcpy(c, prefix); - for (f = *p; f < e; f++) { - char x; - - if (*f >= 'a' && *f <= 'z') - x = (*f - 'a') + 'A'; /* uppercase */ - else if (*f == '-') - x = '_'; /* dashes → underscores */ - else - x = *f; - - *(t++) = x; - } - strcpy(t, "="); - - e++; - - r = map_simple_field(c, &e, iov, n_iov_allocated, n_iov); - if (r < 0) - return r; - - *p = e; - return r; -} - -/* Kernel fields are those occurring in the audit string before - * msg='. All of these fields are trusted, hence carry the "_" prefix. - * We try to translate the fields we know into our native names. The - * other's are generically mapped to _AUDIT_FIELD_XYZ= */ -static const MapField map_fields_kernel[] = { - - /* First, we map certain well-known audit fields into native - * well-known fields */ - { "pid=", "_PID=", map_simple_field }, - { "ppid=", "_PPID=", map_simple_field }, - { "uid=", "_UID=", map_simple_field }, - { "euid=", "_EUID=", map_simple_field }, - { "fsuid=", "_FSUID=", map_simple_field }, - { "gid=", "_GID=", map_simple_field }, - { "egid=", "_EGID=", map_simple_field }, - { "fsgid=", "_FSGID=", map_simple_field }, - { "tty=", "_TTY=", map_simple_field }, - { "ses=", "_AUDIT_SESSION=", map_simple_field }, - { "auid=", "_AUDIT_LOGINUID=", map_simple_field }, - { "subj=", "_SELINUX_CONTEXT=", map_simple_field }, - { "comm=", "_COMM=", map_string_field }, - { "exe=", "_EXE=", map_string_field }, - { "proctitle=", "_CMDLINE=", map_string_field_printable }, - - /* Some fields don't map to native well-known fields. However, - * we know that they are string fields, hence let's undo - * string field escaping for them, though we stick to the - * generic field names. */ - { "path=", "_AUDIT_FIELD_PATH=", map_string_field }, - { "dev=", "_AUDIT_FIELD_DEV=", map_string_field }, - { "name=", "_AUDIT_FIELD_NAME=", map_string_field }, - {} -}; - -/* Userspace fields are those occurring in the audit string after - * msg='. All of these fields are untrusted, hence carry no "_" - * prefix. We map the fields we don't know to AUDIT_FIELD_XYZ= */ -static const MapField map_fields_userspace[] = { - { "cwd=", "AUDIT_FIELD_CWD=", map_string_field }, - { "cmd=", "AUDIT_FIELD_CMD=", map_string_field }, - { "acct=", "AUDIT_FIELD_ACCT=", map_string_field }, - { "exe=", "AUDIT_FIELD_EXE=", map_string_field }, - { "comm=", "AUDIT_FIELD_COMM=", map_string_field }, - {} -}; - -static int map_all_fields( - const char *p, - const MapField map_fields[], - const char *prefix, - bool handle_msg, - struct iovec **iov, - size_t *n_iov_allocated, - unsigned *n_iov) { - - int r; - - assert(p); - assert(iov); - assert(n_iov_allocated); - assert(n_iov); - - for (;;) { - bool mapped = false; - const MapField *m; - const char *v; - - p += strspn(p, WHITESPACE); - - if (*p == 0) - return 0; - - if (handle_msg) { - v = startswith(p, "msg='"); - if (v) { - const char *e; - char *c; - - /* Userspace message. It's enclosed in - simple quotation marks, is not - escaped, but the last field in the - line, hence let's remove the - quotation mark, and apply the - userspace mapping instead of the - kernel mapping. */ - - e = endswith(v, "'"); - if (!e) - return 0; /* don't continue splitting up if the final quotation mark is missing */ - - c = strndupa(v, e - v); - return map_all_fields(c, map_fields_userspace, "AUDIT_FIELD_", false, iov, n_iov_allocated, n_iov); - } - } - - /* Try to map the kernel fields to our own names */ - for (m = map_fields; m->audit_field; m++) { - v = startswith(p, m->audit_field); - if (!v) - continue; - - r = m->map(m->journal_field, &v, iov, n_iov_allocated, n_iov); - if (r < 0) - return log_debug_errno(r, "Failed to parse audit array: %m"); - - if (r > 0) { - mapped = true; - p = v; - break; - } - } - - if (!mapped) { - r = map_generic_field(prefix, &p, iov, n_iov_allocated, n_iov); - if (r < 0) - return log_debug_errno(r, "Failed to parse audit array: %m"); - - if (r == 0) - /* Couldn't process as generic field, let's just skip over it */ - p += strcspn(p, WHITESPACE); - } - } -} - -static void process_audit_string(Server *s, int type, const char *data, size_t size) { - _cleanup_free_ struct iovec *iov = NULL; - size_t n_iov_allocated = 0; - unsigned n_iov = 0, k; - uint64_t seconds, msec, id; - const char *p, *type_name; - unsigned z; - char id_field[sizeof("_AUDIT_ID=") + DECIMAL_STR_MAX(uint64_t)], - type_field[sizeof("_AUDIT_TYPE=") + DECIMAL_STR_MAX(int)], - source_time_field[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)]; - char *m; - - assert(s); - - if (size <= 0) - return; - - if (!data) - return; - - /* Note that the input buffer is NUL terminated, but let's - * check whether there is a spurious NUL byte */ - if (memchr(data, 0, size)) - return; - - p = startswith(data, "audit"); - if (!p) - return; - - if (sscanf(p, "(%" PRIu64 ".%" PRIu64 ":%" PRIu64 "):%n", - &seconds, - &msec, - &id, - &k) != 3) - return; - - p += k; - p += strspn(p, WHITESPACE); - - if (isempty(p)) - return; - - n_iov_allocated = N_IOVEC_META_FIELDS + 7; - iov = new(struct iovec, n_iov_allocated); - if (!iov) { - log_oom(); - return; - } - - IOVEC_SET_STRING(iov[n_iov++], "_TRANSPORT=audit"); - - sprintf(source_time_field, "_SOURCE_REALTIME_TIMESTAMP=%" PRIu64, - (usec_t) seconds * USEC_PER_SEC + (usec_t) msec * USEC_PER_MSEC); - IOVEC_SET_STRING(iov[n_iov++], source_time_field); - - sprintf(type_field, "_AUDIT_TYPE=%i", type); - IOVEC_SET_STRING(iov[n_iov++], type_field); - - sprintf(id_field, "_AUDIT_ID=%" PRIu64, id); - IOVEC_SET_STRING(iov[n_iov++], id_field); - - assert_cc(4 == LOG_FAC(LOG_AUTH)); - IOVEC_SET_STRING(iov[n_iov++], "SYSLOG_FACILITY=4"); - IOVEC_SET_STRING(iov[n_iov++], "SYSLOG_IDENTIFIER=audit"); - - type_name = audit_type_name_alloca(type); - - m = strjoina("MESSAGE=", type_name, " ", p); - IOVEC_SET_STRING(iov[n_iov++], m); - - z = n_iov; - - map_all_fields(p, map_fields_kernel, "_AUDIT_FIELD_", true, &iov, &n_iov_allocated, &n_iov); - - if (!GREEDY_REALLOC(iov, n_iov_allocated, n_iov + N_IOVEC_META_FIELDS)) { - log_oom(); - goto finish; - } - - server_dispatch_message(s, iov, n_iov, n_iov_allocated, NULL, NULL, NULL, 0, NULL, LOG_NOTICE, 0); - -finish: - /* free() all entries that map_all_fields() added. All others - * are allocated on the stack or are constant. */ - - for (; z < n_iov; z++) - free(iov[z].iov_base); -} - -void server_process_audit_message( - Server *s, - const void *buffer, - size_t buffer_size, - const struct ucred *ucred, - const union sockaddr_union *sa, - socklen_t salen) { - - const struct nlmsghdr *nl = buffer; - - assert(s); - - if (buffer_size < ALIGN(sizeof(struct nlmsghdr))) - return; - - assert(buffer); - - /* Filter out fake data */ - if (!sa || - salen != sizeof(struct sockaddr_nl) || - sa->nl.nl_family != AF_NETLINK || - sa->nl.nl_pid != 0) { - log_debug("Audit netlink message from invalid sender."); - return; - } - - if (!ucred || ucred->pid != 0) { - log_debug("Audit netlink message with invalid credentials."); - return; - } - - if (!NLMSG_OK(nl, buffer_size)) { - log_error("Audit netlink message truncated."); - return; - } - - /* Ignore special Netlink messages */ - if (IN_SET(nl->nlmsg_type, NLMSG_NOOP, NLMSG_ERROR)) - return; - - /* Below AUDIT_FIRST_USER_MSG theer are only control messages, let's ignore those */ - if (nl->nlmsg_type < AUDIT_FIRST_USER_MSG) - return; - - process_audit_string(s, nl->nlmsg_type, NLMSG_DATA(nl), nl->nlmsg_len - ALIGN(sizeof(struct nlmsghdr))); -} - -static int enable_audit(int fd, bool b) { - struct { - union { - struct nlmsghdr header; - uint8_t header_space[NLMSG_HDRLEN]; - }; - struct audit_status body; - } _packed_ request = { - .header.nlmsg_len = NLMSG_LENGTH(sizeof(struct audit_status)), - .header.nlmsg_type = AUDIT_SET, - .header.nlmsg_flags = NLM_F_REQUEST, - .header.nlmsg_seq = 1, - .header.nlmsg_pid = 0, - .body.mask = AUDIT_STATUS_ENABLED, - .body.enabled = b, - }; - union sockaddr_union sa = { - .nl.nl_family = AF_NETLINK, - .nl.nl_pid = 0, - }; - struct iovec iovec = { - .iov_base = &request, - .iov_len = NLMSG_LENGTH(sizeof(struct audit_status)), - }; - struct msghdr mh = { - .msg_iov = &iovec, - .msg_iovlen = 1, - .msg_name = &sa.sa, - .msg_namelen = sizeof(sa.nl), - }; - - ssize_t n; - - n = sendmsg(fd, &mh, MSG_NOSIGNAL); - if (n < 0) - return -errno; - if (n != NLMSG_LENGTH(sizeof(struct audit_status))) - return -EIO; - - /* We don't wait for the result here, we can't do anything - * about it anyway */ - - return 0; -} - -int server_open_audit(Server *s) { - static const int one = 1; - int r; - - if (s->audit_fd < 0) { - static const union sockaddr_union sa = { - .nl.nl_family = AF_NETLINK, - .nl.nl_pid = 0, - .nl.nl_groups = AUDIT_NLGRP_READLOG, - }; - - s->audit_fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT); - if (s->audit_fd < 0) { - if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) - log_debug("Audit not supported in the kernel."); - else - log_warning_errno(errno, "Failed to create audit socket, ignoring: %m"); - - return 0; - } - - if (bind(s->audit_fd, &sa.sa, sizeof(sa.nl)) < 0) { - log_warning_errno(errno, - "Failed to join audit multicast group. " - "The kernel is probably too old or multicast reading is not supported. " - "Ignoring: %m"); - s->audit_fd = safe_close(s->audit_fd); - return 0; - } - } else - fd_nonblock(s->audit_fd, 1); - - r = setsockopt(s->audit_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); - if (r < 0) - return log_error_errno(errno, "Failed to set SO_PASSCRED on audit socket: %m"); - - r = sd_event_add_io(s->event, &s->audit_event_source, s->audit_fd, EPOLLIN, server_process_datagram, s); - if (r < 0) - return log_error_errno(r, "Failed to add audit fd to event loop: %m"); - - /* We are listening now, try to enable audit */ - r = enable_audit(s->audit_fd, true); - if (r < 0) - log_warning_errno(r, "Failed to issue audit enable call: %m"); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/journald-audit.h b/src/grp-journal/libjournal-core/journald-audit.h deleted file mode 100644 index 98c07e95e4..0000000000 --- a/src/grp-journal/libjournal-core/journald-audit.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2014 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "basic/socket-util.h" - -#include "journald-server.h" - -void server_process_audit_message(Server *s, const void *buffer, size_t buffer_size, const struct ucred *ucred, const union sockaddr_union *sa, socklen_t salen); - -int server_open_audit(Server*s); diff --git a/src/grp-journal/libjournal-core/journald-console.c b/src/grp-journal/libjournal-core/journald-console.c deleted file mode 100644 index b1e6828dc2..0000000000 --- a/src/grp-journal/libjournal-core/journald-console.c +++ /dev/null @@ -1,116 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include - -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/formats-util.h" -#include "basic/io-util.h" -#include "basic/parse-util.h" -#include "basic/process-util.h" -#include "basic/stdio-util.h" -#include "basic/terminal-util.h" - -#include "journald-console.h" -#include "journald-server.h" - -static bool prefix_timestamp(void) { - - static int cached_printk_time = -1; - - if (_unlikely_(cached_printk_time < 0)) { - _cleanup_free_ char *p = NULL; - - cached_printk_time = - read_one_line_file("/sys/module/printk/parameters/time", &p) >= 0 - && parse_boolean(p) > 0; - } - - return cached_printk_time; -} - -void server_forward_console( - Server *s, - int priority, - const char *identifier, - const char *message, - const struct ucred *ucred) { - - struct iovec iovec[5]; - struct timespec ts; - char tbuf[sizeof("[] ")-1 + DECIMAL_STR_MAX(ts.tv_sec) + DECIMAL_STR_MAX(ts.tv_nsec)-3 + 1]; - char header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t)]; - int n = 0, fd; - _cleanup_free_ char *ident_buf = NULL; - const char *tty; - - assert(s); - assert(message); - - if (LOG_PRI(priority) > s->max_level_console) - return; - - /* First: timestamp */ - if (prefix_timestamp()) { - assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0); - xsprintf(tbuf, "[%5"PRI_TIME".%06ld] ", - ts.tv_sec, - ts.tv_nsec / 1000); - IOVEC_SET_STRING(iovec[n++], tbuf); - } - - /* Second: identifier and PID */ - if (ucred) { - if (!identifier) { - get_process_comm(ucred->pid, &ident_buf); - identifier = ident_buf; - } - - xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); - - if (identifier) - IOVEC_SET_STRING(iovec[n++], identifier); - - IOVEC_SET_STRING(iovec[n++], header_pid); - } else if (identifier) { - IOVEC_SET_STRING(iovec[n++], identifier); - IOVEC_SET_STRING(iovec[n++], ": "); - } - - /* Fourth: message */ - IOVEC_SET_STRING(iovec[n++], message); - IOVEC_SET_STRING(iovec[n++], "\n"); - - tty = s->tty_path ? s->tty_path : "/dev/console"; - - fd = open_terminal(tty, O_WRONLY|O_NOCTTY|O_CLOEXEC); - if (fd < 0) { - log_debug_errno(fd, "Failed to open %s for logging: %m", tty); - return; - } - - if (writev(fd, iovec, n) < 0) - log_debug_errno(errno, "Failed to write to %s for logging: %m", tty); - - safe_close(fd); -} diff --git a/src/grp-journal/libjournal-core/journald-console.h b/src/grp-journal/libjournal-core/journald-console.h deleted file mode 100644 index dda07e2c28..0000000000 --- a/src/grp-journal/libjournal-core/journald-console.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "journald-server.h" - -void server_forward_console(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred); diff --git a/src/grp-journal/libjournal-core/journald-gperf.gperf b/src/grp-journal/libjournal-core/journald-gperf.gperf deleted file mode 100644 index 7c5c68862a..0000000000 --- a/src/grp-journal/libjournal-core/journald-gperf.gperf +++ /dev/null @@ -1,48 +0,0 @@ -%{ -#include -#include - -#include "shared/conf-parser.h" - -#include "journald-server.h" -%} -struct ConfigPerfItem; -%null_strings -%language=ANSI-C -%define slot-name section_and_lvalue -%define hash-function-name journald_gperf_hash -%define lookup-function-name journald_gperf_lookup -%readonly-tables -%omit-struct-type -%struct-type -%includes -%% -Journal.Storage, config_parse_storage, 0, offsetof(Server, storage) -Journal.Compress, config_parse_bool, 0, offsetof(Server, compress) -Journal.Seal, config_parse_bool, 0, offsetof(Server, seal) -Journal.SyncIntervalSec, config_parse_sec, 0, offsetof(Server, sync_interval_usec) -# The following is a legacy name for compatibility -Journal.RateLimitInterval, config_parse_sec, 0, offsetof(Server, rate_limit_interval) -Journal.RateLimitIntervalSec,config_parse_sec, 0, offsetof(Server, rate_limit_interval) -Journal.RateLimitBurst, config_parse_unsigned, 0, offsetof(Server, rate_limit_burst) -Journal.SystemMaxUse, config_parse_iec_uint64, 0, offsetof(Server, system_metrics.max_use) -Journal.SystemMaxFileSize, config_parse_iec_uint64, 0, offsetof(Server, system_metrics.max_size) -Journal.SystemKeepFree, config_parse_iec_uint64, 0, offsetof(Server, system_metrics.keep_free) -Journal.SystemMaxFiles, config_parse_uint64, 0, offsetof(Server, system_metrics.n_max_files) -Journal.RuntimeMaxUse, config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.max_use) -Journal.RuntimeMaxFileSize, config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.max_size) -Journal.RuntimeKeepFree, config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.keep_free) -Journal.RuntimeMaxFiles, config_parse_uint64, 0, offsetof(Server, runtime_metrics.n_max_files) -Journal.MaxRetentionSec, config_parse_sec, 0, offsetof(Server, max_retention_usec) -Journal.MaxFileSec, config_parse_sec, 0, offsetof(Server, max_file_usec) -Journal.ForwardToSyslog, config_parse_bool, 0, offsetof(Server, forward_to_syslog) -Journal.ForwardToKMsg, config_parse_bool, 0, offsetof(Server, forward_to_kmsg) -Journal.ForwardToConsole, config_parse_bool, 0, offsetof(Server, forward_to_console) -Journal.ForwardToWall, config_parse_bool, 0, offsetof(Server, forward_to_wall) -Journal.TTYPath, config_parse_path, 0, offsetof(Server, tty_path) -Journal.MaxLevelStore, config_parse_log_level, 0, offsetof(Server, max_level_store) -Journal.MaxLevelSyslog, config_parse_log_level, 0, offsetof(Server, max_level_syslog) -Journal.MaxLevelKMsg, config_parse_log_level, 0, offsetof(Server, max_level_kmsg) -Journal.MaxLevelConsole, config_parse_log_level, 0, offsetof(Server, max_level_console) -Journal.MaxLevelWall, config_parse_log_level, 0, offsetof(Server, max_level_wall) -Journal.SplitMode, config_parse_split_mode, 0, offsetof(Server, split_mode) diff --git a/src/grp-journal/libjournal-core/journald-kmsg.c b/src/grp-journal/libjournal-core/journald-kmsg.c deleted file mode 100644 index 946318c184..0000000000 --- a/src/grp-journal/libjournal-core/journald-kmsg.c +++ /dev/null @@ -1,474 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include -#include -#include - -#include -#include - -#include "basic/escape.h" -#include "basic/fd-util.h" -#include "basic/formats-util.h" -#include "basic/io-util.h" -#include "basic/parse-util.h" -#include "basic/process-util.h" -#include "basic/stdio-util.h" -#include "basic/string-util.h" - -#include "journald-kmsg.h" -#include "journald-server.h" -#include "journald-syslog.h" - -void server_forward_kmsg( - Server *s, - int priority, - const char *identifier, - const char *message, - const struct ucred *ucred) { - - struct iovec iovec[5]; - char header_priority[DECIMAL_STR_MAX(priority) + 3], - header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; - int n = 0; - char *ident_buf = NULL; - - assert(s); - assert(priority >= 0); - assert(priority <= 999); - assert(message); - - if (_unlikely_(LOG_PRI(priority) > s->max_level_kmsg)) - return; - - if (_unlikely_(s->dev_kmsg_fd < 0)) - return; - - /* Never allow messages with kernel facility to be written to - * kmsg, regardless where the data comes from. */ - priority = syslog_fixup_facility(priority); - - /* First: priority field */ - xsprintf(header_priority, "<%i>", priority); - IOVEC_SET_STRING(iovec[n++], header_priority); - - /* Second: identifier and PID */ - if (ucred) { - if (!identifier) { - get_process_comm(ucred->pid, &ident_buf); - identifier = ident_buf; - } - - xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); - - if (identifier) - IOVEC_SET_STRING(iovec[n++], identifier); - - IOVEC_SET_STRING(iovec[n++], header_pid); - } else if (identifier) { - IOVEC_SET_STRING(iovec[n++], identifier); - IOVEC_SET_STRING(iovec[n++], ": "); - } - - /* Fourth: message */ - IOVEC_SET_STRING(iovec[n++], message); - IOVEC_SET_STRING(iovec[n++], "\n"); - - if (writev(s->dev_kmsg_fd, iovec, n) < 0) - log_debug_errno(errno, "Failed to write to /dev/kmsg for logging: %m"); - - free(ident_buf); -} - -static bool is_us(const char *pid) { - pid_t t; - - assert(pid); - - if (parse_pid(pid, &t) < 0) - return false; - - return t == getpid(); -} - -static void dev_kmsg_record(Server *s, const char *p, size_t l) { - struct iovec iovec[N_IOVEC_META_FIELDS + 7 + N_IOVEC_KERNEL_FIELDS + 2 + N_IOVEC_UDEV_FIELDS]; - char *message = NULL, *syslog_priority = NULL, *syslog_pid = NULL, *syslog_facility = NULL, *syslog_identifier = NULL, *source_time = NULL; - int priority, r; - unsigned n = 0, z = 0, j; - unsigned long long usec; - char *identifier = NULL, *pid = NULL, *e, *f, *k; - uint64_t serial; - size_t pl; - char *kernel_device = NULL; - - assert(s); - assert(p); - - if (l <= 0) - return; - - e = memchr(p, ',', l); - if (!e) - return; - *e = 0; - - r = safe_atoi(p, &priority); - if (r < 0 || priority < 0 || priority > 999) - return; - - if (s->forward_to_kmsg && (priority & LOG_FACMASK) != LOG_KERN) - return; - - l -= (e - p) + 1; - p = e + 1; - e = memchr(p, ',', l); - if (!e) - return; - *e = 0; - - r = safe_atou64(p, &serial); - if (r < 0) - return; - - if (s->kernel_seqnum) { - /* We already read this one? */ - if (serial < *s->kernel_seqnum) - return; - - /* Did we lose any? */ - if (serial > *s->kernel_seqnum) - server_driver_message(s, SD_MESSAGE_JOURNAL_MISSED, - LOG_MESSAGE("Missed %"PRIu64" kernel messages", - serial - *s->kernel_seqnum), - NULL); - - /* Make sure we never read this one again. Note that - * we always store the next message serial we expect - * here, simply because this makes handling the first - * message with serial 0 easy. */ - *s->kernel_seqnum = serial + 1; - } - - l -= (e - p) + 1; - p = e + 1; - f = memchr(p, ';', l); - if (!f) - return; - /* Kernel 3.6 has the flags field, kernel 3.5 lacks that */ - e = memchr(p, ',', l); - if (!e || f < e) - e = f; - *e = 0; - - r = safe_atollu(p, &usec); - if (r < 0) - return; - - l -= (f - p) + 1; - p = f + 1; - e = memchr(p, '\n', l); - if (!e) - return; - *e = 0; - - pl = e - p; - l -= (e - p) + 1; - k = e + 1; - - for (j = 0; l > 0 && j < N_IOVEC_KERNEL_FIELDS; j++) { - char *m; - /* Metadata fields attached */ - - if (*k != ' ') - break; - - k++, l--; - - e = memchr(k, '\n', l); - if (!e) - return; - - *e = 0; - - if (cunescape_length_with_prefix(k, e - k, "_KERNEL_", UNESCAPE_RELAX, &m) < 0) - break; - - if (startswith(m, "_KERNEL_DEVICE=")) - kernel_device = m + 15; - - IOVEC_SET_STRING(iovec[n++], m); - z++; - - l -= (e - k) + 1; - k = e + 1; - } - - if (kernel_device) { - struct udev_device *ud; - - ud = udev_device_new_from_device_id(s->udev, kernel_device); - if (ud) { - const char *g; - struct udev_list_entry *ll; - char *b; - - g = udev_device_get_devnode(ud); - if (g) { - b = strappend("_UDEV_DEVNODE=", g); - if (b) { - IOVEC_SET_STRING(iovec[n++], b); - z++; - } - } - - g = udev_device_get_sysname(ud); - if (g) { - b = strappend("_UDEV_SYSNAME=", g); - if (b) { - IOVEC_SET_STRING(iovec[n++], b); - z++; - } - } - - j = 0; - ll = udev_device_get_devlinks_list_entry(ud); - udev_list_entry_foreach(ll, ll) { - - if (j > N_IOVEC_UDEV_FIELDS) - break; - - g = udev_list_entry_get_name(ll); - if (g) { - b = strappend("_UDEV_DEVLINK=", g); - if (b) { - IOVEC_SET_STRING(iovec[n++], b); - z++; - } - } - - j++; - } - - udev_device_unref(ud); - } - } - - if (asprintf(&source_time, "_SOURCE_MONOTONIC_TIMESTAMP=%llu", usec) >= 0) - IOVEC_SET_STRING(iovec[n++], source_time); - - IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=kernel"); - - if (asprintf(&syslog_priority, "PRIORITY=%i", priority & LOG_PRIMASK) >= 0) - IOVEC_SET_STRING(iovec[n++], syslog_priority); - - if (asprintf(&syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)) >= 0) - IOVEC_SET_STRING(iovec[n++], syslog_facility); - - if ((priority & LOG_FACMASK) == LOG_KERN) - IOVEC_SET_STRING(iovec[n++], "SYSLOG_IDENTIFIER=kernel"); - else { - pl -= syslog_parse_identifier((const char**) &p, &identifier, &pid); - - /* Avoid any messages we generated ourselves via - * log_info() and friends. */ - if (pid && is_us(pid)) - goto finish; - - if (identifier) { - syslog_identifier = strappend("SYSLOG_IDENTIFIER=", identifier); - if (syslog_identifier) - IOVEC_SET_STRING(iovec[n++], syslog_identifier); - } - - if (pid) { - syslog_pid = strappend("SYSLOG_PID=", pid); - if (syslog_pid) - IOVEC_SET_STRING(iovec[n++], syslog_pid); - } - } - - if (cunescape_length_with_prefix(p, pl, "MESSAGE=", UNESCAPE_RELAX, &message) >= 0) - IOVEC_SET_STRING(iovec[n++], message); - - server_dispatch_message(s, iovec, n, ELEMENTSOF(iovec), NULL, NULL, NULL, 0, NULL, priority, 0); - -finish: - for (j = 0; j < z; j++) - free(iovec[j].iov_base); - - free(message); - free(syslog_priority); - free(syslog_identifier); - free(syslog_pid); - free(syslog_facility); - free(source_time); - free(identifier); - free(pid); -} - -static int server_read_dev_kmsg(Server *s) { - char buffer[8192+1]; /* the kernel-side limit per record is 8K currently */ - ssize_t l; - - assert(s); - assert(s->dev_kmsg_fd >= 0); - - l = read(s->dev_kmsg_fd, buffer, sizeof(buffer) - 1); - if (l == 0) - return 0; - if (l < 0) { - /* Old kernels who don't allow reading from /dev/kmsg - * return EINVAL when we try. So handle this cleanly, - * but don' try to ever read from it again. */ - if (errno == EINVAL) { - s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source); - return 0; - } - - if (errno == EAGAIN || errno == EINTR || errno == EPIPE) - return 0; - - return log_error_errno(errno, "Failed to read from kernel: %m"); - } - - dev_kmsg_record(s, buffer, l); - return 1; -} - -int server_flush_dev_kmsg(Server *s) { - int r; - - assert(s); - - if (s->dev_kmsg_fd < 0) - return 0; - - if (!s->dev_kmsg_readable) - return 0; - - log_debug("Flushing /dev/kmsg..."); - - for (;;) { - r = server_read_dev_kmsg(s); - if (r < 0) - return r; - - if (r == 0) - break; - } - - return 0; -} - -static int dispatch_dev_kmsg(sd_event_source *es, int fd, uint32_t revents, void *userdata) { - Server *s = userdata; - - assert(es); - assert(fd == s->dev_kmsg_fd); - assert(s); - - if (revents & EPOLLERR) - log_warning("/dev/kmsg buffer overrun, some messages lost."); - - if (!(revents & EPOLLIN)) - log_error("Got invalid event from epoll for /dev/kmsg: %"PRIx32, revents); - - return server_read_dev_kmsg(s); -} - -int server_open_dev_kmsg(Server *s) { - int r; - - assert(s); - - s->dev_kmsg_fd = open("/dev/kmsg", O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); - if (s->dev_kmsg_fd < 0) { - log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, - "Failed to open /dev/kmsg, ignoring: %m"); - return 0; - } - - r = sd_event_add_io(s->event, &s->dev_kmsg_event_source, s->dev_kmsg_fd, EPOLLIN, dispatch_dev_kmsg, s); - if (r < 0) { - - /* This will fail with EPERM on older kernels where - * /dev/kmsg is not readable. */ - if (r == -EPERM) { - r = 0; - goto fail; - } - - log_error_errno(r, "Failed to add /dev/kmsg fd to event loop: %m"); - goto fail; - } - - r = sd_event_source_set_priority(s->dev_kmsg_event_source, SD_EVENT_PRIORITY_IMPORTANT+10); - if (r < 0) { - log_error_errno(r, "Failed to adjust priority of kmsg event source: %m"); - goto fail; - } - - s->dev_kmsg_readable = true; - - return 0; - -fail: - s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source); - s->dev_kmsg_fd = safe_close(s->dev_kmsg_fd); - - return r; -} - -int server_open_kernel_seqnum(Server *s) { - _cleanup_close_ int fd; - uint64_t *p; - int r; - - assert(s); - - /* We store the seqnum we last read in an mmaped file. That - * way we can just use it like a variable, but it is - * persistent and automatically flushed at reboot. */ - - fd = open("/run/systemd/journal/kernel-seqnum", O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, 0644); - if (fd < 0) { - log_error_errno(errno, "Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); - return 0; - } - - r = posix_fallocate(fd, 0, sizeof(uint64_t)); - if (r != 0) { - log_error_errno(r, "Failed to allocate sequential number file, ignoring: %m"); - return 0; - } - - p = mmap(NULL, sizeof(uint64_t), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - if (p == MAP_FAILED) { - log_error_errno(errno, "Failed to map sequential number file, ignoring: %m"); - return 0; - } - - s->kernel_seqnum = p; - - return 0; -} diff --git a/src/grp-journal/libjournal-core/journald-kmsg.h b/src/grp-journal/libjournal-core/journald-kmsg.h deleted file mode 100644 index dab49f1e8c..0000000000 --- a/src/grp-journal/libjournal-core/journald-kmsg.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "journald-server.h" - -int server_open_dev_kmsg(Server *s); -int server_flush_dev_kmsg(Server *s); - -void server_forward_kmsg(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred); - -int server_open_kernel_seqnum(Server *s); diff --git a/src/grp-journal/libjournal-core/journald-native.c b/src/grp-journal/libjournal-core/journald-native.c deleted file mode 100644 index 9bfea935ad..0000000000 --- a/src/grp-journal/libjournal-core/journald-native.c +++ /dev/null @@ -1,502 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include -#include -#include - -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/fs-util.h" -#include "basic/io-util.h" -#include "basic/memfd-util.h" -#include "basic/parse-util.h" -#include "basic/path-util.h" -#include "basic/selinux-util.h" -#include "basic/socket-util.h" -#include "basic/string-util.h" - -#include "journald-console.h" -#include "journald-kmsg.h" -#include "journald-native.h" -#include "journald-server.h" -#include "journald-syslog.h" -#include "journald-wall.h" - -bool valid_user_field(const char *p, size_t l, bool allow_protected) { - const char *a; - - /* We kinda enforce POSIX syntax recommendations for - environment variables here, but make a couple of additional - requirements. - - http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html */ - - /* No empty field names */ - if (l <= 0) - return false; - - /* Don't allow names longer than 64 chars */ - if (l > 64) - return false; - - /* Variables starting with an underscore are protected */ - if (!allow_protected && p[0] == '_') - return false; - - /* Don't allow digits as first character */ - if (p[0] >= '0' && p[0] <= '9') - return false; - - /* Only allow A-Z0-9 and '_' */ - for (a = p; a < p + l; a++) - if ((*a < 'A' || *a > 'Z') && - (*a < '0' || *a > '9') && - *a != '_') - return false; - - return true; -} - -static bool allow_object_pid(const struct ucred *ucred) { - return ucred && ucred->uid == 0; -} - -void server_process_native_message( - Server *s, - const void *buffer, size_t buffer_size, - const struct ucred *ucred, - const struct timeval *tv, - const char *label, size_t label_len) { - - struct iovec *iovec = NULL; - unsigned n = 0, j, tn = (unsigned) -1; - const char *p; - size_t remaining, m = 0, entry_size = 0; - int priority = LOG_INFO; - char *identifier = NULL, *message = NULL; - pid_t object_pid = 0; - - assert(s); - assert(buffer || buffer_size == 0); - - p = buffer; - remaining = buffer_size; - - while (remaining > 0) { - const char *e, *q; - - e = memchr(p, '\n', remaining); - - if (!e) { - /* Trailing noise, let's ignore it, and flush what we collected */ - log_debug("Received message with trailing noise, ignoring."); - break; - } - - if (e == p) { - /* Entry separator */ - - if (entry_size + n + 1 > ENTRY_SIZE_MAX) { /* data + separators + trailer */ - log_debug("Entry is too big with %u properties and %zu bytes, ignoring.", n, entry_size); - continue; - } - - server_dispatch_message(s, iovec, n, m, ucred, tv, label, label_len, NULL, priority, object_pid); - n = 0; - priority = LOG_INFO; - entry_size = 0; - - p++; - remaining--; - continue; - } - - if (*p == '.' || *p == '#') { - /* Ignore control commands for now, and - * comments too. */ - remaining -= (e - p) + 1; - p = e + 1; - continue; - } - - /* A property follows */ - - /* n existing properties, 1 new, +1 for _TRANSPORT */ - if (!GREEDY_REALLOC(iovec, m, n + 2 + N_IOVEC_META_FIELDS + N_IOVEC_OBJECT_FIELDS)) { - log_oom(); - break; - } - - q = memchr(p, '=', e - p); - if (q) { - if (valid_user_field(p, q - p, false)) { - size_t l; - - l = e - p; - - /* If the field name starts with an - * underscore, skip the variable, - * since that indidates a trusted - * field */ - iovec[n].iov_base = (char*) p; - iovec[n].iov_len = l; - entry_size += iovec[n].iov_len; - n++; - - /* We need to determine the priority - * of this entry for the rate limiting - * logic */ - if (l == 10 && - startswith(p, "PRIORITY=") && - p[9] >= '0' && p[9] <= '9') - priority = (priority & LOG_FACMASK) | (p[9] - '0'); - - else if (l == 17 && - startswith(p, "SYSLOG_FACILITY=") && - p[16] >= '0' && p[16] <= '9') - priority = (priority & LOG_PRIMASK) | ((p[16] - '0') << 3); - - else if (l == 18 && - startswith(p, "SYSLOG_FACILITY=") && - p[16] >= '0' && p[16] <= '9' && - p[17] >= '0' && p[17] <= '9') - priority = (priority & LOG_PRIMASK) | (((p[16] - '0')*10 + (p[17] - '0')) << 3); - - else if (l >= 19 && - startswith(p, "SYSLOG_IDENTIFIER=")) { - char *t; - - t = strndup(p + 18, l - 18); - if (t) { - free(identifier); - identifier = t; - } - - } else if (l >= 8 && - startswith(p, "MESSAGE=")) { - char *t; - - t = strndup(p + 8, l - 8); - if (t) { - free(message); - message = t; - } - - } else if (l > strlen("OBJECT_PID=") && - l < strlen("OBJECT_PID=") + DECIMAL_STR_MAX(pid_t) && - startswith(p, "OBJECT_PID=") && - allow_object_pid(ucred)) { - char buf[DECIMAL_STR_MAX(pid_t)]; - memcpy(buf, p + strlen("OBJECT_PID="), l - strlen("OBJECT_PID=")); - buf[l-strlen("OBJECT_PID=")] = '\0'; - - /* ignore error */ - parse_pid(buf, &object_pid); - } - } - - remaining -= (e - p) + 1; - p = e + 1; - continue; - } else { - le64_t l_le; - uint64_t l; - char *k; - - if (remaining < e - p + 1 + sizeof(uint64_t) + 1) { - log_debug("Failed to parse message, ignoring."); - break; - } - - memcpy(&l_le, e + 1, sizeof(uint64_t)); - l = le64toh(l_le); - - if (l > DATA_SIZE_MAX) { - log_debug("Received binary data block of %"PRIu64" bytes is too large, ignoring.", l); - break; - } - - if ((uint64_t) remaining < e - p + 1 + sizeof(uint64_t) + l + 1 || - e[1+sizeof(uint64_t)+l] != '\n') { - log_debug("Failed to parse message, ignoring."); - break; - } - - k = malloc((e - p) + 1 + l); - if (!k) { - log_oom(); - break; - } - - memcpy(k, p, e - p); - k[e - p] = '='; - memcpy(k + (e - p) + 1, e + 1 + sizeof(uint64_t), l); - - if (valid_user_field(p, e - p, false)) { - iovec[n].iov_base = k; - iovec[n].iov_len = (e - p) + 1 + l; - entry_size += iovec[n].iov_len; - n++; - } else - free(k); - - remaining -= (e - p) + 1 + sizeof(uint64_t) + l + 1; - p = e + 1 + sizeof(uint64_t) + l + 1; - } - } - - if (n <= 0) - goto finish; - - tn = n++; - IOVEC_SET_STRING(iovec[tn], "_TRANSPORT=journal"); - entry_size += strlen("_TRANSPORT=journal"); - - if (entry_size + n + 1 > ENTRY_SIZE_MAX) { /* data + separators + trailer */ - log_debug("Entry is too big with %u properties and %zu bytes, ignoring.", - n, entry_size); - goto finish; - } - - if (message) { - if (s->forward_to_syslog) - server_forward_syslog(s, priority, identifier, message, ucred, tv); - - if (s->forward_to_kmsg) - server_forward_kmsg(s, priority, identifier, message, ucred); - - if (s->forward_to_console) - server_forward_console(s, priority, identifier, message, ucred); - - if (s->forward_to_wall) - server_forward_wall(s, priority, identifier, message, ucred); - } - - server_dispatch_message(s, iovec, n, m, ucred, tv, label, label_len, NULL, priority, object_pid); - -finish: - for (j = 0; j < n; j++) { - if (j == tn) - continue; - - if (iovec[j].iov_base < buffer || - (const uint8_t*) iovec[j].iov_base >= (const uint8_t*) buffer + buffer_size) - free(iovec[j].iov_base); - } - - free(iovec); - free(identifier); - free(message); -} - -void server_process_native_file( - Server *s, - int fd, - const struct ucred *ucred, - const struct timeval *tv, - const char *label, size_t label_len) { - - struct stat st; - bool sealed; - int r; - - /* Data is in the passed fd, since it didn't fit in a - * datagram. */ - - assert(s); - assert(fd >= 0); - - /* If it's a memfd, check if it is sealed. If so, we can just - * use map it and use it, and do not need to copy the data - * out. */ - sealed = memfd_get_sealed(fd) > 0; - - if (!sealed && (!ucred || ucred->uid != 0)) { - _cleanup_free_ char *sl = NULL, *k = NULL; - const char *e; - - /* If this is not a sealed memfd, and the peer is unknown or - * unprivileged, then verify the path. */ - - if (asprintf(&sl, "/proc/self/fd/%i", fd) < 0) { - log_oom(); - return; - } - - r = readlink_malloc(sl, &k); - if (r < 0) { - log_error_errno(r, "readlink(%s) failed: %m", sl); - return; - } - - e = path_startswith(k, "/dev/shm/"); - if (!e) - e = path_startswith(k, "/tmp/"); - if (!e) - e = path_startswith(k, "/var/tmp/"); - if (!e) { - log_error("Received file outside of allowed directories. Refusing."); - return; - } - - if (!filename_is_valid(e)) { - log_error("Received file in subdirectory of allowed directories. Refusing."); - return; - } - } - - if (fstat(fd, &st) < 0) { - log_error_errno(errno, "Failed to stat passed file, ignoring: %m"); - return; - } - - if (!S_ISREG(st.st_mode)) { - log_error("File passed is not regular. Ignoring."); - return; - } - - if (st.st_size <= 0) - return; - - if (st.st_size > ENTRY_SIZE_MAX) { - log_error("File passed too large. Ignoring."); - return; - } - - if (sealed) { - void *p; - size_t ps; - - /* The file is sealed, we can just map it and use it. */ - - ps = PAGE_ALIGN(st.st_size); - p = mmap(NULL, ps, PROT_READ, MAP_PRIVATE, fd, 0); - if (p == MAP_FAILED) { - log_error_errno(errno, "Failed to map memfd, ignoring: %m"); - return; - } - - server_process_native_message(s, p, st.st_size, ucred, tv, label, label_len); - assert_se(munmap(p, ps) >= 0); - } else { - _cleanup_free_ void *p = NULL; - struct statvfs vfs; - ssize_t n; - - if (fstatvfs(fd, &vfs) < 0) { - log_error_errno(errno, "Failed to stat file system of passed file, ignoring: %m"); - return; - } - - /* Refuse operating on file systems that have - * mandatory locking enabled, see: - * - * https://github.com/systemd/systemd/issues/1822 - */ - if (vfs.f_flag & ST_MANDLOCK) { - log_error("Received file descriptor from file system with mandatory locking enable, refusing."); - return; - } - - /* Make the fd non-blocking. On regular files this has - * the effect of bypassing mandatory locking. Of - * course, this should normally not be necessary given - * the check above, but let's better be safe than - * sorry, after all NFS is pretty confusing regarding - * file system flags, and we better don't trust it, - * and so is SMB. */ - r = fd_nonblock(fd, true); - if (r < 0) { - log_error_errno(r, "Failed to make fd non-blocking, ignoring: %m"); - return; - } - - /* The file is not sealed, we can't map the file here, since - * clients might then truncate it and trigger a SIGBUS for - * us. So let's stupidly read it */ - - p = malloc(st.st_size); - if (!p) { - log_oom(); - return; - } - - n = pread(fd, p, st.st_size, 0); - if (n < 0) - log_error_errno(errno, "Failed to read file, ignoring: %m"); - else if (n > 0) - server_process_native_message(s, p, n, ucred, tv, label, label_len); - } -} - -int server_open_native_socket(Server*s) { - - static const union sockaddr_union sa = { - .un.sun_family = AF_UNIX, - .un.sun_path = "/run/systemd/journal/socket", - }; - static const int one = 1; - int r; - - assert(s); - - if (s->native_fd < 0) { - s->native_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); - if (s->native_fd < 0) - return log_error_errno(errno, "socket() failed: %m"); - - (void) unlink(sa.un.sun_path); - - r = bind(s->native_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); - if (r < 0) - return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path); - - (void) chmod(sa.un.sun_path, 0666); - } else - fd_nonblock(s->native_fd, 1); - - r = setsockopt(s->native_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); - if (r < 0) - return log_error_errno(errno, "SO_PASSCRED failed: %m"); - -#ifdef HAVE_SELINUX - if (mac_selinux_have()) { - r = setsockopt(s->native_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one)); - if (r < 0) - log_warning_errno(errno, "SO_PASSSEC failed: %m"); - } -#endif - - r = setsockopt(s->native_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)); - if (r < 0) - return log_error_errno(errno, "SO_TIMESTAMP failed: %m"); - - r = sd_event_add_io(s->event, &s->native_event_source, s->native_fd, EPOLLIN, server_process_datagram, s); - if (r < 0) - return log_error_errno(r, "Failed to add native server fd to event loop: %m"); - - r = sd_event_source_set_priority(s->native_event_source, SD_EVENT_PRIORITY_NORMAL+5); - if (r < 0) - return log_error_errno(r, "Failed to adjust native event source priority: %m"); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/journald-native.h b/src/grp-journal/libjournal-core/journald-native.h deleted file mode 100644 index c13b80aa4f..0000000000 --- a/src/grp-journal/libjournal-core/journald-native.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "journald-server.h" - -/* Make sure not to make this smaller than the maximum coredump - * size. See COREDUMP_MAX in coredump.c */ -#define ENTRY_SIZE_MAX (1024*1024*770u) -#define DATA_SIZE_MAX (1024*1024*768u) - -bool valid_user_field(const char *p, size_t l, bool allow_protected); - -void server_process_native_message(Server *s, const void *buffer, size_t buffer_size, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); - -void server_process_native_file(Server *s, int fd, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); - -int server_open_native_socket(Server*s); diff --git a/src/grp-journal/libjournal-core/journald-rate-limit.c b/src/grp-journal/libjournal-core/journald-rate-limit.c deleted file mode 100644 index 22603bf8e6..0000000000 --- a/src/grp-journal/libjournal-core/journald-rate-limit.c +++ /dev/null @@ -1,272 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#include "basic/alloc-util.h" -#include "basic/hashmap.h" -#include "basic/list.h" -#include "basic/random-util.h" -#include "basic/string-util.h" -#include "basic/util.h" - -#include "journald-rate-limit.h" - -#define POOLS_MAX 5 -#define BUCKETS_MAX 127 -#define GROUPS_MAX 2047 - -static const int priority_map[] = { - [LOG_EMERG] = 0, - [LOG_ALERT] = 0, - [LOG_CRIT] = 0, - [LOG_ERR] = 1, - [LOG_WARNING] = 2, - [LOG_NOTICE] = 3, - [LOG_INFO] = 3, - [LOG_DEBUG] = 4 -}; - -typedef struct JournalRateLimitPool JournalRateLimitPool; -typedef struct JournalRateLimitGroup JournalRateLimitGroup; - -struct JournalRateLimitPool { - usec_t begin; - unsigned num; - unsigned suppressed; -}; - -struct JournalRateLimitGroup { - JournalRateLimit *parent; - - char *id; - JournalRateLimitPool pools[POOLS_MAX]; - uint64_t hash; - - LIST_FIELDS(JournalRateLimitGroup, bucket); - LIST_FIELDS(JournalRateLimitGroup, lru); -}; - -struct JournalRateLimit { - usec_t interval; - unsigned burst; - - JournalRateLimitGroup* buckets[BUCKETS_MAX]; - JournalRateLimitGroup *lru, *lru_tail; - - unsigned n_groups; - - uint8_t hash_key[16]; -}; - -JournalRateLimit *journal_rate_limit_new(usec_t interval, unsigned burst) { - JournalRateLimit *r; - - assert(interval > 0 || burst == 0); - - r = new0(JournalRateLimit, 1); - if (!r) - return NULL; - - r->interval = interval; - r->burst = burst; - - random_bytes(r->hash_key, sizeof(r->hash_key)); - - return r; -} - -static void journal_rate_limit_group_free(JournalRateLimitGroup *g) { - assert(g); - - if (g->parent) { - assert(g->parent->n_groups > 0); - - if (g->parent->lru_tail == g) - g->parent->lru_tail = g->lru_prev; - - LIST_REMOVE(lru, g->parent->lru, g); - LIST_REMOVE(bucket, g->parent->buckets[g->hash % BUCKETS_MAX], g); - - g->parent->n_groups--; - } - - free(g->id); - free(g); -} - -void journal_rate_limit_free(JournalRateLimit *r) { - assert(r); - - while (r->lru) - journal_rate_limit_group_free(r->lru); - - free(r); -} - -_pure_ static bool journal_rate_limit_group_expired(JournalRateLimitGroup *g, usec_t ts) { - unsigned i; - - assert(g); - - for (i = 0; i < POOLS_MAX; i++) - if (g->pools[i].begin + g->parent->interval >= ts) - return false; - - return true; -} - -static void journal_rate_limit_vacuum(JournalRateLimit *r, usec_t ts) { - assert(r); - - /* Makes room for at least one new item, but drop all - * expored items too. */ - - while (r->n_groups >= GROUPS_MAX || - (r->lru_tail && journal_rate_limit_group_expired(r->lru_tail, ts))) - journal_rate_limit_group_free(r->lru_tail); -} - -static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r, const char *id, usec_t ts) { - JournalRateLimitGroup *g; - struct siphash state; - - assert(r); - assert(id); - - g = new0(JournalRateLimitGroup, 1); - if (!g) - return NULL; - - g->id = strdup(id); - if (!g->id) - goto fail; - - siphash24_init(&state, r->hash_key); - string_hash_func(g->id, &state); - g->hash = siphash24_finalize(&state); - - journal_rate_limit_vacuum(r, ts); - - LIST_PREPEND(bucket, r->buckets[g->hash % BUCKETS_MAX], g); - LIST_PREPEND(lru, r->lru, g); - if (!g->lru_next) - r->lru_tail = g; - r->n_groups++; - - g->parent = r; - return g; - -fail: - journal_rate_limit_group_free(g); - return NULL; -} - -static unsigned burst_modulate(unsigned burst, uint64_t available) { - unsigned k; - - /* Modulates the burst rate a bit with the amount of available - * disk space */ - - k = u64log2(available); - - /* 1MB */ - if (k <= 20) - return burst; - - burst = (burst * (k-20)) / 4; - - /* - * Example: - * - * <= 1MB = rate * 1 - * 16MB = rate * 2 - * 256MB = rate * 3 - * 4GB = rate * 4 - * 64GB = rate * 5 - * 1TB = rate * 6 - */ - - return burst; -} - -int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, uint64_t available) { - uint64_t h; - JournalRateLimitGroup *g; - JournalRateLimitPool *p; - struct siphash state; - unsigned burst; - usec_t ts; - - assert(id); - - if (!r) - return 1; - - if (r->interval == 0 || r->burst == 0) - return 1; - - burst = burst_modulate(r->burst, available); - - ts = now(CLOCK_MONOTONIC); - - siphash24_init(&state, r->hash_key); - string_hash_func(id, &state); - h = siphash24_finalize(&state); - g = r->buckets[h % BUCKETS_MAX]; - - LIST_FOREACH(bucket, g, g) - if (streq(g->id, id)) - break; - - if (!g) { - g = journal_rate_limit_group_new(r, id, ts); - if (!g) - return -ENOMEM; - } - - p = &g->pools[priority_map[priority]]; - - if (p->begin <= 0) { - p->suppressed = 0; - p->num = 1; - p->begin = ts; - return 1; - } - - if (p->begin + r->interval < ts) { - unsigned s; - - s = p->suppressed; - p->suppressed = 0; - p->num = 1; - p->begin = ts; - - return 1 + s; - } - - if (p->num <= burst) { - p->num++; - return 1; - } - - p->suppressed++; - return 0; -} diff --git a/src/grp-journal/libjournal-core/journald-rate-limit.h b/src/grp-journal/libjournal-core/journald-rate-limit.h deleted file mode 100644 index 533dd0f013..0000000000 --- a/src/grp-journal/libjournal-core/journald-rate-limit.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "basic/util.h" - -typedef struct JournalRateLimit JournalRateLimit; - -JournalRateLimit *journal_rate_limit_new(usec_t interval, unsigned burst); -void journal_rate_limit_free(JournalRateLimit *r); -int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, uint64_t available); diff --git a/src/grp-journal/libjournal-core/journald-server.c b/src/grp-journal/libjournal-core/journald-server.c deleted file mode 100644 index c314b74ac2..0000000000 --- a/src/grp-journal/libjournal-core/journald-server.c +++ /dev/null @@ -1,2009 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#ifdef HAVE_SELINUX -#include -#endif -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include "basic/alloc-util.h" -#include "basic/audit-util.h" -#include "basic/cgroup-util.h" -#include "basic/dirent-util.h" -#include "basic/extract-word.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/formats-util.h" -#include "basic/fs-util.h" -#include "basic/hashmap.h" -#include "basic/hostname-util.h" -#include "basic/io-util.h" -#include "basic/log.h" -#include "basic/missing.h" -#include "basic/mkdir.h" -#include "basic/parse-util.h" -#include "basic/proc-cmdline.h" -#include "basic/process-util.h" -#include "basic/rm-rf.h" -#include "basic/selinux-util.h" -#include "basic/signal-util.h" -#include "basic/socket-util.h" -#include "basic/stdio-util.h" -#include "basic/string-table.h" -#include "basic/string-util.h" -#include "basic/user-util.h" -#include "sd-journal/journal-authenticate.h" -#include "sd-journal/journal-file.h" -#include "sd-journal/journal-internal.h" -#include "sd-journal/journal-vacuum.h" -#include "shared/acl-util.h" -#include "shared/conf-parser.h" - -#include "journald-audit.h" -#include "journald-kmsg.h" -#include "journald-native.h" -#include "journald-rate-limit.h" -#include "journald-server.h" -#include "journald-stream.h" -#include "journald-syslog.h" - -#define USER_JOURNALS_MAX 1024 - -#define DEFAULT_SYNC_INTERVAL_USEC (5*USEC_PER_MINUTE) -#define DEFAULT_RATE_LIMIT_INTERVAL (30*USEC_PER_SEC) -#define DEFAULT_RATE_LIMIT_BURST 1000 -#define DEFAULT_MAX_FILE_USEC USEC_PER_MONTH - -#define RECHECK_SPACE_USEC (30*USEC_PER_SEC) - -#define NOTIFY_SNDBUF_SIZE (8*1024*1024) - -/* The period to insert between posting changes for coalescing */ -#define POST_CHANGE_TIMER_INTERVAL_USEC (250*USEC_PER_MSEC) - -static int determine_space_for( - Server *s, - JournalMetrics *metrics, - const char *path, - const char *name, - bool verbose, - bool patch_min_use, - uint64_t *available, - uint64_t *limit) { - - uint64_t sum = 0, ss_avail, avail; - _cleanup_closedir_ DIR *d = NULL; - struct dirent *de; - struct statvfs ss; - const char *p; - usec_t ts; - - assert(s); - assert(metrics); - assert(path); - assert(name); - - ts = now(CLOCK_MONOTONIC); - - if (!verbose && s->cached_space_timestamp + RECHECK_SPACE_USEC > ts) { - - if (available) - *available = s->cached_space_available; - if (limit) - *limit = s->cached_space_limit; - - return 0; - } - - p = strjoina(path, SERVER_MACHINE_ID(s)); - d = opendir(p); - if (!d) - return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, "Failed to open %s: %m", p); - - if (fstatvfs(dirfd(d), &ss) < 0) - return log_error_errno(errno, "Failed to fstatvfs(%s): %m", p); - - FOREACH_DIRENT_ALL(de, d, break) { - struct stat st; - - if (!endswith(de->d_name, ".journal") && - !endswith(de->d_name, ".journal~")) - continue; - - if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { - log_debug_errno(errno, "Failed to stat %s/%s, ignoring: %m", p, de->d_name); - continue; - } - - if (!S_ISREG(st.st_mode)) - continue; - - sum += (uint64_t) st.st_blocks * 512UL; - } - - /* If requested, then let's bump the min_use limit to the - * current usage on disk. We do this when starting up and - * first opening the journal files. This way sudden spikes in - * disk usage will not cause journald to vacuum files without - * bounds. Note that this means that only a restart of - * journald will make it reset this value. */ - - if (patch_min_use) - metrics->min_use = MAX(metrics->min_use, sum); - - ss_avail = ss.f_bsize * ss.f_bavail; - avail = LESS_BY(ss_avail, metrics->keep_free); - - s->cached_space_limit = MIN(MAX(sum + avail, metrics->min_use), metrics->max_use); - s->cached_space_available = LESS_BY(s->cached_space_limit, sum); - s->cached_space_timestamp = ts; - - if (verbose) { - char fb1[FORMAT_BYTES_MAX], fb2[FORMAT_BYTES_MAX], fb3[FORMAT_BYTES_MAX], - fb4[FORMAT_BYTES_MAX], fb5[FORMAT_BYTES_MAX], fb6[FORMAT_BYTES_MAX]; - format_bytes(fb1, sizeof(fb1), sum); - format_bytes(fb2, sizeof(fb2), metrics->max_use); - format_bytes(fb3, sizeof(fb3), metrics->keep_free); - format_bytes(fb4, sizeof(fb4), ss_avail); - format_bytes(fb5, sizeof(fb5), s->cached_space_limit); - format_bytes(fb6, sizeof(fb6), s->cached_space_available); - - server_driver_message(s, SD_MESSAGE_JOURNAL_USAGE, - LOG_MESSAGE("%s (%s) is %s, max %s, %s free.", - name, path, fb1, fb5, fb6), - "JOURNAL_NAME=%s", name, - "JOURNAL_PATH=%s", path, - "CURRENT_USE=%"PRIu64, sum, - "CURRENT_USE_PRETTY=%s", fb1, - "MAX_USE=%"PRIu64, metrics->max_use, - "MAX_USE_PRETTY=%s", fb2, - "DISK_KEEP_FREE=%"PRIu64, metrics->keep_free, - "DISK_KEEP_FREE_PRETTY=%s", fb3, - "DISK_AVAILABLE=%"PRIu64, ss_avail, - "DISK_AVAILABLE_PRETTY=%s", fb4, - "LIMIT=%"PRIu64, s->cached_space_limit, - "LIMIT_PRETTY=%s", fb5, - "AVAILABLE=%"PRIu64, s->cached_space_available, - "AVAILABLE_PRETTY=%s", fb6, - NULL); - } - - if (available) - *available = s->cached_space_available; - if (limit) - *limit = s->cached_space_limit; - - return 1; -} - -static int determine_space(Server *s, bool verbose, bool patch_min_use, uint64_t *available, uint64_t *limit) { - JournalMetrics *metrics; - const char *path, *name; - - assert(s); - - if (s->system_journal) { - path = "/var/log/journal/"; - metrics = &s->system_metrics; - name = "System journal"; - } else { - path = "/run/log/journal/"; - metrics = &s->runtime_metrics; - name = "Runtime journal"; - } - - return determine_space_for(s, metrics, path, name, verbose, patch_min_use, available, limit); -} - -static void server_add_acls(JournalFile *f, uid_t uid) { -#ifdef HAVE_ACL - int r; -#endif - assert(f); - -#ifdef HAVE_ACL - if (uid <= SYSTEM_UID_MAX) - return; - - r = add_acls_for_user(f->fd, uid); - if (r < 0) - log_warning_errno(r, "Failed to set ACL on %s, ignoring: %m", f->path); -#endif -} - -static int open_journal( - Server *s, - bool reliably, - const char *fname, - int flags, - bool seal, - JournalMetrics *metrics, - JournalFile **ret) { - int r; - JournalFile *f; - - assert(s); - assert(fname); - assert(ret); - - if (reliably) - r = journal_file_open_reliably(fname, flags, 0640, s->compress, seal, metrics, s->mmap, s->deferred_closes, NULL, &f); - else - r = journal_file_open(-1, fname, flags, 0640, s->compress, seal, metrics, s->mmap, s->deferred_closes, NULL, &f); - if (r < 0) - return r; - - r = journal_file_enable_post_change_timer(f, s->event, POST_CHANGE_TIMER_INTERVAL_USEC); - if (r < 0) { - (void) journal_file_close(f); - return r; - } - - *ret = f; - return r; -} - -static JournalFile* find_journal(Server *s, uid_t uid) { - _cleanup_free_ char *p = NULL; - int r; - JournalFile *f; - sd_id128_t machine; - - assert(s); - - /* We split up user logs only on /var, not on /run. If the - * runtime file is open, we write to it exclusively, in order - * to guarantee proper order as soon as we flush /run to - * /var and close the runtime file. */ - - if (s->runtime_journal) - return s->runtime_journal; - - if (uid <= SYSTEM_UID_MAX) - return s->system_journal; - - r = sd_id128_get_machine(&machine); - if (r < 0) - return s->system_journal; - - f = ordered_hashmap_get(s->user_journals, UID_TO_PTR(uid)); - if (f) - return f; - - if (asprintf(&p, "/var/log/journal/" SD_ID128_FORMAT_STR "/user-"UID_FMT".journal", - SD_ID128_FORMAT_VAL(machine), uid) < 0) - return s->system_journal; - - while (ordered_hashmap_size(s->user_journals) >= USER_JOURNALS_MAX) { - /* Too many open? Then let's close one */ - f = ordered_hashmap_steal_first(s->user_journals); - assert(f); - (void) journal_file_close(f); - } - - r = open_journal(s, true, p, O_RDWR|O_CREAT, s->seal, &s->system_metrics, &f); - if (r < 0) - return s->system_journal; - - server_add_acls(f, uid); - - r = ordered_hashmap_put(s->user_journals, UID_TO_PTR(uid), f); - if (r < 0) { - (void) journal_file_close(f); - return s->system_journal; - } - - return f; -} - -static int do_rotate( - Server *s, - JournalFile **f, - const char* name, - bool seal, - uint32_t uid) { - - int r; - assert(s); - - if (!*f) - return -EINVAL; - - r = journal_file_rotate(f, s->compress, seal, s->deferred_closes); - if (r < 0) - if (*f) - log_error_errno(r, "Failed to rotate %s: %m", (*f)->path); - else - log_error_errno(r, "Failed to create new %s journal: %m", name); - else - server_add_acls(*f, uid); - - return r; -} - -void server_rotate(Server *s) { - JournalFile *f; - void *k; - Iterator i; - int r; - - log_debug("Rotating..."); - - (void) do_rotate(s, &s->runtime_journal, "runtime", false, 0); - (void) do_rotate(s, &s->system_journal, "system", s->seal, 0); - - ORDERED_HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) { - r = do_rotate(s, &f, "user", s->seal, PTR_TO_UID(k)); - if (r >= 0) - ordered_hashmap_replace(s->user_journals, k, f); - else if (!f) - /* Old file has been closed and deallocated */ - ordered_hashmap_remove(s->user_journals, k); - } - - /* Perform any deferred closes which aren't still offlining. */ - SET_FOREACH(f, s->deferred_closes, i) - if (!journal_file_is_offlining(f)) { - (void) set_remove(s->deferred_closes, f); - (void) journal_file_close(f); - } -} - -void server_sync(Server *s) { - JournalFile *f; - Iterator i; - int r; - - if (s->system_journal) { - r = journal_file_set_offline(s->system_journal, false); - if (r < 0) - log_warning_errno(r, "Failed to sync system journal, ignoring: %m"); - } - - ORDERED_HASHMAP_FOREACH(f, s->user_journals, i) { - r = journal_file_set_offline(f, false); - if (r < 0) - log_warning_errno(r, "Failed to sync user journal, ignoring: %m"); - } - - if (s->sync_event_source) { - r = sd_event_source_set_enabled(s->sync_event_source, SD_EVENT_OFF); - if (r < 0) - log_error_errno(r, "Failed to disable sync timer source: %m"); - } - - s->sync_scheduled = false; -} - -static void do_vacuum( - Server *s, - JournalFile *f, - JournalMetrics *metrics, - const char *path, - const char *name, - bool verbose, - bool patch_min_use) { - - const char *p; - uint64_t limit; - int r; - - assert(s); - assert(metrics); - assert(path); - assert(name); - - if (!f) - return; - - p = strjoina(path, SERVER_MACHINE_ID(s)); - - limit = metrics->max_use; - (void) determine_space_for(s, metrics, path, name, verbose, patch_min_use, NULL, &limit); - - r = journal_directory_vacuum(p, limit, metrics->n_max_files, s->max_retention_usec, &s->oldest_file_usec, verbose); - if (r < 0 && r != -ENOENT) - log_warning_errno(r, "Failed to vacuum %s, ignoring: %m", p); -} - -int server_vacuum(Server *s, bool verbose, bool patch_min_use) { - assert(s); - - log_debug("Vacuuming..."); - - s->oldest_file_usec = 0; - - do_vacuum(s, s->system_journal, &s->system_metrics, "/var/log/journal/", "System journal", verbose, patch_min_use); - do_vacuum(s, s->runtime_journal, &s->runtime_metrics, "/run/log/journal/", "Runtime journal", verbose, patch_min_use); - - s->cached_space_limit = 0; - s->cached_space_available = 0; - s->cached_space_timestamp = 0; - - return 0; -} - -static void server_cache_machine_id(Server *s) { - sd_id128_t id; - int r; - - assert(s); - - r = sd_id128_get_machine(&id); - if (r < 0) - return; - - sd_id128_to_string(id, stpcpy(s->machine_id_field, "_MACHINE_ID=")); -} - -static void server_cache_boot_id(Server *s) { - sd_id128_t id; - int r; - - assert(s); - - r = sd_id128_get_boot(&id); - if (r < 0) - return; - - sd_id128_to_string(id, stpcpy(s->boot_id_field, "_BOOT_ID=")); -} - -static void server_cache_hostname(Server *s) { - _cleanup_free_ char *t = NULL; - char *x; - - assert(s); - - t = gethostname_malloc(); - if (!t) - return; - - x = strappend("_HOSTNAME=", t); - if (!x) - return; - - free(s->hostname_field); - s->hostname_field = x; -} - -static bool shall_try_append_again(JournalFile *f, int r) { - switch(r) { - case -E2BIG: /* Hit configured limit */ - case -EFBIG: /* Hit fs limit */ - case -EDQUOT: /* Quota limit hit */ - case -ENOSPC: /* Disk full */ - log_debug("%s: Allocation limit reached, rotating.", f->path); - return true; - case -EIO: /* I/O error of some kind (mmap) */ - log_warning("%s: IO error, rotating.", f->path); - return true; - case -EHOSTDOWN: /* Other machine */ - log_info("%s: Journal file from other machine, rotating.", f->path); - return true; - case -EBUSY: /* Unclean shutdown */ - log_info("%s: Unclean shutdown, rotating.", f->path); - return true; - case -EPROTONOSUPPORT: /* Unsupported feature */ - log_info("%s: Unsupported feature, rotating.", f->path); - return true; - case -EBADMSG: /* Corrupted */ - case -ENODATA: /* Truncated */ - case -ESHUTDOWN: /* Already archived */ - log_warning("%s: Journal file corrupted, rotating.", f->path); - return true; - case -EIDRM: /* Journal file has been deleted */ - log_warning("%s: Journal file has been deleted, rotating.", f->path); - return true; - default: - return false; - } -} - -static void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, unsigned n, int priority) { - JournalFile *f; - bool vacuumed = false; - int r; - - assert(s); - assert(iovec); - assert(n > 0); - - f = find_journal(s, uid); - if (!f) - return; - - if (journal_file_rotate_suggested(f, s->max_file_usec)) { - log_debug("%s: Journal header limits reached or header out-of-date, rotating.", f->path); - server_rotate(s); - server_vacuum(s, false, false); - vacuumed = true; - - f = find_journal(s, uid); - if (!f) - return; - } - - r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL); - if (r >= 0) { - server_schedule_sync(s, priority); - return; - } - - if (vacuumed || !shall_try_append_again(f, r)) { - log_error_errno(r, "Failed to write entry (%d items, %zu bytes), ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n)); - return; - } - - server_rotate(s); - server_vacuum(s, false, false); - - f = find_journal(s, uid); - if (!f) - return; - - log_debug("Retrying write."); - r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL); - if (r < 0) - log_error_errno(r, "Failed to write entry (%d items, %zu bytes) despite vacuuming, ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n)); - else - server_schedule_sync(s, priority); -} - -static void dispatch_message_real( - Server *s, - struct iovec *iovec, unsigned n, unsigned m, - const struct ucred *ucred, - const struct timeval *tv, - const char *label, size_t label_len, - const char *unit_id, - int priority, - pid_t object_pid) { - - char pid[sizeof("_PID=") + DECIMAL_STR_MAX(pid_t)], - uid[sizeof("_UID=") + DECIMAL_STR_MAX(uid_t)], - gid[sizeof("_GID=") + DECIMAL_STR_MAX(gid_t)], - owner_uid[sizeof("_SYSTEMD_OWNER_UID=") + DECIMAL_STR_MAX(uid_t)], - source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)], - o_uid[sizeof("OBJECT_UID=") + DECIMAL_STR_MAX(uid_t)], - o_gid[sizeof("OBJECT_GID=") + DECIMAL_STR_MAX(gid_t)], - o_owner_uid[sizeof("OBJECT_SYSTEMD_OWNER_UID=") + DECIMAL_STR_MAX(uid_t)]; - uid_t object_uid; - gid_t object_gid; - char *x; - int r; - char *t, *c; - uid_t realuid = 0, owner = 0, journal_uid; - bool owner_valid = false; -#ifdef HAVE_AUDIT - char audit_session[sizeof("_AUDIT_SESSION=") + DECIMAL_STR_MAX(uint32_t)], - audit_loginuid[sizeof("_AUDIT_LOGINUID=") + DECIMAL_STR_MAX(uid_t)], - o_audit_session[sizeof("OBJECT_AUDIT_SESSION=") + DECIMAL_STR_MAX(uint32_t)], - o_audit_loginuid[sizeof("OBJECT_AUDIT_LOGINUID=") + DECIMAL_STR_MAX(uid_t)]; - - uint32_t audit; - uid_t loginuid; -#endif - - assert(s); - assert(iovec); - assert(n > 0); - assert(n + N_IOVEC_META_FIELDS + (object_pid ? N_IOVEC_OBJECT_FIELDS : 0) <= m); - - if (ucred) { - realuid = ucred->uid; - - sprintf(pid, "_PID="PID_FMT, ucred->pid); - IOVEC_SET_STRING(iovec[n++], pid); - - sprintf(uid, "_UID="UID_FMT, ucred->uid); - IOVEC_SET_STRING(iovec[n++], uid); - - sprintf(gid, "_GID="GID_FMT, ucred->gid); - IOVEC_SET_STRING(iovec[n++], gid); - - r = get_process_comm(ucred->pid, &t); - if (r >= 0) { - x = strjoina("_COMM=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - r = get_process_exe(ucred->pid, &t); - if (r >= 0) { - x = strjoina("_EXE=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - r = get_process_cmdline(ucred->pid, 0, false, &t); - if (r >= 0) { - x = strjoina("_CMDLINE=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - r = get_process_capeff(ucred->pid, &t); - if (r >= 0) { - x = strjoina("_CAP_EFFECTIVE=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - -#ifdef HAVE_AUDIT - r = audit_session_from_pid(ucred->pid, &audit); - if (r >= 0) { - sprintf(audit_session, "_AUDIT_SESSION=%"PRIu32, audit); - IOVEC_SET_STRING(iovec[n++], audit_session); - } - - r = audit_loginuid_from_pid(ucred->pid, &loginuid); - if (r >= 0) { - sprintf(audit_loginuid, "_AUDIT_LOGINUID="UID_FMT, loginuid); - IOVEC_SET_STRING(iovec[n++], audit_loginuid); - } -#endif - - r = cg_pid_get_path_shifted(ucred->pid, s->cgroup_root, &c); - if (r >= 0) { - char *session = NULL; - - x = strjoina("_SYSTEMD_CGROUP=", c); - IOVEC_SET_STRING(iovec[n++], x); - - r = cg_path_get_session(c, &t); - if (r >= 0) { - session = strjoina("_SYSTEMD_SESSION=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], session); - } - - if (cg_path_get_owner_uid(c, &owner) >= 0) { - owner_valid = true; - - sprintf(owner_uid, "_SYSTEMD_OWNER_UID="UID_FMT, owner); - IOVEC_SET_STRING(iovec[n++], owner_uid); - } - - if (cg_path_get_unit(c, &t) >= 0) { - x = strjoina("_SYSTEMD_UNIT=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } else if (unit_id && !session) { - x = strjoina("_SYSTEMD_UNIT=", unit_id); - IOVEC_SET_STRING(iovec[n++], x); - } - - if (cg_path_get_user_unit(c, &t) >= 0) { - x = strjoina("_SYSTEMD_USER_UNIT=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } else if (unit_id && session) { - x = strjoina("_SYSTEMD_USER_UNIT=", unit_id); - IOVEC_SET_STRING(iovec[n++], x); - } - - if (cg_path_get_slice(c, &t) >= 0) { - x = strjoina("_SYSTEMD_SLICE=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - free(c); - } else if (unit_id) { - x = strjoina("_SYSTEMD_UNIT=", unit_id); - IOVEC_SET_STRING(iovec[n++], x); - } - -#ifdef HAVE_SELINUX - if (mac_selinux_have()) { - if (label) { - x = alloca(strlen("_SELINUX_CONTEXT=") + label_len + 1); - - *((char*) mempcpy(stpcpy(x, "_SELINUX_CONTEXT="), label, label_len)) = 0; - IOVEC_SET_STRING(iovec[n++], x); - } else { - char *con; - - if (getpidcon(ucred->pid, &con) >= 0) { - x = strjoina("_SELINUX_CONTEXT=", con); - - freecon(con); - IOVEC_SET_STRING(iovec[n++], x); - } - } - } -#endif - } - assert(n <= m); - - if (object_pid) { - r = get_process_uid(object_pid, &object_uid); - if (r >= 0) { - sprintf(o_uid, "OBJECT_UID="UID_FMT, object_uid); - IOVEC_SET_STRING(iovec[n++], o_uid); - } - - r = get_process_gid(object_pid, &object_gid); - if (r >= 0) { - sprintf(o_gid, "OBJECT_GID="GID_FMT, object_gid); - IOVEC_SET_STRING(iovec[n++], o_gid); - } - - r = get_process_comm(object_pid, &t); - if (r >= 0) { - x = strjoina("OBJECT_COMM=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - r = get_process_exe(object_pid, &t); - if (r >= 0) { - x = strjoina("OBJECT_EXE=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - r = get_process_cmdline(object_pid, 0, false, &t); - if (r >= 0) { - x = strjoina("OBJECT_CMDLINE=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - -#ifdef HAVE_AUDIT - r = audit_session_from_pid(object_pid, &audit); - if (r >= 0) { - sprintf(o_audit_session, "OBJECT_AUDIT_SESSION=%"PRIu32, audit); - IOVEC_SET_STRING(iovec[n++], o_audit_session); - } - - r = audit_loginuid_from_pid(object_pid, &loginuid); - if (r >= 0) { - sprintf(o_audit_loginuid, "OBJECT_AUDIT_LOGINUID="UID_FMT, loginuid); - IOVEC_SET_STRING(iovec[n++], o_audit_loginuid); - } -#endif - - r = cg_pid_get_path_shifted(object_pid, s->cgroup_root, &c); - if (r >= 0) { - x = strjoina("OBJECT_SYSTEMD_CGROUP=", c); - IOVEC_SET_STRING(iovec[n++], x); - - r = cg_path_get_session(c, &t); - if (r >= 0) { - x = strjoina("OBJECT_SYSTEMD_SESSION=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - if (cg_path_get_owner_uid(c, &owner) >= 0) { - sprintf(o_owner_uid, "OBJECT_SYSTEMD_OWNER_UID="UID_FMT, owner); - IOVEC_SET_STRING(iovec[n++], o_owner_uid); - } - - if (cg_path_get_unit(c, &t) >= 0) { - x = strjoina("OBJECT_SYSTEMD_UNIT=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - if (cg_path_get_user_unit(c, &t) >= 0) { - x = strjoina("OBJECT_SYSTEMD_USER_UNIT=", t); - free(t); - IOVEC_SET_STRING(iovec[n++], x); - } - - free(c); - } - } - assert(n <= m); - - if (tv) { - sprintf(source_time, "_SOURCE_REALTIME_TIMESTAMP=%llu", (unsigned long long) timeval_load(tv)); - IOVEC_SET_STRING(iovec[n++], source_time); - } - - /* Note that strictly speaking storing the boot id here is - * redundant since the entry includes this in-line - * anyway. However, we need this indexed, too. */ - if (!isempty(s->boot_id_field)) - IOVEC_SET_STRING(iovec[n++], s->boot_id_field); - - if (!isempty(s->machine_id_field)) - IOVEC_SET_STRING(iovec[n++], s->machine_id_field); - - if (!isempty(s->hostname_field)) - IOVEC_SET_STRING(iovec[n++], s->hostname_field); - - assert(n <= m); - - if (s->split_mode == SPLIT_UID && realuid > 0) - /* Split up strictly by any UID */ - journal_uid = realuid; - else if (s->split_mode == SPLIT_LOGIN && realuid > 0 && owner_valid && owner > 0) - /* Split up by login UIDs. We do this only if the - * realuid is not root, in order not to accidentally - * leak privileged information to the user that is - * logged by a privileged process that is part of an - * unprivileged session. */ - journal_uid = owner; - else - journal_uid = 0; - - write_to_journal(s, journal_uid, iovec, n, priority); -} - -void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) { - char mid[11 + 32 + 1]; - struct iovec iovec[N_IOVEC_META_FIELDS + 5 + N_IOVEC_PAYLOAD_FIELDS]; - unsigned n = 0, m; - int r; - va_list ap; - struct ucred ucred = {}; - - assert(s); - assert(format); - - assert_cc(3 == LOG_FAC(LOG_DAEMON)); - IOVEC_SET_STRING(iovec[n++], "SYSLOG_FACILITY=3"); - IOVEC_SET_STRING(iovec[n++], "SYSLOG_IDENTIFIER=systemd-journald"); - - IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=driver"); - assert_cc(6 == LOG_INFO); - IOVEC_SET_STRING(iovec[n++], "PRIORITY=6"); - - if (!sd_id128_is_null(message_id)) { - snprintf(mid, sizeof(mid), LOG_MESSAGE_ID(message_id)); - IOVEC_SET_STRING(iovec[n++], mid); - } - - m = n; - - va_start(ap, format); - r = log_format_iovec(iovec, ELEMENTSOF(iovec), &n, false, 0, format, ap); - /* Error handling below */ - va_end(ap); - - ucred.pid = getpid(); - ucred.uid = getuid(); - ucred.gid = getgid(); - - if (r >= 0) - dispatch_message_real(s, iovec, n, ELEMENTSOF(iovec), &ucred, NULL, NULL, 0, NULL, LOG_INFO, 0); - - while (m < n) - free(iovec[m++].iov_base); - - if (r < 0) { - /* We failed to format the message. Emit a warning instead. */ - char buf[LINE_MAX]; - - xsprintf(buf, "MESSAGE=Entry printing failed: %s", strerror(-r)); - - n = 3; - IOVEC_SET_STRING(iovec[n++], "PRIORITY=4"); - IOVEC_SET_STRING(iovec[n++], buf); - dispatch_message_real(s, iovec, n, ELEMENTSOF(iovec), &ucred, NULL, NULL, 0, NULL, LOG_INFO, 0); - } -} - -void server_dispatch_message( - Server *s, - struct iovec *iovec, unsigned n, unsigned m, - const struct ucred *ucred, - const struct timeval *tv, - const char *label, size_t label_len, - const char *unit_id, - int priority, - pid_t object_pid) { - - int rl, r; - _cleanup_free_ char *path = NULL; - uint64_t available = 0; - char *c; - - assert(s); - assert(iovec || n == 0); - - if (n == 0) - return; - - if (LOG_PRI(priority) > s->max_level_store) - return; - - /* Stop early in case the information will not be stored - * in a journal. */ - if (s->storage == STORAGE_NONE) - return; - - if (!ucred) - goto finish; - - r = cg_pid_get_path_shifted(ucred->pid, s->cgroup_root, &path); - if (r < 0) - goto finish; - - /* example: /user/lennart/3/foobar - * /system/dbus.service/foobar - * - * So let's cut of everything past the third /, since that is - * where user directories start */ - - c = strchr(path, '/'); - if (c) { - c = strchr(c+1, '/'); - if (c) { - c = strchr(c+1, '/'); - if (c) - *c = 0; - } - } - - (void) determine_space(s, false, false, &available, NULL); - rl = journal_rate_limit_test(s->rate_limit, path, priority & LOG_PRIMASK, available); - if (rl == 0) - return; - - /* Write a suppression message if we suppressed something */ - if (rl > 1) - server_driver_message(s, SD_MESSAGE_JOURNAL_DROPPED, - LOG_MESSAGE("Suppressed %u messages from %s", rl - 1, path), - NULL); - -finish: - dispatch_message_real(s, iovec, n, m, ucred, tv, label, label_len, unit_id, priority, object_pid); -} - - -static int system_journal_open(Server *s, bool flush_requested) { - const char *fn; - int r = 0; - - if (!s->system_journal && - (s->storage == STORAGE_PERSISTENT || s->storage == STORAGE_AUTO) && - (flush_requested - || access("/run/systemd/journal/flushed", F_OK) >= 0)) { - - /* If in auto mode: first try to create the machine - * path, but not the prefix. - * - * If in persistent mode: create /var/log/journal and - * the machine path */ - - if (s->storage == STORAGE_PERSISTENT) - (void) mkdir_p("/var/log/journal/", 0755); - - fn = strjoina("/var/log/journal/", SERVER_MACHINE_ID(s)); - (void) mkdir(fn, 0755); - - fn = strjoina(fn, "/system.journal"); - r = open_journal(s, true, fn, O_RDWR|O_CREAT, s->seal, &s->system_metrics, &s->system_journal); - if (r >= 0) { - server_add_acls(s->system_journal, 0); - (void) determine_space_for(s, &s->system_metrics, "/var/log/journal/", "System journal", true, true, NULL, NULL); - } else if (r < 0) { - if (r != -ENOENT && r != -EROFS) - log_warning_errno(r, "Failed to open system journal: %m"); - - r = 0; - } - } - - if (!s->runtime_journal && - (s->storage != STORAGE_NONE)) { - - fn = strjoina("/run/log/journal/", SERVER_MACHINE_ID(s), "/system.journal"); - - if (s->system_journal) { - - /* Try to open the runtime journal, but only - * if it already exists, so that we can flush - * it into the system journal */ - - r = open_journal(s, false, fn, O_RDWR, false, &s->runtime_metrics, &s->runtime_journal); - if (r < 0) { - if (r != -ENOENT) - log_warning_errno(r, "Failed to open runtime journal: %m"); - - r = 0; - } - - } else { - - /* OK, we really need the runtime journal, so create - * it if necessary. */ - - (void) mkdir("/run/log", 0755); - (void) mkdir("/run/log/journal", 0755); - (void) mkdir_parents(fn, 0750); - - r = open_journal(s, true, fn, O_RDWR|O_CREAT, false, &s->runtime_metrics, &s->runtime_journal); - if (r < 0) - return log_error_errno(r, "Failed to open runtime journal: %m"); - } - - if (s->runtime_journal) { - server_add_acls(s->runtime_journal, 0); - (void) determine_space_for(s, &s->runtime_metrics, "/run/log/journal/", "Runtime journal", true, true, NULL, NULL); - } - } - - return r; -} - -int server_flush_to_var(Server *s) { - sd_id128_t machine; - sd_journal *j = NULL; - char ts[FORMAT_TIMESPAN_MAX]; - usec_t start; - unsigned n = 0; - int r; - - assert(s); - - if (s->storage != STORAGE_AUTO && - s->storage != STORAGE_PERSISTENT) - return 0; - - if (!s->runtime_journal) - return 0; - - (void) system_journal_open(s, true); - - if (!s->system_journal) - return 0; - - log_debug("Flushing to /var..."); - - start = now(CLOCK_MONOTONIC); - - r = sd_id128_get_machine(&machine); - if (r < 0) - return r; - - r = sd_journal_open(&j, SD_JOURNAL_RUNTIME_ONLY); - if (r < 0) - return log_error_errno(r, "Failed to read runtime journal: %m"); - - sd_journal_set_data_threshold(j, 0); - - SD_JOURNAL_FOREACH(j) { - Object *o = NULL; - JournalFile *f; - - f = j->current_file; - assert(f && f->current_offset > 0); - - n++; - - r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o); - if (r < 0) { - log_error_errno(r, "Can't read entry: %m"); - goto finish; - } - - r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL); - if (r >= 0) - continue; - - if (!shall_try_append_again(s->system_journal, r)) { - log_error_errno(r, "Can't write entry: %m"); - goto finish; - } - - server_rotate(s); - server_vacuum(s, false, false); - - if (!s->system_journal) { - log_notice("Didn't flush runtime journal since rotation of system journal wasn't successful."); - r = -EIO; - goto finish; - } - - log_debug("Retrying write."); - r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL); - if (r < 0) { - log_error_errno(r, "Can't write entry: %m"); - goto finish; - } - } - - r = 0; - -finish: - journal_file_post_change(s->system_journal); - - s->runtime_journal = journal_file_close(s->runtime_journal); - - if (r >= 0) - (void) rm_rf("/run/log/journal", REMOVE_ROOT); - - sd_journal_close(j); - - server_driver_message(s, SD_ID128_NULL, - LOG_MESSAGE("Time spent on flushing to /var is %s for %u entries.", - format_timespan(ts, sizeof(ts), now(CLOCK_MONOTONIC) - start, 0), - n), - NULL); - - return r; -} - -int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata) { - Server *s = userdata; - struct ucred *ucred = NULL; - struct timeval *tv = NULL; - struct cmsghdr *cmsg; - char *label = NULL; - size_t label_len = 0, m; - struct iovec iovec; - ssize_t n; - int *fds = NULL, v = 0; - unsigned n_fds = 0; - - union { - struct cmsghdr cmsghdr; - - /* We use NAME_MAX space for the SELinux label - * here. The kernel currently enforces no - * limit, but according to suggestions from - * the SELinux people this will change and it - * will probably be identical to NAME_MAX. For - * now we use that, but this should be updated - * one day when the final limit is known. */ - uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) + - CMSG_SPACE(sizeof(struct timeval)) + - CMSG_SPACE(sizeof(int)) + /* fd */ - CMSG_SPACE(NAME_MAX)]; /* selinux label */ - } control = {}; - - union sockaddr_union sa = {}; - - struct msghdr msghdr = { - .msg_iov = &iovec, - .msg_iovlen = 1, - .msg_control = &control, - .msg_controllen = sizeof(control), - .msg_name = &sa, - .msg_namelen = sizeof(sa), - }; - - assert(s); - assert(fd == s->native_fd || fd == s->syslog_fd || fd == s->audit_fd); - - if (revents != EPOLLIN) { - log_error("Got invalid event from epoll for datagram fd: %"PRIx32, revents); - return -EIO; - } - - /* Try to get the right size, if we can. (Not all - * sockets support SIOCINQ, hence we just try, but - * don't rely on it. */ - (void) ioctl(fd, SIOCINQ, &v); - - /* Fix it up, if it is too small. We use the same fixed value as auditd here. Awful! */ - m = PAGE_ALIGN(MAX3((size_t) v + 1, - (size_t) LINE_MAX, - ALIGN(sizeof(struct nlmsghdr)) + ALIGN((size_t) MAX_AUDIT_MESSAGE_LENGTH)) + 1); - - if (!GREEDY_REALLOC(s->buffer, s->buffer_size, m)) - return log_oom(); - - iovec.iov_base = s->buffer; - iovec.iov_len = s->buffer_size - 1; /* Leave room for trailing NUL we add later */ - - n = recvmsg(fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC); - if (n < 0) { - if (errno == EINTR || errno == EAGAIN) - return 0; - - return log_error_errno(errno, "recvmsg() failed: %m"); - } - - CMSG_FOREACH(cmsg, &msghdr) { - - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_CREDENTIALS && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) - ucred = (struct ucred*) CMSG_DATA(cmsg); - else if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_SECURITY) { - label = (char*) CMSG_DATA(cmsg); - label_len = cmsg->cmsg_len - CMSG_LEN(0); - } else if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SO_TIMESTAMP && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) - tv = (struct timeval*) CMSG_DATA(cmsg); - else if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_RIGHTS) { - fds = (int*) CMSG_DATA(cmsg); - n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); - } - } - - /* And a trailing NUL, just in case */ - s->buffer[n] = 0; - - if (fd == s->syslog_fd) { - if (n > 0 && n_fds == 0) - server_process_syslog_message(s, strstrip(s->buffer), ucred, tv, label, label_len); - else if (n_fds > 0) - log_warning("Got file descriptors via syslog socket. Ignoring."); - - } else if (fd == s->native_fd) { - if (n > 0 && n_fds == 0) - server_process_native_message(s, s->buffer, n, ucred, tv, label, label_len); - else if (n == 0 && n_fds == 1) - server_process_native_file(s, fds[0], ucred, tv, label, label_len); - else if (n_fds > 0) - log_warning("Got too many file descriptors via native socket. Ignoring."); - - } else { - assert(fd == s->audit_fd); - - if (n > 0 && n_fds == 0) - server_process_audit_message(s, s->buffer, n, ucred, &sa, msghdr.msg_namelen); - else if (n_fds > 0) - log_warning("Got file descriptors via audit socket. Ignoring."); - } - - close_many(fds, n_fds); - return 0; -} - -static int dispatch_sigusr1(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { - Server *s = userdata; - int r; - - assert(s); - - log_info("Received request to flush runtime journal from PID " PID_FMT, si->ssi_pid); - - server_flush_to_var(s); - server_sync(s); - server_vacuum(s, false, false); - - r = touch("/run/systemd/journal/flushed"); - if (r < 0) - log_warning_errno(r, "Failed to touch /run/systemd/journal/flushed, ignoring: %m"); - - return 0; -} - -static int dispatch_sigusr2(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { - Server *s = userdata; - int r; - - assert(s); - - log_info("Received request to rotate journal from PID " PID_FMT, si->ssi_pid); - server_rotate(s); - server_vacuum(s, true, true); - - /* Let clients know when the most recent rotation happened. */ - r = write_timestamp_file_atomic("/run/systemd/journal/rotated", now(CLOCK_MONOTONIC)); - if (r < 0) - log_warning_errno(r, "Failed to write /run/systemd/journal/rotated, ignoring: %m"); - - return 0; -} - -static int dispatch_sigterm(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { - Server *s = userdata; - - assert(s); - - log_received_signal(LOG_INFO, si); - - sd_event_exit(s->event, 0); - return 0; -} - -static int dispatch_sigrtmin1(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { - Server *s = userdata; - int r; - - assert(s); - - log_debug("Received request to sync from PID " PID_FMT, si->ssi_pid); - - server_sync(s); - - /* Let clients know when the most recent sync happened. */ - r = write_timestamp_file_atomic("/run/systemd/journal/synced", now(CLOCK_MONOTONIC)); - if (r < 0) - log_warning_errno(r, "Failed to write /run/systemd/journal/synced, ignoring: %m"); - - return 0; -} - -static int setup_signals(Server *s) { - int r; - - assert(s); - - assert(sigprocmask_many(SIG_SETMASK, NULL, SIGINT, SIGTERM, SIGUSR1, SIGUSR2, SIGRTMIN+1, -1) >= 0); - - r = sd_event_add_signal(s->event, &s->sigusr1_event_source, SIGUSR1, dispatch_sigusr1, s); - if (r < 0) - return r; - - r = sd_event_add_signal(s->event, &s->sigusr2_event_source, SIGUSR2, dispatch_sigusr2, s); - if (r < 0) - return r; - - r = sd_event_add_signal(s->event, &s->sigterm_event_source, SIGTERM, dispatch_sigterm, s); - if (r < 0) - return r; - - /* Let's process SIGTERM late, so that we flush all queued - * messages to disk before we exit */ - r = sd_event_source_set_priority(s->sigterm_event_source, SD_EVENT_PRIORITY_NORMAL+20); - if (r < 0) - return r; - - /* When journald is invoked on the terminal (when debugging), - * it's useful if C-c is handled equivalent to SIGTERM. */ - r = sd_event_add_signal(s->event, &s->sigint_event_source, SIGINT, dispatch_sigterm, s); - if (r < 0) - return r; - - r = sd_event_source_set_priority(s->sigint_event_source, SD_EVENT_PRIORITY_NORMAL+20); - if (r < 0) - return r; - - /* SIGRTMIN+1 causes an immediate sync. We process this very - * late, so that everything else queued at this point is - * really written to disk. Clients can watch - * /run/systemd/journal/synced with inotify until its mtime - * changes to see when a sync happened. */ - r = sd_event_add_signal(s->event, &s->sigrtmin1_event_source, SIGRTMIN+1, dispatch_sigrtmin1, s); - if (r < 0) - return r; - - r = sd_event_source_set_priority(s->sigrtmin1_event_source, SD_EVENT_PRIORITY_NORMAL+15); - if (r < 0) - return r; - - return 0; -} - -static int server_parse_proc_cmdline(Server *s) { - _cleanup_free_ char *line = NULL; - const char *p; - int r; - - r = proc_cmdline(&line); - if (r < 0) { - log_warning_errno(r, "Failed to read /proc/cmdline, ignoring: %m"); - return 0; - } - - p = line; - for (;;) { - _cleanup_free_ char *word = NULL; - - r = extract_first_word(&p, &word, NULL, 0); - if (r < 0) - return log_error_errno(r, "Failed to parse journald syntax \"%s\": %m", line); - - if (r == 0) - break; - - if (startswith(word, "systemd.journald.forward_to_syslog=")) { - r = parse_boolean(word + 35); - if (r < 0) - log_warning("Failed to parse forward to syslog switch %s. Ignoring.", word + 35); - else - s->forward_to_syslog = r; - } else if (startswith(word, "systemd.journald.forward_to_kmsg=")) { - r = parse_boolean(word + 33); - if (r < 0) - log_warning("Failed to parse forward to kmsg switch %s. Ignoring.", word + 33); - else - s->forward_to_kmsg = r; - } else if (startswith(word, "systemd.journald.forward_to_console=")) { - r = parse_boolean(word + 36); - if (r < 0) - log_warning("Failed to parse forward to console switch %s. Ignoring.", word + 36); - else - s->forward_to_console = r; - } else if (startswith(word, "systemd.journald.forward_to_wall=")) { - r = parse_boolean(word + 33); - if (r < 0) - log_warning("Failed to parse forward to wall switch %s. Ignoring.", word + 33); - else - s->forward_to_wall = r; - } else if (startswith(word, "systemd.journald")) - log_warning("Invalid systemd.journald parameter. Ignoring."); - } - - /* do not warn about state here, since probably systemd already did */ - return 0; -} - -static int server_parse_config_file(Server *s) { - assert(s); - - return config_parse_many(PKGSYSCONFDIR "/journald.conf", - CONF_PATHS_NULSTR("systemd/journald.conf.d"), - "Journal\0", - config_item_perf_lookup, journald_gperf_lookup, - false, s); -} - -static int server_dispatch_sync(sd_event_source *es, usec_t t, void *userdata) { - Server *s = userdata; - - assert(s); - - server_sync(s); - return 0; -} - -int server_schedule_sync(Server *s, int priority) { - int r; - - assert(s); - - if (priority <= LOG_CRIT) { - /* Immediately sync to disk when this is of priority CRIT, ALERT, EMERG */ - server_sync(s); - return 0; - } - - if (s->sync_scheduled) - return 0; - - if (s->sync_interval_usec > 0) { - usec_t when; - - r = sd_event_now(s->event, CLOCK_MONOTONIC, &when); - if (r < 0) - return r; - - when += s->sync_interval_usec; - - if (!s->sync_event_source) { - r = sd_event_add_time( - s->event, - &s->sync_event_source, - CLOCK_MONOTONIC, - when, 0, - server_dispatch_sync, s); - if (r < 0) - return r; - - r = sd_event_source_set_priority(s->sync_event_source, SD_EVENT_PRIORITY_IMPORTANT); - } else { - r = sd_event_source_set_time(s->sync_event_source, when); - if (r < 0) - return r; - - r = sd_event_source_set_enabled(s->sync_event_source, SD_EVENT_ONESHOT); - } - if (r < 0) - return r; - - s->sync_scheduled = true; - } - - return 0; -} - -static int dispatch_hostname_change(sd_event_source *es, int fd, uint32_t revents, void *userdata) { - Server *s = userdata; - - assert(s); - - server_cache_hostname(s); - return 0; -} - -static int server_open_hostname(Server *s) { - int r; - - assert(s); - - s->hostname_fd = open("/proc/sys/kernel/hostname", O_RDONLY|O_CLOEXEC|O_NDELAY|O_NOCTTY); - if (s->hostname_fd < 0) - return log_error_errno(errno, "Failed to open /proc/sys/kernel/hostname: %m"); - - r = sd_event_add_io(s->event, &s->hostname_event_source, s->hostname_fd, 0, dispatch_hostname_change, s); - if (r < 0) { - /* kernels prior to 3.2 don't support polling this file. Ignore - * the failure. */ - if (r == -EPERM) { - log_warning_errno(r, "Failed to register hostname fd in event loop, ignoring: %m"); - s->hostname_fd = safe_close(s->hostname_fd); - return 0; - } - - return log_error_errno(r, "Failed to register hostname fd in event loop: %m"); - } - - r = sd_event_source_set_priority(s->hostname_event_source, SD_EVENT_PRIORITY_IMPORTANT-10); - if (r < 0) - return log_error_errno(r, "Failed to adjust priority of host name event source: %m"); - - return 0; -} - -static int dispatch_notify_event(sd_event_source *es, int fd, uint32_t revents, void *userdata) { - Server *s = userdata; - int r; - - assert(s); - assert(s->notify_event_source == es); - assert(s->notify_fd == fd); - - /* The $NOTIFY_SOCKET is writable again, now send exactly one - * message on it. Either it's the wtachdog event, the initial - * READY=1 event or an stdout stream event. If there's nothing - * to write anymore, turn our event source off. The next time - * there's something to send it will be turned on again. */ - - if (!s->sent_notify_ready) { - static const char p[] = - "READY=1\n" - "STATUS=Processing requests..."; - ssize_t l; - - l = send(s->notify_fd, p, strlen(p), MSG_DONTWAIT); - if (l < 0) { - if (errno == EAGAIN) - return 0; - - return log_error_errno(errno, "Failed to send READY=1 notification message: %m"); - } - - s->sent_notify_ready = true; - log_debug("Sent READY=1 notification."); - - } else if (s->send_watchdog) { - - static const char p[] = - "WATCHDOG=1"; - - ssize_t l; - - l = send(s->notify_fd, p, strlen(p), MSG_DONTWAIT); - if (l < 0) { - if (errno == EAGAIN) - return 0; - - return log_error_errno(errno, "Failed to send WATCHDOG=1 notification message: %m"); - } - - s->send_watchdog = false; - log_debug("Sent WATCHDOG=1 notification."); - - } else if (s->stdout_streams_notify_queue) - /* Dispatch one stream notification event */ - stdout_stream_send_notify(s->stdout_streams_notify_queue); - - /* Leave us enabled if there's still more to do. */ - if (s->send_watchdog || s->stdout_streams_notify_queue) - return 0; - - /* There was nothing to do anymore, let's turn ourselves off. */ - r = sd_event_source_set_enabled(es, SD_EVENT_OFF); - if (r < 0) - return log_error_errno(r, "Failed to turn off notify event source: %m"); - - return 0; -} - -static int dispatch_watchdog(sd_event_source *es, uint64_t usec, void *userdata) { - Server *s = userdata; - int r; - - assert(s); - - s->send_watchdog = true; - - r = sd_event_source_set_enabled(s->notify_event_source, SD_EVENT_ON); - if (r < 0) - log_warning_errno(r, "Failed to turn on notify event source: %m"); - - r = sd_event_source_set_time(s->watchdog_event_source, usec + s->watchdog_usec / 2); - if (r < 0) - return log_error_errno(r, "Failed to restart watchdog event source: %m"); - - r = sd_event_source_set_enabled(s->watchdog_event_source, SD_EVENT_ON); - if (r < 0) - return log_error_errno(r, "Failed to enable watchdog event source: %m"); - - return 0; -} - -static int server_connect_notify(Server *s) { - union sockaddr_union sa = { - .un.sun_family = AF_UNIX, - }; - const char *e; - int r; - - assert(s); - assert(s->notify_fd < 0); - assert(!s->notify_event_source); - - /* - So here's the problem: we'd like to send notification - messages to PID 1, but we cannot do that via sd_notify(), - since that's synchronous, and we might end up blocking on - it. Specifically: given that PID 1 might block on - dbus-daemon during IPC, and dbus-daemon is logging to us, - and might hence block on us, we might end up in a deadlock - if we block on sending PID 1 notification messages — by - generating a full blocking circle. To avoid this, let's - create a non-blocking socket, and connect it to the - notification socket, and then wait for POLLOUT before we - send anything. This should efficiently avoid any deadlocks, - as we'll never block on PID 1, hence PID 1 can safely block - on dbus-daemon which can safely block on us again. - - Don't think that this issue is real? It is, see: - https://github.com/systemd/systemd/issues/1505 - */ - - e = getenv("NOTIFY_SOCKET"); - if (!e) - return 0; - - if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { - log_error("NOTIFY_SOCKET set to an invalid value: %s", e); - return -EINVAL; - } - - if (strlen(e) > sizeof(sa.un.sun_path)) { - log_error("NOTIFY_SOCKET path too long: %s", e); - return -EINVAL; - } - - s->notify_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); - if (s->notify_fd < 0) - return log_error_errno(errno, "Failed to create notify socket: %m"); - - (void) fd_inc_sndbuf(s->notify_fd, NOTIFY_SNDBUF_SIZE); - - strncpy(sa.un.sun_path, e, sizeof(sa.un.sun_path)); - if (sa.un.sun_path[0] == '@') - sa.un.sun_path[0] = 0; - - r = connect(s->notify_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); - if (r < 0) - return log_error_errno(errno, "Failed to connect to notify socket: %m"); - - r = sd_event_add_io(s->event, &s->notify_event_source, s->notify_fd, EPOLLOUT, dispatch_notify_event, s); - if (r < 0) - return log_error_errno(r, "Failed to watch notification socket: %m"); - - if (sd_watchdog_enabled(false, &s->watchdog_usec) > 0) { - s->send_watchdog = true; - - r = sd_event_add_time(s->event, &s->watchdog_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + s->watchdog_usec/2, s->watchdog_usec/4, dispatch_watchdog, s); - if (r < 0) - return log_error_errno(r, "Failed to add watchdog time event: %m"); - } - - /* This should fire pretty soon, which we'll use to send the - * READY=1 event. */ - - return 0; -} - -int server_init(Server *s) { - _cleanup_fdset_free_ FDSet *fds = NULL; - int n, r, fd; - bool no_sockets; - - assert(s); - - zero(*s); - s->syslog_fd = s->native_fd = s->stdout_fd = s->dev_kmsg_fd = s->audit_fd = s->hostname_fd = s->notify_fd = -1; - s->compress = true; - s->seal = true; - - s->watchdog_usec = USEC_INFINITY; - - s->sync_interval_usec = DEFAULT_SYNC_INTERVAL_USEC; - s->sync_scheduled = false; - - s->rate_limit_interval = DEFAULT_RATE_LIMIT_INTERVAL; - s->rate_limit_burst = DEFAULT_RATE_LIMIT_BURST; - - s->forward_to_wall = true; - - s->max_file_usec = DEFAULT_MAX_FILE_USEC; - - s->max_level_store = LOG_DEBUG; - s->max_level_syslog = LOG_DEBUG; - s->max_level_kmsg = LOG_NOTICE; - s->max_level_console = LOG_INFO; - s->max_level_wall = LOG_EMERG; - - journal_reset_metrics(&s->system_metrics); - journal_reset_metrics(&s->runtime_metrics); - - server_parse_config_file(s); - server_parse_proc_cmdline(s); - - if (!!s->rate_limit_interval ^ !!s->rate_limit_burst) { - log_debug("Setting both rate limit interval and burst from "USEC_FMT",%u to 0,0", - s->rate_limit_interval, s->rate_limit_burst); - s->rate_limit_interval = s->rate_limit_burst = 0; - } - - (void) mkdir_p("/run/systemd/journal", 0755); - - s->user_journals = ordered_hashmap_new(NULL); - if (!s->user_journals) - return log_oom(); - - s->mmap = mmap_cache_new(); - if (!s->mmap) - return log_oom(); - - s->deferred_closes = set_new(NULL); - if (!s->deferred_closes) - return log_oom(); - - r = sd_event_default(&s->event); - if (r < 0) - return log_error_errno(r, "Failed to create event loop: %m"); - - n = sd_listen_fds(true); - if (n < 0) - return log_error_errno(n, "Failed to read listening file descriptors from environment: %m"); - - for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) { - - if (sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/run/systemd/journal/socket", 0) > 0) { - - if (s->native_fd >= 0) { - log_error("Too many native sockets passed."); - return -EINVAL; - } - - s->native_fd = fd; - - } else if (sd_is_socket_unix(fd, SOCK_STREAM, 1, "/run/systemd/journal/stdout", 0) > 0) { - - if (s->stdout_fd >= 0) { - log_error("Too many stdout sockets passed."); - return -EINVAL; - } - - s->stdout_fd = fd; - - } else if (sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/dev/log", 0) > 0 || - sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/run/systemd/journal/dev-log", 0) > 0) { - - if (s->syslog_fd >= 0) { - log_error("Too many /dev/log sockets passed."); - return -EINVAL; - } - - s->syslog_fd = fd; - - } else if (sd_is_socket(fd, AF_NETLINK, SOCK_RAW, -1) > 0) { - - if (s->audit_fd >= 0) { - log_error("Too many audit sockets passed."); - return -EINVAL; - } - - s->audit_fd = fd; - - } else { - - if (!fds) { - fds = fdset_new(); - if (!fds) - return log_oom(); - } - - r = fdset_put(fds, fd); - if (r < 0) - return log_oom(); - } - } - - /* Try to restore streams, but don't bother if this fails */ - (void) server_restore_streams(s, fds); - - if (fdset_size(fds) > 0) { - log_warning("%u unknown file descriptors passed, closing.", fdset_size(fds)); - fds = fdset_free(fds); - } - - no_sockets = s->native_fd < 0 && s->stdout_fd < 0 && s->syslog_fd < 0 && s->audit_fd < 0; - - /* always open stdout, syslog, native, and kmsg sockets */ - - /* systemd-journald.socket: /run/systemd/journal/stdout */ - r = server_open_stdout_socket(s); - if (r < 0) - return r; - - /* systemd-journald-dev-log.socket: /run/systemd/journal/dev-log */ - r = server_open_syslog_socket(s); - if (r < 0) - return r; - - /* systemd-journald.socket: /run/systemd/journal/socket */ - r = server_open_native_socket(s); - if (r < 0) - return r; - - /* /dev/ksmg */ - r = server_open_dev_kmsg(s); - if (r < 0) - return r; - - /* Unless we got *some* sockets and not audit, open audit socket */ - if (s->audit_fd >= 0 || no_sockets) { - r = server_open_audit(s); - if (r < 0) - return r; - } - - r = server_open_kernel_seqnum(s); - if (r < 0) - return r; - - r = server_open_hostname(s); - if (r < 0) - return r; - - r = setup_signals(s); - if (r < 0) - return r; - - s->udev = udev_new(); - if (!s->udev) - return -ENOMEM; - - s->rate_limit = journal_rate_limit_new(s->rate_limit_interval, s->rate_limit_burst); - if (!s->rate_limit) - return -ENOMEM; - - r = cg_get_root_path(&s->cgroup_root); - if (r < 0) - return r; - - server_cache_hostname(s); - server_cache_boot_id(s); - server_cache_machine_id(s); - - (void) server_connect_notify(s); - - return system_journal_open(s, false); -} - -void server_maybe_append_tags(Server *s) { -#ifdef HAVE_GCRYPT - JournalFile *f; - Iterator i; - usec_t n; - - n = now(CLOCK_REALTIME); - - if (s->system_journal) - journal_file_maybe_append_tag(s->system_journal, n); - - ORDERED_HASHMAP_FOREACH(f, s->user_journals, i) - journal_file_maybe_append_tag(f, n); -#endif -} - -void server_done(Server *s) { - JournalFile *f; - assert(s); - - if (s->deferred_closes) { - journal_file_close_set(s->deferred_closes); - set_free(s->deferred_closes); - } - - while (s->stdout_streams) - stdout_stream_free(s->stdout_streams); - - if (s->system_journal) - (void) journal_file_close(s->system_journal); - - if (s->runtime_journal) - (void) journal_file_close(s->runtime_journal); - - while ((f = ordered_hashmap_steal_first(s->user_journals))) - (void) journal_file_close(f); - - ordered_hashmap_free(s->user_journals); - - sd_event_source_unref(s->syslog_event_source); - sd_event_source_unref(s->native_event_source); - sd_event_source_unref(s->stdout_event_source); - sd_event_source_unref(s->dev_kmsg_event_source); - sd_event_source_unref(s->audit_event_source); - sd_event_source_unref(s->sync_event_source); - sd_event_source_unref(s->sigusr1_event_source); - sd_event_source_unref(s->sigusr2_event_source); - sd_event_source_unref(s->sigterm_event_source); - sd_event_source_unref(s->sigint_event_source); - sd_event_source_unref(s->sigrtmin1_event_source); - sd_event_source_unref(s->hostname_event_source); - sd_event_source_unref(s->notify_event_source); - sd_event_source_unref(s->watchdog_event_source); - sd_event_unref(s->event); - - safe_close(s->syslog_fd); - safe_close(s->native_fd); - safe_close(s->stdout_fd); - safe_close(s->dev_kmsg_fd); - safe_close(s->audit_fd); - safe_close(s->hostname_fd); - safe_close(s->notify_fd); - - if (s->rate_limit) - journal_rate_limit_free(s->rate_limit); - - if (s->kernel_seqnum) - munmap(s->kernel_seqnum, sizeof(uint64_t)); - - free(s->buffer); - free(s->tty_path); - free(s->cgroup_root); - free(s->hostname_field); - - if (s->mmap) - mmap_cache_unref(s->mmap); - - udev_unref(s->udev); -} - -static const char* const storage_table[_STORAGE_MAX] = { - [STORAGE_AUTO] = "auto", - [STORAGE_VOLATILE] = "volatile", - [STORAGE_PERSISTENT] = "persistent", - [STORAGE_NONE] = "none" -}; - -DEFINE_STRING_TABLE_LOOKUP(storage, Storage); -DEFINE_CONFIG_PARSE_ENUM(config_parse_storage, storage, Storage, "Failed to parse storage setting"); - -static const char* const split_mode_table[_SPLIT_MAX] = { - [SPLIT_LOGIN] = "login", - [SPLIT_UID] = "uid", - [SPLIT_NONE] = "none", -}; - -DEFINE_STRING_TABLE_LOOKUP(split_mode, SplitMode); -DEFINE_CONFIG_PARSE_ENUM(config_parse_split_mode, split_mode, SplitMode, "Failed to parse split mode setting"); diff --git a/src/grp-journal/libjournal-core/journald-server.h b/src/grp-journal/libjournal-core/journald-server.h deleted file mode 100644 index 5f1af1e50b..0000000000 --- a/src/grp-journal/libjournal-core/journald-server.h +++ /dev/null @@ -1,187 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#include - -#include "basic/hashmap.h" -#include "basic/list.h" -#include "sd-journal/journal-file.h" - -typedef struct Server Server; - -#include "journald-rate-limit.h" -#include "journald-stream.h" - -typedef enum Storage { - STORAGE_AUTO, - STORAGE_VOLATILE, - STORAGE_PERSISTENT, - STORAGE_NONE, - _STORAGE_MAX, - _STORAGE_INVALID = -1 -} Storage; - -typedef enum SplitMode { - SPLIT_UID, - SPLIT_LOGIN, - SPLIT_NONE, - _SPLIT_MAX, - _SPLIT_INVALID = -1 -} SplitMode; - -struct Server { - int syslog_fd; - int native_fd; - int stdout_fd; - int dev_kmsg_fd; - int audit_fd; - int hostname_fd; - int notify_fd; - - sd_event *event; - - sd_event_source *syslog_event_source; - sd_event_source *native_event_source; - sd_event_source *stdout_event_source; - sd_event_source *dev_kmsg_event_source; - sd_event_source *audit_event_source; - sd_event_source *sync_event_source; - sd_event_source *sigusr1_event_source; - sd_event_source *sigusr2_event_source; - sd_event_source *sigterm_event_source; - sd_event_source *sigint_event_source; - sd_event_source *sigrtmin1_event_source; - sd_event_source *hostname_event_source; - sd_event_source *notify_event_source; - sd_event_source *watchdog_event_source; - - JournalFile *runtime_journal; - JournalFile *system_journal; - OrderedHashmap *user_journals; - - uint64_t seqnum; - - char *buffer; - size_t buffer_size; - - JournalRateLimit *rate_limit; - usec_t sync_interval_usec; - usec_t rate_limit_interval; - unsigned rate_limit_burst; - - JournalMetrics runtime_metrics; - JournalMetrics system_metrics; - - bool compress; - bool seal; - - bool forward_to_kmsg; - bool forward_to_syslog; - bool forward_to_console; - bool forward_to_wall; - - unsigned n_forward_syslog_missed; - usec_t last_warn_forward_syslog_missed; - - uint64_t cached_space_available; - uint64_t cached_space_limit; - usec_t cached_space_timestamp; - - uint64_t var_available_timestamp; - - usec_t max_retention_usec; - usec_t max_file_usec; - usec_t oldest_file_usec; - - LIST_HEAD(StdoutStream, stdout_streams); - LIST_HEAD(StdoutStream, stdout_streams_notify_queue); - unsigned n_stdout_streams; - - char *tty_path; - - int max_level_store; - int max_level_syslog; - int max_level_kmsg; - int max_level_console; - int max_level_wall; - - Storage storage; - SplitMode split_mode; - - MMapCache *mmap; - - Set *deferred_closes; - - struct udev *udev; - - uint64_t *kernel_seqnum; - bool dev_kmsg_readable:1; - - bool send_watchdog:1; - bool sent_notify_ready:1; - bool sync_scheduled:1; - - char machine_id_field[sizeof("_MACHINE_ID=") + 32]; - char boot_id_field[sizeof("_BOOT_ID=") + 32]; - char *hostname_field; - - /* Cached cgroup root, so that we don't have to query that all the time */ - char *cgroup_root; - - usec_t watchdog_usec; -}; - -#define SERVER_MACHINE_ID(s) ((s)->machine_id_field + strlen("_MACHINE_ID=")) - -#define N_IOVEC_META_FIELDS 20 -#define N_IOVEC_KERNEL_FIELDS 64 -#define N_IOVEC_UDEV_FIELDS 32 -#define N_IOVEC_OBJECT_FIELDS 12 -#define N_IOVEC_PAYLOAD_FIELDS 15 - -void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigned m, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len, const char *unit_id, int priority, pid_t object_pid); -void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) _printf_(3,0) _sentinel_; - -/* gperf lookup function */ -const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length); - -int config_parse_storage(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); - -const char *storage_to_string(Storage s) _const_; -Storage storage_from_string(const char *s) _pure_; - -int config_parse_split_mode(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); - -const char *split_mode_to_string(SplitMode s) _const_; -SplitMode split_mode_from_string(const char *s) _pure_; - -int server_init(Server *s); -void server_done(Server *s); -void server_sync(Server *s); -int server_vacuum(Server *s, bool verbose, bool patch_min_use); -void server_rotate(Server *s); -int server_schedule_sync(Server *s, int priority); -int server_flush_to_var(Server *s); -void server_maybe_append_tags(Server *s); -int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata); diff --git a/src/grp-journal/libjournal-core/journald-stream.c b/src/grp-journal/libjournal-core/journald-stream.c deleted file mode 100644 index e90dfac1cd..0000000000 --- a/src/grp-journal/libjournal-core/journald-stream.c +++ /dev/null @@ -1,786 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#ifdef HAVE_SELINUX -#include -#endif - -#include -#include - -#include "basic/alloc-util.h" -#include "basic/dirent-util.h" -#include "basic/escape.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/io-util.h" -#include "basic/mkdir.h" -#include "basic/parse-util.h" -#include "basic/selinux-util.h" -#include "basic/socket-util.h" -#include "basic/stdio-util.h" -#include "basic/string-util.h" -#include "basic/syslog-util.h" - -#include "journald-console.h" -#include "journald-kmsg.h" -#include "journald-server.h" -#include "journald-stream.h" -#include "journald-syslog.h" -#include "journald-wall.h" - -#define STDOUT_STREAMS_MAX 4096 - -typedef enum StdoutStreamState { - STDOUT_STREAM_IDENTIFIER, - STDOUT_STREAM_UNIT_ID, - STDOUT_STREAM_PRIORITY, - STDOUT_STREAM_LEVEL_PREFIX, - STDOUT_STREAM_FORWARD_TO_SYSLOG, - STDOUT_STREAM_FORWARD_TO_KMSG, - STDOUT_STREAM_FORWARD_TO_CONSOLE, - STDOUT_STREAM_RUNNING -} StdoutStreamState; - -struct StdoutStream { - Server *server; - StdoutStreamState state; - - int fd; - - struct ucred ucred; - char *label; - char *identifier; - char *unit_id; - int priority; - bool level_prefix:1; - bool forward_to_syslog:1; - bool forward_to_kmsg:1; - bool forward_to_console:1; - - bool fdstore:1; - bool in_notify_queue:1; - - char buffer[LINE_MAX+1]; - size_t length; - - sd_event_source *event_source; - - char *state_file; - - LIST_FIELDS(StdoutStream, stdout_stream); - LIST_FIELDS(StdoutStream, stdout_stream_notify_queue); -}; - -void stdout_stream_free(StdoutStream *s) { - if (!s) - return; - - if (s->server) { - assert(s->server->n_stdout_streams > 0); - s->server->n_stdout_streams--; - LIST_REMOVE(stdout_stream, s->server->stdout_streams, s); - - if (s->in_notify_queue) - LIST_REMOVE(stdout_stream_notify_queue, s->server->stdout_streams_notify_queue, s); - } - - if (s->event_source) { - sd_event_source_set_enabled(s->event_source, SD_EVENT_OFF); - s->event_source = sd_event_source_unref(s->event_source); - } - - safe_close(s->fd); - free(s->label); - free(s->identifier); - free(s->unit_id); - free(s->state_file); - - free(s); -} - -DEFINE_TRIVIAL_CLEANUP_FUNC(StdoutStream*, stdout_stream_free); - -static void stdout_stream_destroy(StdoutStream *s) { - if (!s) - return; - - if (s->state_file) - (void) unlink(s->state_file); - - stdout_stream_free(s); -} - -static int stdout_stream_save(StdoutStream *s) { - _cleanup_free_ char *temp_path = NULL; - _cleanup_fclose_ FILE *f = NULL; - int r; - - assert(s); - - if (s->state != STDOUT_STREAM_RUNNING) - return 0; - - if (!s->state_file) { - struct stat st; - - r = fstat(s->fd, &st); - if (r < 0) - return log_warning_errno(errno, "Failed to stat connected stream: %m"); - - /* We use device and inode numbers as identifier for the stream */ - if (asprintf(&s->state_file, "/run/systemd/journal/streams/%lu:%lu", (unsigned long) st.st_dev, (unsigned long) st.st_ino) < 0) - return log_oom(); - } - - mkdir_p("/run/systemd/journal/streams", 0755); - - r = fopen_temporary(s->state_file, &f, &temp_path); - if (r < 0) - goto fail; - - fprintf(f, - "# This is private data. Do not parse\n" - "PRIORITY=%i\n" - "LEVEL_PREFIX=%i\n" - "FORWARD_TO_SYSLOG=%i\n" - "FORWARD_TO_KMSG=%i\n" - "FORWARD_TO_CONSOLE=%i\n", - s->priority, - s->level_prefix, - s->forward_to_syslog, - s->forward_to_kmsg, - s->forward_to_console); - - if (!isempty(s->identifier)) { - _cleanup_free_ char *escaped; - - escaped = cescape(s->identifier); - if (!escaped) { - r = -ENOMEM; - goto fail; - } - - fprintf(f, "IDENTIFIER=%s\n", escaped); - } - - if (!isempty(s->unit_id)) { - _cleanup_free_ char *escaped; - - escaped = cescape(s->unit_id); - if (!escaped) { - r = -ENOMEM; - goto fail; - } - - fprintf(f, "UNIT=%s\n", escaped); - } - - r = fflush_and_check(f); - if (r < 0) - goto fail; - - if (rename(temp_path, s->state_file) < 0) { - r = -errno; - goto fail; - } - - if (!s->fdstore && !s->in_notify_queue) { - LIST_PREPEND(stdout_stream_notify_queue, s->server->stdout_streams_notify_queue, s); - s->in_notify_queue = true; - - if (s->server->notify_event_source) { - r = sd_event_source_set_enabled(s->server->notify_event_source, SD_EVENT_ON); - if (r < 0) - log_warning_errno(r, "Failed to enable notify event source: %m"); - } - } - - return 0; - -fail: - (void) unlink(s->state_file); - - if (temp_path) - (void) unlink(temp_path); - - return log_error_errno(r, "Failed to save stream data %s: %m", s->state_file); -} - -static int stdout_stream_log(StdoutStream *s, const char *p) { - struct iovec iovec[N_IOVEC_META_FIELDS + 5]; - int priority; - char syslog_priority[] = "PRIORITY=\0"; - char syslog_facility[sizeof("SYSLOG_FACILITY=")-1 + DECIMAL_STR_MAX(int) + 1]; - _cleanup_free_ char *message = NULL, *syslog_identifier = NULL; - unsigned n = 0; - size_t label_len; - - assert(s); - assert(p); - - priority = s->priority; - - if (s->level_prefix) - syslog_parse_priority(&p, &priority, false); - - if (isempty(p)) - return 0; - - if (s->forward_to_syslog || s->server->forward_to_syslog) - server_forward_syslog(s->server, syslog_fixup_facility(priority), s->identifier, p, &s->ucred, NULL); - - if (s->forward_to_kmsg || s->server->forward_to_kmsg) - server_forward_kmsg(s->server, priority, s->identifier, p, &s->ucred); - - if (s->forward_to_console || s->server->forward_to_console) - server_forward_console(s->server, priority, s->identifier, p, &s->ucred); - - if (s->server->forward_to_wall) - server_forward_wall(s->server, priority, s->identifier, p, &s->ucred); - - IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=stdout"); - - syslog_priority[strlen("PRIORITY=")] = '0' + LOG_PRI(priority); - IOVEC_SET_STRING(iovec[n++], syslog_priority); - - if (priority & LOG_FACMASK) { - xsprintf(syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)); - IOVEC_SET_STRING(iovec[n++], syslog_facility); - } - - if (s->identifier) { - syslog_identifier = strappend("SYSLOG_IDENTIFIER=", s->identifier); - if (syslog_identifier) - IOVEC_SET_STRING(iovec[n++], syslog_identifier); - } - - message = strappend("MESSAGE=", p); - if (message) - IOVEC_SET_STRING(iovec[n++], message); - - label_len = s->label ? strlen(s->label) : 0; - server_dispatch_message(s->server, iovec, n, ELEMENTSOF(iovec), &s->ucred, NULL, s->label, label_len, s->unit_id, priority, 0); - return 0; -} - -static int stdout_stream_line(StdoutStream *s, char *p) { - int r; - char *orig; - - assert(s); - assert(p); - - orig = p; - p = strstrip(p); - - switch (s->state) { - - case STDOUT_STREAM_IDENTIFIER: - if (isempty(p)) - s->identifier = NULL; - else { - s->identifier = strdup(p); - if (!s->identifier) - return log_oom(); - } - - s->state = STDOUT_STREAM_UNIT_ID; - return 0; - - case STDOUT_STREAM_UNIT_ID: - if (s->ucred.uid == 0) { - if (isempty(p)) - s->unit_id = NULL; - else { - s->unit_id = strdup(p); - if (!s->unit_id) - return log_oom(); - } - } - - s->state = STDOUT_STREAM_PRIORITY; - return 0; - - case STDOUT_STREAM_PRIORITY: - r = safe_atoi(p, &s->priority); - if (r < 0 || s->priority < 0 || s->priority > 999) { - log_warning("Failed to parse log priority line."); - return -EINVAL; - } - - s->state = STDOUT_STREAM_LEVEL_PREFIX; - return 0; - - case STDOUT_STREAM_LEVEL_PREFIX: - r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse level prefix line."); - return -EINVAL; - } - - s->level_prefix = !!r; - s->state = STDOUT_STREAM_FORWARD_TO_SYSLOG; - return 0; - - case STDOUT_STREAM_FORWARD_TO_SYSLOG: - r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse forward to syslog line."); - return -EINVAL; - } - - s->forward_to_syslog = !!r; - s->state = STDOUT_STREAM_FORWARD_TO_KMSG; - return 0; - - case STDOUT_STREAM_FORWARD_TO_KMSG: - r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse copy to kmsg line."); - return -EINVAL; - } - - s->forward_to_kmsg = !!r; - s->state = STDOUT_STREAM_FORWARD_TO_CONSOLE; - return 0; - - case STDOUT_STREAM_FORWARD_TO_CONSOLE: - r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse copy to console line."); - return -EINVAL; - } - - s->forward_to_console = !!r; - s->state = STDOUT_STREAM_RUNNING; - - /* Try to save the stream, so that journald can be restarted and we can recover */ - (void) stdout_stream_save(s); - return 0; - - case STDOUT_STREAM_RUNNING: - return stdout_stream_log(s, orig); - } - - assert_not_reached("Unknown stream state"); -} - -static int stdout_stream_scan(StdoutStream *s, bool force_flush) { - char *p; - size_t remaining; - int r; - - assert(s); - - p = s->buffer; - remaining = s->length; - for (;;) { - char *end; - size_t skip; - - end = memchr(p, '\n', remaining); - if (end) - skip = end - p + 1; - else if (remaining >= sizeof(s->buffer) - 1) { - end = p + sizeof(s->buffer) - 1; - skip = remaining; - } else - break; - - *end = 0; - - r = stdout_stream_line(s, p); - if (r < 0) - return r; - - remaining -= skip; - p += skip; - } - - if (force_flush && remaining > 0) { - p[remaining] = 0; - r = stdout_stream_line(s, p); - if (r < 0) - return r; - - p += remaining; - remaining = 0; - } - - if (p > s->buffer) { - memmove(s->buffer, p, remaining); - s->length = remaining; - } - - return 0; -} - -static int stdout_stream_process(sd_event_source *es, int fd, uint32_t revents, void *userdata) { - StdoutStream *s = userdata; - ssize_t l; - int r; - - assert(s); - - if ((revents|EPOLLIN|EPOLLHUP) != (EPOLLIN|EPOLLHUP)) { - log_error("Got invalid event from epoll for stdout stream: %"PRIx32, revents); - goto terminate; - } - - l = read(s->fd, s->buffer+s->length, sizeof(s->buffer)-1-s->length); - if (l < 0) { - - if (errno == EAGAIN) - return 0; - - log_warning_errno(errno, "Failed to read from stream: %m"); - goto terminate; - } - - if (l == 0) { - stdout_stream_scan(s, true); - goto terminate; - } - - s->length += l; - r = stdout_stream_scan(s, false); - if (r < 0) - goto terminate; - - return 1; - -terminate: - stdout_stream_destroy(s); - return 0; -} - -static int stdout_stream_install(Server *s, int fd, StdoutStream **ret) { - _cleanup_(stdout_stream_freep) StdoutStream *stream = NULL; - int r; - - assert(s); - assert(fd >= 0); - - stream = new0(StdoutStream, 1); - if (!stream) - return log_oom(); - - stream->fd = -1; - stream->priority = LOG_INFO; - - r = getpeercred(fd, &stream->ucred); - if (r < 0) - return log_error_errno(r, "Failed to determine peer credentials: %m"); - - if (mac_selinux_have()) { - r = getpeersec(fd, &stream->label); - if (r < 0 && r != -EOPNOTSUPP) - (void) log_warning_errno(r, "Failed to determine peer security context: %m"); - } - - (void) shutdown(fd, SHUT_WR); - - r = sd_event_add_io(s->event, &stream->event_source, fd, EPOLLIN, stdout_stream_process, stream); - if (r < 0) - return log_error_errno(r, "Failed to add stream to event loop: %m"); - - r = sd_event_source_set_priority(stream->event_source, SD_EVENT_PRIORITY_NORMAL+5); - if (r < 0) - return log_error_errno(r, "Failed to adjust stdout event source priority: %m"); - - stream->fd = fd; - - stream->server = s; - LIST_PREPEND(stdout_stream, s->stdout_streams, stream); - s->n_stdout_streams++; - - if (ret) - *ret = stream; - - stream = NULL; - - return 0; -} - -static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revents, void *userdata) { - _cleanup_close_ int fd = -1; - Server *s = userdata; - int r; - - assert(s); - - if (revents != EPOLLIN) { - log_error("Got invalid event from epoll for stdout server fd: %"PRIx32, revents); - return -EIO; - } - - fd = accept4(s->stdout_fd, NULL, NULL, SOCK_NONBLOCK|SOCK_CLOEXEC); - if (fd < 0) { - if (errno == EAGAIN) - return 0; - - return log_error_errno(errno, "Failed to accept stdout connection: %m"); - } - - if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) { - log_warning("Too many stdout streams, refusing connection."); - return 0; - } - - r = stdout_stream_install(s, fd, NULL); - if (r < 0) - return r; - - fd = -1; - return 0; -} - -static int stdout_stream_load(StdoutStream *stream, const char *fname) { - _cleanup_free_ char - *priority = NULL, - *level_prefix = NULL, - *forward_to_syslog = NULL, - *forward_to_kmsg = NULL, - *forward_to_console = NULL; - int r; - - assert(stream); - assert(fname); - - if (!stream->state_file) { - stream->state_file = strappend("/run/systemd/journal/streams/", fname); - if (!stream->state_file) - return log_oom(); - } - - r = parse_env_file(stream->state_file, NEWLINE, - "PRIORITY", &priority, - "LEVEL_PREFIX", &level_prefix, - "FORWARD_TO_SYSLOG", &forward_to_syslog, - "FORWARD_TO_KMSG", &forward_to_kmsg, - "FORWARD_TO_CONSOLE", &forward_to_console, - "IDENTIFIER", &stream->identifier, - "UNIT", &stream->unit_id, - NULL); - if (r < 0) - return log_error_errno(r, "Failed to read: %s", stream->state_file); - - if (priority) { - int p; - - p = log_level_from_string(priority); - if (p >= 0) - stream->priority = p; - } - - if (level_prefix) { - r = parse_boolean(level_prefix); - if (r >= 0) - stream->level_prefix = r; - } - - if (forward_to_syslog) { - r = parse_boolean(forward_to_syslog); - if (r >= 0) - stream->forward_to_syslog = r; - } - - if (forward_to_kmsg) { - r = parse_boolean(forward_to_kmsg); - if (r >= 0) - stream->forward_to_kmsg = r; - } - - if (forward_to_console) { - r = parse_boolean(forward_to_console); - if (r >= 0) - stream->forward_to_console = r; - } - - return 0; -} - -static int stdout_stream_restore(Server *s, const char *fname, int fd) { - StdoutStream *stream; - int r; - - assert(s); - assert(fname); - assert(fd >= 0); - - if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) { - log_warning("Too many stdout streams, refusing restoring of stream."); - return -ENOBUFS; - } - - r = stdout_stream_install(s, fd, &stream); - if (r < 0) - return r; - - stream->state = STDOUT_STREAM_RUNNING; - stream->fdstore = true; - - /* Ignore all parsing errors */ - (void) stdout_stream_load(stream, fname); - - return 0; -} - -int server_restore_streams(Server *s, FDSet *fds) { - _cleanup_closedir_ DIR *d = NULL; - struct dirent *de; - int r; - - d = opendir("/run/systemd/journal/streams"); - if (!d) { - if (errno == ENOENT) - return 0; - - return log_warning_errno(errno, "Failed to enumerate /run/systemd/journal/streams: %m"); - } - - FOREACH_DIRENT(de, d, goto fail) { - unsigned long st_dev, st_ino; - bool found = false; - Iterator i; - int fd; - - if (sscanf(de->d_name, "%lu:%lu", &st_dev, &st_ino) != 2) - continue; - - FDSET_FOREACH(fd, fds, i) { - struct stat st; - - if (fstat(fd, &st) < 0) - return log_error_errno(errno, "Failed to stat %s: %m", de->d_name); - - if (S_ISSOCK(st.st_mode) && st.st_dev == st_dev && st.st_ino == st_ino) { - found = true; - break; - } - } - - if (!found) { - /* No file descriptor? Then let's delete the state file */ - log_debug("Cannot restore stream file %s", de->d_name); - unlinkat(dirfd(d), de->d_name, 0); - continue; - } - - fdset_remove(fds, fd); - - r = stdout_stream_restore(s, de->d_name, fd); - if (r < 0) - safe_close(fd); - } - - return 0; - -fail: - return log_error_errno(errno, "Failed to read streams directory: %m"); -} - -int server_open_stdout_socket(Server *s) { - static const union sockaddr_union sa = { - .un.sun_family = AF_UNIX, - .un.sun_path = "/run/systemd/journal/stdout", - }; - int r; - - assert(s); - - if (s->stdout_fd < 0) { - s->stdout_fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); - if (s->stdout_fd < 0) - return log_error_errno(errno, "socket() failed: %m"); - - (void) unlink(sa.un.sun_path); - - r = bind(s->stdout_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); - if (r < 0) - return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path); - - (void) chmod(sa.un.sun_path, 0666); - - if (listen(s->stdout_fd, SOMAXCONN) < 0) - return log_error_errno(errno, "listen(%s) failed: %m", sa.un.sun_path); - } else - fd_nonblock(s->stdout_fd, 1); - - r = sd_event_add_io(s->event, &s->stdout_event_source, s->stdout_fd, EPOLLIN, stdout_stream_new, s); - if (r < 0) - return log_error_errno(r, "Failed to add stdout server fd to event source: %m"); - - r = sd_event_source_set_priority(s->stdout_event_source, SD_EVENT_PRIORITY_NORMAL+5); - if (r < 0) - return log_error_errno(r, "Failed to adjust priority of stdout server event source: %m"); - - return 0; -} - -void stdout_stream_send_notify(StdoutStream *s) { - struct iovec iovec = { - .iov_base = (char*) "FDSTORE=1", - .iov_len = strlen("FDSTORE=1"), - }; - struct msghdr msghdr = { - .msg_iov = &iovec, - .msg_iovlen = 1, - }; - struct cmsghdr *cmsg; - ssize_t l; - - assert(s); - assert(!s->fdstore); - assert(s->in_notify_queue); - assert(s->server); - assert(s->server->notify_fd >= 0); - - /* Store the connection fd in PID 1, so that we get it passed - * in again on next start */ - - msghdr.msg_controllen = CMSG_SPACE(sizeof(int)); - msghdr.msg_control = alloca0(msghdr.msg_controllen); - - cmsg = CMSG_FIRSTHDR(&msghdr); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - cmsg->cmsg_len = CMSG_LEN(sizeof(int)); - - memcpy(CMSG_DATA(cmsg), &s->fd, sizeof(int)); - - l = sendmsg(s->server->notify_fd, &msghdr, MSG_DONTWAIT|MSG_NOSIGNAL); - if (l < 0) { - if (errno == EAGAIN) - return; - - log_error_errno(errno, "Failed to send stream file descriptor to service manager: %m"); - } else { - log_debug("Successfully sent stream file descriptor to service manager."); - s->fdstore = 1; - } - - LIST_REMOVE(stdout_stream_notify_queue, s->server->stdout_streams_notify_queue, s); - s->in_notify_queue = false; - -} diff --git a/src/grp-journal/libjournal-core/journald-stream.h b/src/grp-journal/libjournal-core/journald-stream.h deleted file mode 100644 index fe88cc34f5..0000000000 --- a/src/grp-journal/libjournal-core/journald-stream.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "shared/fdset.h" - -typedef struct StdoutStream StdoutStream; - -#include "journald-server.h" - -int server_open_stdout_socket(Server *s); -int server_restore_streams(Server *s, FDSet *fds); - -void stdout_stream_free(StdoutStream *s); -void stdout_stream_send_notify(StdoutStream *s); diff --git a/src/grp-journal/libjournal-core/journald-syslog.c b/src/grp-journal/libjournal-core/journald-syslog.c deleted file mode 100644 index bc793235d4..0000000000 --- a/src/grp-journal/libjournal-core/journald-syslog.c +++ /dev/null @@ -1,455 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include - -#include - -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/formats-util.h" -#include "basic/io-util.h" -#include "basic/process-util.h" -#include "basic/selinux-util.h" -#include "basic/socket-util.h" -#include "basic/stdio-util.h" -#include "basic/string-util.h" -#include "basic/syslog-util.h" - -#include "journald-console.h" -#include "journald-kmsg.h" -#include "journald-server.h" -#include "journald-syslog.h" -#include "journald-wall.h" - -/* Warn once every 30s if we missed syslog message */ -#define WARN_FORWARD_SYSLOG_MISSED_USEC (30 * USEC_PER_SEC) - -static void forward_syslog_iovec(Server *s, const struct iovec *iovec, unsigned n_iovec, const struct ucred *ucred, const struct timeval *tv) { - - static const union sockaddr_union sa = { - .un.sun_family = AF_UNIX, - .un.sun_path = "/run/systemd/journal/syslog", - }; - struct msghdr msghdr = { - .msg_iov = (struct iovec *) iovec, - .msg_iovlen = n_iovec, - .msg_name = (struct sockaddr*) &sa.sa, - .msg_namelen = SOCKADDR_UN_LEN(sa.un), - }; - struct cmsghdr *cmsg; - union { - struct cmsghdr cmsghdr; - uint8_t buf[CMSG_SPACE(sizeof(struct ucred))]; - } control; - - assert(s); - assert(iovec); - assert(n_iovec > 0); - - if (ucred) { - zero(control); - msghdr.msg_control = &control; - msghdr.msg_controllen = sizeof(control); - - cmsg = CMSG_FIRSTHDR(&msghdr); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_CREDENTIALS; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); - memcpy(CMSG_DATA(cmsg), ucred, sizeof(struct ucred)); - msghdr.msg_controllen = cmsg->cmsg_len; - } - - /* Forward the syslog message we received via /dev/log to - * /run/systemd/syslog. Unfortunately we currently can't set - * the SO_TIMESTAMP auxiliary data, and hence we don't. */ - - if (sendmsg(s->syslog_fd, &msghdr, MSG_NOSIGNAL) >= 0) - return; - - /* The socket is full? I guess the syslog implementation is - * too slow, and we shouldn't wait for that... */ - if (errno == EAGAIN) { - s->n_forward_syslog_missed++; - return; - } - - if (ucred && (errno == ESRCH || errno == EPERM)) { - struct ucred u; - - /* Hmm, presumably the sender process vanished - * by now, or we don't have CAP_SYS_AMDIN, so - * let's fix it as good as we can, and retry */ - - u = *ucred; - u.pid = getpid(); - memcpy(CMSG_DATA(cmsg), &u, sizeof(struct ucred)); - - if (sendmsg(s->syslog_fd, &msghdr, MSG_NOSIGNAL) >= 0) - return; - - if (errno == EAGAIN) { - s->n_forward_syslog_missed++; - return; - } - } - - if (errno != ENOENT) - log_debug_errno(errno, "Failed to forward syslog message: %m"); -} - -static void forward_syslog_raw(Server *s, int priority, const char *buffer, const struct ucred *ucred, const struct timeval *tv) { - struct iovec iovec; - - assert(s); - assert(buffer); - - if (LOG_PRI(priority) > s->max_level_syslog) - return; - - IOVEC_SET_STRING(iovec, buffer); - forward_syslog_iovec(s, &iovec, 1, ucred, tv); -} - -void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv) { - struct iovec iovec[5]; - char header_priority[DECIMAL_STR_MAX(priority) + 3], header_time[64], - header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; - int n = 0; - time_t t; - struct tm *tm; - char *ident_buf = NULL; - - assert(s); - assert(priority >= 0); - assert(priority <= 999); - assert(message); - - if (LOG_PRI(priority) > s->max_level_syslog) - return; - - /* First: priority field */ - xsprintf(header_priority, "<%i>", priority); - IOVEC_SET_STRING(iovec[n++], header_priority); - - /* Second: timestamp */ - t = tv ? tv->tv_sec : ((time_t) (now(CLOCK_REALTIME) / USEC_PER_SEC)); - tm = localtime(&t); - if (!tm) - return; - if (strftime(header_time, sizeof(header_time), "%h %e %T ", tm) <= 0) - return; - IOVEC_SET_STRING(iovec[n++], header_time); - - /* Third: identifier and PID */ - if (ucred) { - if (!identifier) { - get_process_comm(ucred->pid, &ident_buf); - identifier = ident_buf; - } - - xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); - - if (identifier) - IOVEC_SET_STRING(iovec[n++], identifier); - - IOVEC_SET_STRING(iovec[n++], header_pid); - } else if (identifier) { - IOVEC_SET_STRING(iovec[n++], identifier); - IOVEC_SET_STRING(iovec[n++], ": "); - } - - /* Fourth: message */ - IOVEC_SET_STRING(iovec[n++], message); - - forward_syslog_iovec(s, iovec, n, ucred, tv); - - free(ident_buf); -} - -int syslog_fixup_facility(int priority) { - - if ((priority & LOG_FACMASK) == 0) - return (priority & LOG_PRIMASK) | LOG_USER; - - return priority; -} - -size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) { - const char *p; - char *t; - size_t l, e; - - assert(buf); - assert(identifier); - assert(pid); - - p = *buf; - - p += strspn(p, WHITESPACE); - l = strcspn(p, WHITESPACE); - - if (l <= 0 || - p[l-1] != ':') - return 0; - - e = l; - l--; - - if (p[l-1] == ']') { - size_t k = l-1; - - for (;;) { - - if (p[k] == '[') { - t = strndup(p+k+1, l-k-2); - if (t) - *pid = t; - - l = k; - break; - } - - if (k == 0) - break; - - k--; - } - } - - t = strndup(p, l); - if (t) - *identifier = t; - - if (strchr(WHITESPACE, p[e])) - e++; - *buf = p + e; - return e; -} - -static void syslog_skip_date(char **buf) { - enum { - LETTER, - SPACE, - NUMBER, - SPACE_OR_NUMBER, - COLON - } sequence[] = { - LETTER, LETTER, LETTER, - SPACE, - SPACE_OR_NUMBER, NUMBER, - SPACE, - SPACE_OR_NUMBER, NUMBER, - COLON, - SPACE_OR_NUMBER, NUMBER, - COLON, - SPACE_OR_NUMBER, NUMBER, - SPACE - }; - - char *p; - unsigned i; - - assert(buf); - assert(*buf); - - p = *buf; - - for (i = 0; i < ELEMENTSOF(sequence); i++, p++) { - - if (!*p) - return; - - switch (sequence[i]) { - - case SPACE: - if (*p != ' ') - return; - break; - - case SPACE_OR_NUMBER: - if (*p == ' ') - break; - - /* fall through */ - - case NUMBER: - if (*p < '0' || *p > '9') - return; - - break; - - case LETTER: - if (!(*p >= 'A' && *p <= 'Z') && - !(*p >= 'a' && *p <= 'z')) - return; - - break; - - case COLON: - if (*p != ':') - return; - break; - - } - } - - *buf = p; -} - -void server_process_syslog_message( - Server *s, - const char *buf, - const struct ucred *ucred, - const struct timeval *tv, - const char *label, - size_t label_len) { - - char syslog_priority[sizeof("PRIORITY=") + DECIMAL_STR_MAX(int)], - syslog_facility[sizeof("SYSLOG_FACILITY=") + DECIMAL_STR_MAX(int)]; - const char *message = NULL, *syslog_identifier = NULL, *syslog_pid = NULL; - struct iovec iovec[N_IOVEC_META_FIELDS + 6]; - unsigned n = 0; - int priority = LOG_USER | LOG_INFO; - _cleanup_free_ char *identifier = NULL, *pid = NULL; - const char *orig; - - assert(s); - assert(buf); - - orig = buf; - syslog_parse_priority(&buf, &priority, true); - - if (s->forward_to_syslog) - forward_syslog_raw(s, priority, orig, ucred, tv); - - syslog_skip_date((char**) &buf); - syslog_parse_identifier(&buf, &identifier, &pid); - - if (s->forward_to_kmsg) - server_forward_kmsg(s, priority, identifier, buf, ucred); - - if (s->forward_to_console) - server_forward_console(s, priority, identifier, buf, ucred); - - if (s->forward_to_wall) - server_forward_wall(s, priority, identifier, buf, ucred); - - IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=syslog"); - - xsprintf(syslog_priority, "PRIORITY=%i", priority & LOG_PRIMASK); - IOVEC_SET_STRING(iovec[n++], syslog_priority); - - if (priority & LOG_FACMASK) { - xsprintf(syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)); - IOVEC_SET_STRING(iovec[n++], syslog_facility); - } - - if (identifier) { - syslog_identifier = strjoina("SYSLOG_IDENTIFIER=", identifier); - IOVEC_SET_STRING(iovec[n++], syslog_identifier); - } - - if (pid) { - syslog_pid = strjoina("SYSLOG_PID=", pid); - IOVEC_SET_STRING(iovec[n++], syslog_pid); - } - - message = strjoina("MESSAGE=", buf); - if (message) - IOVEC_SET_STRING(iovec[n++], message); - - server_dispatch_message(s, iovec, n, ELEMENTSOF(iovec), ucred, tv, label, label_len, NULL, priority, 0); -} - -int server_open_syslog_socket(Server *s) { - - static const union sockaddr_union sa = { - .un.sun_family = AF_UNIX, - .un.sun_path = "/run/systemd/journal/dev-log", - }; - static const int one = 1; - int r; - - assert(s); - - if (s->syslog_fd < 0) { - s->syslog_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); - if (s->syslog_fd < 0) - return log_error_errno(errno, "socket() failed: %m"); - - (void) unlink(sa.un.sun_path); - - r = bind(s->syslog_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); - if (r < 0) - return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path); - - (void) chmod(sa.un.sun_path, 0666); - } else - fd_nonblock(s->syslog_fd, 1); - - r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); - if (r < 0) - return log_error_errno(errno, "SO_PASSCRED failed: %m"); - -#ifdef HAVE_SELINUX - if (mac_selinux_have()) { - r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one)); - if (r < 0) - log_warning_errno(errno, "SO_PASSSEC failed: %m"); - } -#endif - - r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)); - if (r < 0) - return log_error_errno(errno, "SO_TIMESTAMP failed: %m"); - - r = sd_event_add_io(s->event, &s->syslog_event_source, s->syslog_fd, EPOLLIN, server_process_datagram, s); - if (r < 0) - return log_error_errno(r, "Failed to add syslog server fd to event loop: %m"); - - r = sd_event_source_set_priority(s->syslog_event_source, SD_EVENT_PRIORITY_NORMAL+5); - if (r < 0) - return log_error_errno(r, "Failed to adjust syslog event source priority: %m"); - - return 0; -} - -void server_maybe_warn_forward_syslog_missed(Server *s) { - usec_t n; - - assert(s); - - if (s->n_forward_syslog_missed <= 0) - return; - - n = now(CLOCK_MONOTONIC); - if (s->last_warn_forward_syslog_missed + WARN_FORWARD_SYSLOG_MISSED_USEC > n) - return; - - server_driver_message(s, SD_MESSAGE_FORWARD_SYSLOG_MISSED, - LOG_MESSAGE("Forwarding to syslog missed %u messages.", - s->n_forward_syslog_missed), - NULL); - - s->n_forward_syslog_missed = 0; - s->last_warn_forward_syslog_missed = n; -} diff --git a/src/grp-journal/libjournal-core/journald-syslog.h b/src/grp-journal/libjournal-core/journald-syslog.h deleted file mode 100644 index 46ad715314..0000000000 --- a/src/grp-journal/libjournal-core/journald-syslog.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "journald-server.h" - -int syslog_fixup_facility(int priority) _const_; - -size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid); - -void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv); - -void server_process_syslog_message(Server *s, const char *buf, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); -int server_open_syslog_socket(Server *s); - -void server_maybe_warn_forward_syslog_missed(Server *s); diff --git a/src/grp-journal/libjournal-core/journald-wall.c b/src/grp-journal/libjournal-core/journald-wall.c deleted file mode 100644 index 0c816de55f..0000000000 --- a/src/grp-journal/libjournal-core/journald-wall.c +++ /dev/null @@ -1,72 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2014 Sebastian Thorarensen - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "basic/alloc-util.h" -#include "basic/formats-util.h" -#include "basic/process-util.h" -#include "basic/string-util.h" -#include "shared/utmp-wtmp.h" - -#include "journald-server.h" -#include "journald-wall.h" - -void server_forward_wall( - Server *s, - int priority, - const char *identifier, - const char *message, - const struct ucred *ucred) { - - _cleanup_free_ char *ident_buf = NULL, *l_buf = NULL; - const char *l; - int r; - - assert(s); - assert(message); - - if (LOG_PRI(priority) > s->max_level_wall) - return; - - if (ucred) { - if (!identifier) { - get_process_comm(ucred->pid, &ident_buf); - identifier = ident_buf; - } - - if (asprintf(&l_buf, "%s["PID_FMT"]: %s", strempty(identifier), ucred->pid, message) < 0) { - log_oom(); - return; - } - - l = l_buf; - - } else if (identifier) { - - l = l_buf = strjoin(identifier, ": ", message, NULL); - if (!l_buf) { - log_oom(); - return; - } - } else - l = message; - - r = utmp_wall(l, "systemd-journald", NULL, NULL, NULL); - if (r < 0) - log_debug_errno(r, "Failed to send wall message: %m"); -} diff --git a/src/grp-journal/libjournal-core/journald-wall.h b/src/grp-journal/libjournal-core/journald-wall.h deleted file mode 100644 index ebc2b89fa8..0000000000 --- a/src/grp-journal/libjournal-core/journald-wall.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2014 Sebastian Thorarensen - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "journald-server.h" - -void server_forward_wall(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred); diff --git a/src/grp-journal/libjournal-core/src/Makefile b/src/grp-journal/libjournal-core/src/Makefile new file mode 100644 index 0000000000..429c6ddbb7 --- /dev/null +++ b/src/grp-journal/libjournal-core/src/Makefile @@ -0,0 +1,58 @@ +# -*- Mode: makefile; indent-tabs-mode: t -*- +# +# This file is part of systemd. +# +# Copyright 2010-2012 Lennart Poettering +# Copyright 2010-2012 Kay Sievers +# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013 David Strauss +# Copyright 2016 Luke Shumaker +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . +include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +libjournal_core_la_SOURCES = \ + src/journal/journald-kmsg.c \ + src/journal/journald-kmsg.h \ + src/journal/journald-syslog.c \ + src/journal/journald-syslog.h \ + src/journal/journald-stream.c \ + src/journal/journald-stream.h \ + src/journal/journald-server.c \ + src/journal/journald-server.h \ + src/journal/journald-console.c \ + src/journal/journald-console.h \ + src/journal/journald-wall.c \ + src/journal/journald-wall.h \ + src/journal/journald-native.c \ + src/journal/journald-native.h \ + src/journal/journald-audit.c \ + src/journal/journald-audit.h \ + src/journal/journald-rate-limit.c \ + src/journal/journald-rate-limit.h \ + src/journal/journal-internal.h + +nodist_libjournal_core_la_SOURCES = \ + src/journal/journald-gperf.c + +libjournal_core_la_LIBADD = \ + libsystemd-shared.la + +noinst_LTLIBRARIES += \ + libjournal-core.la + +sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-journal/libjournal-core/src/journald-audit.c b/src/grp-journal/libjournal-core/src/journald-audit.c new file mode 100644 index 0000000000..65f925fdc4 --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-audit.c @@ -0,0 +1,564 @@ +/*** + This file is part of systemd. + + Copyright 2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journal-core/journald-audit.h" +#include "sd-journal/audit-type.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/hexdecoct.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/missing.h" +#include "systemd-basic/string-util.h" + +typedef struct MapField { + const char *audit_field; + const char *journal_field; + int (*map)(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov); +} MapField; + +static int map_simple_field(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { + _cleanup_free_ char *c = NULL; + size_t l = 0, allocated = 0; + const char *e; + + assert(field); + assert(p); + assert(iov); + assert(n_iov); + + l = strlen(field); + allocated = l + 1; + c = malloc(allocated); + if (!c) + return -ENOMEM; + + memcpy(c, field, l); + for (e = *p; *e != ' ' && *e != 0; e++) { + if (!GREEDY_REALLOC(c, allocated, l+2)) + return -ENOMEM; + + c[l++] = *e; + } + + c[l] = 0; + + if (!GREEDY_REALLOC(*iov, *n_iov_allocated, *n_iov + 1)) + return -ENOMEM; + + (*iov)[*n_iov].iov_base = c; + (*iov)[*n_iov].iov_len = l; + (*n_iov)++; + + *p = e; + c = NULL; + + return 1; +} + +static int map_string_field_internal(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov, bool filter_printable) { + _cleanup_free_ char *c = NULL; + const char *s, *e; + size_t l; + + assert(field); + assert(p); + assert(iov); + assert(n_iov); + + /* The kernel formats string fields in one of two formats. */ + + if (**p == '"') { + /* Normal quoted syntax */ + s = *p + 1; + e = strchr(s, '"'); + if (!e) + return 0; + + l = strlen(field) + (e - s); + c = malloc(l+1); + if (!c) + return -ENOMEM; + + *((char*) mempcpy(stpcpy(c, field), s, e - s)) = 0; + + e += 1; + + } else if (unhexchar(**p) >= 0) { + /* Hexadecimal escaping */ + size_t allocated = 0; + + l = strlen(field); + allocated = l + 2; + c = malloc(allocated); + if (!c) + return -ENOMEM; + + memcpy(c, field, l); + for (e = *p; *e != ' ' && *e != 0; e += 2) { + int a, b; + uint8_t x; + + a = unhexchar(e[0]); + if (a < 0) + return 0; + + b = unhexchar(e[1]); + if (b < 0) + return 0; + + x = ((uint8_t) a << 4 | (uint8_t) b); + + if (filter_printable && x < (uint8_t) ' ') + x = (uint8_t) ' '; + + if (!GREEDY_REALLOC(c, allocated, l+2)) + return -ENOMEM; + + c[l++] = (char) x; + } + + c[l] = 0; + } else + return 0; + + if (!GREEDY_REALLOC(*iov, *n_iov_allocated, *n_iov + 1)) + return -ENOMEM; + + (*iov)[*n_iov].iov_base = c; + (*iov)[*n_iov].iov_len = l; + (*n_iov)++; + + *p = e; + c = NULL; + + return 1; +} + +static int map_string_field(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { + return map_string_field_internal(field, p, iov, n_iov_allocated, n_iov, false); +} + +static int map_string_field_printable(const char *field, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { + return map_string_field_internal(field, p, iov, n_iov_allocated, n_iov, true); +} + +static int map_generic_field(const char *prefix, const char **p, struct iovec **iov, size_t *n_iov_allocated, unsigned *n_iov) { + const char *e, *f; + char *c, *t; + int r; + + /* Implements fallback mappings for all fields we don't know */ + + for (e = *p; e < *p + 16; e++) { + + if (*e == 0 || *e == ' ') + return 0; + + if (*e == '=') + break; + + if (!((*e >= 'a' && *e <= 'z') || + (*e >= 'A' && *e <= 'Z') || + (*e >= '0' && *e <= '9') || + *e == '_' || *e == '-')) + return 0; + } + + if (e <= *p || e >= *p + 16) + return 0; + + c = alloca(strlen(prefix) + (e - *p) + 2); + + t = stpcpy(c, prefix); + for (f = *p; f < e; f++) { + char x; + + if (*f >= 'a' && *f <= 'z') + x = (*f - 'a') + 'A'; /* uppercase */ + else if (*f == '-') + x = '_'; /* dashes → underscores */ + else + x = *f; + + *(t++) = x; + } + strcpy(t, "="); + + e++; + + r = map_simple_field(c, &e, iov, n_iov_allocated, n_iov); + if (r < 0) + return r; + + *p = e; + return r; +} + +/* Kernel fields are those occurring in the audit string before + * msg='. All of these fields are trusted, hence carry the "_" prefix. + * We try to translate the fields we know into our native names. The + * other's are generically mapped to _AUDIT_FIELD_XYZ= */ +static const MapField map_fields_kernel[] = { + + /* First, we map certain well-known audit fields into native + * well-known fields */ + { "pid=", "_PID=", map_simple_field }, + { "ppid=", "_PPID=", map_simple_field }, + { "uid=", "_UID=", map_simple_field }, + { "euid=", "_EUID=", map_simple_field }, + { "fsuid=", "_FSUID=", map_simple_field }, + { "gid=", "_GID=", map_simple_field }, + { "egid=", "_EGID=", map_simple_field }, + { "fsgid=", "_FSGID=", map_simple_field }, + { "tty=", "_TTY=", map_simple_field }, + { "ses=", "_AUDIT_SESSION=", map_simple_field }, + { "auid=", "_AUDIT_LOGINUID=", map_simple_field }, + { "subj=", "_SELINUX_CONTEXT=", map_simple_field }, + { "comm=", "_COMM=", map_string_field }, + { "exe=", "_EXE=", map_string_field }, + { "proctitle=", "_CMDLINE=", map_string_field_printable }, + + /* Some fields don't map to native well-known fields. However, + * we know that they are string fields, hence let's undo + * string field escaping for them, though we stick to the + * generic field names. */ + { "path=", "_AUDIT_FIELD_PATH=", map_string_field }, + { "dev=", "_AUDIT_FIELD_DEV=", map_string_field }, + { "name=", "_AUDIT_FIELD_NAME=", map_string_field }, + {} +}; + +/* Userspace fields are those occurring in the audit string after + * msg='. All of these fields are untrusted, hence carry no "_" + * prefix. We map the fields we don't know to AUDIT_FIELD_XYZ= */ +static const MapField map_fields_userspace[] = { + { "cwd=", "AUDIT_FIELD_CWD=", map_string_field }, + { "cmd=", "AUDIT_FIELD_CMD=", map_string_field }, + { "acct=", "AUDIT_FIELD_ACCT=", map_string_field }, + { "exe=", "AUDIT_FIELD_EXE=", map_string_field }, + { "comm=", "AUDIT_FIELD_COMM=", map_string_field }, + {} +}; + +static int map_all_fields( + const char *p, + const MapField map_fields[], + const char *prefix, + bool handle_msg, + struct iovec **iov, + size_t *n_iov_allocated, + unsigned *n_iov) { + + int r; + + assert(p); + assert(iov); + assert(n_iov_allocated); + assert(n_iov); + + for (;;) { + bool mapped = false; + const MapField *m; + const char *v; + + p += strspn(p, WHITESPACE); + + if (*p == 0) + return 0; + + if (handle_msg) { + v = startswith(p, "msg='"); + if (v) { + const char *e; + char *c; + + /* Userspace message. It's enclosed in + simple quotation marks, is not + escaped, but the last field in the + line, hence let's remove the + quotation mark, and apply the + userspace mapping instead of the + kernel mapping. */ + + e = endswith(v, "'"); + if (!e) + return 0; /* don't continue splitting up if the final quotation mark is missing */ + + c = strndupa(v, e - v); + return map_all_fields(c, map_fields_userspace, "AUDIT_FIELD_", false, iov, n_iov_allocated, n_iov); + } + } + + /* Try to map the kernel fields to our own names */ + for (m = map_fields; m->audit_field; m++) { + v = startswith(p, m->audit_field); + if (!v) + continue; + + r = m->map(m->journal_field, &v, iov, n_iov_allocated, n_iov); + if (r < 0) + return log_debug_errno(r, "Failed to parse audit array: %m"); + + if (r > 0) { + mapped = true; + p = v; + break; + } + } + + if (!mapped) { + r = map_generic_field(prefix, &p, iov, n_iov_allocated, n_iov); + if (r < 0) + return log_debug_errno(r, "Failed to parse audit array: %m"); + + if (r == 0) + /* Couldn't process as generic field, let's just skip over it */ + p += strcspn(p, WHITESPACE); + } + } +} + +static void process_audit_string(Server *s, int type, const char *data, size_t size) { + _cleanup_free_ struct iovec *iov = NULL; + size_t n_iov_allocated = 0; + unsigned n_iov = 0, k; + uint64_t seconds, msec, id; + const char *p, *type_name; + unsigned z; + char id_field[sizeof("_AUDIT_ID=") + DECIMAL_STR_MAX(uint64_t)], + type_field[sizeof("_AUDIT_TYPE=") + DECIMAL_STR_MAX(int)], + source_time_field[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)]; + char *m; + + assert(s); + + if (size <= 0) + return; + + if (!data) + return; + + /* Note that the input buffer is NUL terminated, but let's + * check whether there is a spurious NUL byte */ + if (memchr(data, 0, size)) + return; + + p = startswith(data, "audit"); + if (!p) + return; + + if (sscanf(p, "(%" PRIu64 ".%" PRIu64 ":%" PRIu64 "):%n", + &seconds, + &msec, + &id, + &k) != 3) + return; + + p += k; + p += strspn(p, WHITESPACE); + + if (isempty(p)) + return; + + n_iov_allocated = N_IOVEC_META_FIELDS + 7; + iov = new(struct iovec, n_iov_allocated); + if (!iov) { + log_oom(); + return; + } + + IOVEC_SET_STRING(iov[n_iov++], "_TRANSPORT=audit"); + + sprintf(source_time_field, "_SOURCE_REALTIME_TIMESTAMP=%" PRIu64, + (usec_t) seconds * USEC_PER_SEC + (usec_t) msec * USEC_PER_MSEC); + IOVEC_SET_STRING(iov[n_iov++], source_time_field); + + sprintf(type_field, "_AUDIT_TYPE=%i", type); + IOVEC_SET_STRING(iov[n_iov++], type_field); + + sprintf(id_field, "_AUDIT_ID=%" PRIu64, id); + IOVEC_SET_STRING(iov[n_iov++], id_field); + + assert_cc(4 == LOG_FAC(LOG_AUTH)); + IOVEC_SET_STRING(iov[n_iov++], "SYSLOG_FACILITY=4"); + IOVEC_SET_STRING(iov[n_iov++], "SYSLOG_IDENTIFIER=audit"); + + type_name = audit_type_name_alloca(type); + + m = strjoina("MESSAGE=", type_name, " ", p); + IOVEC_SET_STRING(iov[n_iov++], m); + + z = n_iov; + + map_all_fields(p, map_fields_kernel, "_AUDIT_FIELD_", true, &iov, &n_iov_allocated, &n_iov); + + if (!GREEDY_REALLOC(iov, n_iov_allocated, n_iov + N_IOVEC_META_FIELDS)) { + log_oom(); + goto finish; + } + + server_dispatch_message(s, iov, n_iov, n_iov_allocated, NULL, NULL, NULL, 0, NULL, LOG_NOTICE, 0); + +finish: + /* free() all entries that map_all_fields() added. All others + * are allocated on the stack or are constant. */ + + for (; z < n_iov; z++) + free(iov[z].iov_base); +} + +void server_process_audit_message( + Server *s, + const void *buffer, + size_t buffer_size, + const struct ucred *ucred, + const union sockaddr_union *sa, + socklen_t salen) { + + const struct nlmsghdr *nl = buffer; + + assert(s); + + if (buffer_size < ALIGN(sizeof(struct nlmsghdr))) + return; + + assert(buffer); + + /* Filter out fake data */ + if (!sa || + salen != sizeof(struct sockaddr_nl) || + sa->nl.nl_family != AF_NETLINK || + sa->nl.nl_pid != 0) { + log_debug("Audit netlink message from invalid sender."); + return; + } + + if (!ucred || ucred->pid != 0) { + log_debug("Audit netlink message with invalid credentials."); + return; + } + + if (!NLMSG_OK(nl, buffer_size)) { + log_error("Audit netlink message truncated."); + return; + } + + /* Ignore special Netlink messages */ + if (IN_SET(nl->nlmsg_type, NLMSG_NOOP, NLMSG_ERROR)) + return; + + /* Below AUDIT_FIRST_USER_MSG theer are only control messages, let's ignore those */ + if (nl->nlmsg_type < AUDIT_FIRST_USER_MSG) + return; + + process_audit_string(s, nl->nlmsg_type, NLMSG_DATA(nl), nl->nlmsg_len - ALIGN(sizeof(struct nlmsghdr))); +} + +static int enable_audit(int fd, bool b) { + struct { + union { + struct nlmsghdr header; + uint8_t header_space[NLMSG_HDRLEN]; + }; + struct audit_status body; + } _packed_ request = { + .header.nlmsg_len = NLMSG_LENGTH(sizeof(struct audit_status)), + .header.nlmsg_type = AUDIT_SET, + .header.nlmsg_flags = NLM_F_REQUEST, + .header.nlmsg_seq = 1, + .header.nlmsg_pid = 0, + .body.mask = AUDIT_STATUS_ENABLED, + .body.enabled = b, + }; + union sockaddr_union sa = { + .nl.nl_family = AF_NETLINK, + .nl.nl_pid = 0, + }; + struct iovec iovec = { + .iov_base = &request, + .iov_len = NLMSG_LENGTH(sizeof(struct audit_status)), + }; + struct msghdr mh = { + .msg_iov = &iovec, + .msg_iovlen = 1, + .msg_name = &sa.sa, + .msg_namelen = sizeof(sa.nl), + }; + + ssize_t n; + + n = sendmsg(fd, &mh, MSG_NOSIGNAL); + if (n < 0) + return -errno; + if (n != NLMSG_LENGTH(sizeof(struct audit_status))) + return -EIO; + + /* We don't wait for the result here, we can't do anything + * about it anyway */ + + return 0; +} + +int server_open_audit(Server *s) { + static const int one = 1; + int r; + + if (s->audit_fd < 0) { + static const union sockaddr_union sa = { + .nl.nl_family = AF_NETLINK, + .nl.nl_pid = 0, + .nl.nl_groups = AUDIT_NLGRP_READLOG, + }; + + s->audit_fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT); + if (s->audit_fd < 0) { + if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) + log_debug("Audit not supported in the kernel."); + else + log_warning_errno(errno, "Failed to create audit socket, ignoring: %m"); + + return 0; + } + + if (bind(s->audit_fd, &sa.sa, sizeof(sa.nl)) < 0) { + log_warning_errno(errno, + "Failed to join audit multicast group. " + "The kernel is probably too old or multicast reading is not supported. " + "Ignoring: %m"); + s->audit_fd = safe_close(s->audit_fd); + return 0; + } + } else + fd_nonblock(s->audit_fd, 1); + + r = setsockopt(s->audit_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); + if (r < 0) + return log_error_errno(errno, "Failed to set SO_PASSCRED on audit socket: %m"); + + r = sd_event_add_io(s->event, &s->audit_event_source, s->audit_fd, EPOLLIN, server_process_datagram, s); + if (r < 0) + return log_error_errno(r, "Failed to add audit fd to event loop: %m"); + + /* We are listening now, try to enable audit */ + r = enable_audit(s->audit_fd, true); + if (r < 0) + log_warning_errno(r, "Failed to issue audit enable call: %m"); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/src/journald-console.c b/src/grp-journal/libjournal-core/src/journald-console.c new file mode 100644 index 0000000000..d6d25841f2 --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-console.c @@ -0,0 +1,115 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include + +#include "journal-core/journald-console.h" +#include "journal-core/journald-server.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/formats-util.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/process-util.h" +#include "systemd-basic/stdio-util.h" +#include "systemd-basic/terminal-util.h" + +static bool prefix_timestamp(void) { + + static int cached_printk_time = -1; + + if (_unlikely_(cached_printk_time < 0)) { + _cleanup_free_ char *p = NULL; + + cached_printk_time = + read_one_line_file("/sys/module/printk/parameters/time", &p) >= 0 + && parse_boolean(p) > 0; + } + + return cached_printk_time; +} + +void server_forward_console( + Server *s, + int priority, + const char *identifier, + const char *message, + const struct ucred *ucred) { + + struct iovec iovec[5]; + struct timespec ts; + char tbuf[sizeof("[] ")-1 + DECIMAL_STR_MAX(ts.tv_sec) + DECIMAL_STR_MAX(ts.tv_nsec)-3 + 1]; + char header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t)]; + int n = 0, fd; + _cleanup_free_ char *ident_buf = NULL; + const char *tty; + + assert(s); + assert(message); + + if (LOG_PRI(priority) > s->max_level_console) + return; + + /* First: timestamp */ + if (prefix_timestamp()) { + assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0); + xsprintf(tbuf, "[%5"PRI_TIME".%06ld] ", + ts.tv_sec, + ts.tv_nsec / 1000); + IOVEC_SET_STRING(iovec[n++], tbuf); + } + + /* Second: identifier and PID */ + if (ucred) { + if (!identifier) { + get_process_comm(ucred->pid, &ident_buf); + identifier = ident_buf; + } + + xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); + + if (identifier) + IOVEC_SET_STRING(iovec[n++], identifier); + + IOVEC_SET_STRING(iovec[n++], header_pid); + } else if (identifier) { + IOVEC_SET_STRING(iovec[n++], identifier); + IOVEC_SET_STRING(iovec[n++], ": "); + } + + /* Fourth: message */ + IOVEC_SET_STRING(iovec[n++], message); + IOVEC_SET_STRING(iovec[n++], "\n"); + + tty = s->tty_path ? s->tty_path : "/dev/console"; + + fd = open_terminal(tty, O_WRONLY|O_NOCTTY|O_CLOEXEC); + if (fd < 0) { + log_debug_errno(fd, "Failed to open %s for logging: %m", tty); + return; + } + + if (writev(fd, iovec, n) < 0) + log_debug_errno(errno, "Failed to write to %s for logging: %m", tty); + + safe_close(fd); +} diff --git a/src/grp-journal/libjournal-core/src/journald-gperf.gperf b/src/grp-journal/libjournal-core/src/journald-gperf.gperf new file mode 100644 index 0000000000..b56872918d --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-gperf.gperf @@ -0,0 +1,47 @@ +%{ +#include +#include + +#include "journal-core/journald-server.h" +#include "systemd-shared/conf-parser.h" +%} +struct ConfigPerfItem; +%null_strings +%language=ANSI-C +%define slot-name section_and_lvalue +%define hash-function-name journald_gperf_hash +%define lookup-function-name journald_gperf_lookup +%readonly-tables +%omit-struct-type +%struct-type +%includes +%% +Journal.Storage, config_parse_storage, 0, offsetof(Server, storage) +Journal.Compress, config_parse_bool, 0, offsetof(Server, compress) +Journal.Seal, config_parse_bool, 0, offsetof(Server, seal) +Journal.SyncIntervalSec, config_parse_sec, 0, offsetof(Server, sync_interval_usec) +# The following is a legacy name for compatibility +Journal.RateLimitInterval, config_parse_sec, 0, offsetof(Server, rate_limit_interval) +Journal.RateLimitIntervalSec,config_parse_sec, 0, offsetof(Server, rate_limit_interval) +Journal.RateLimitBurst, config_parse_unsigned, 0, offsetof(Server, rate_limit_burst) +Journal.SystemMaxUse, config_parse_iec_uint64, 0, offsetof(Server, system_metrics.max_use) +Journal.SystemMaxFileSize, config_parse_iec_uint64, 0, offsetof(Server, system_metrics.max_size) +Journal.SystemKeepFree, config_parse_iec_uint64, 0, offsetof(Server, system_metrics.keep_free) +Journal.SystemMaxFiles, config_parse_uint64, 0, offsetof(Server, system_metrics.n_max_files) +Journal.RuntimeMaxUse, config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.max_use) +Journal.RuntimeMaxFileSize, config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.max_size) +Journal.RuntimeKeepFree, config_parse_iec_uint64, 0, offsetof(Server, runtime_metrics.keep_free) +Journal.RuntimeMaxFiles, config_parse_uint64, 0, offsetof(Server, runtime_metrics.n_max_files) +Journal.MaxRetentionSec, config_parse_sec, 0, offsetof(Server, max_retention_usec) +Journal.MaxFileSec, config_parse_sec, 0, offsetof(Server, max_file_usec) +Journal.ForwardToSyslog, config_parse_bool, 0, offsetof(Server, forward_to_syslog) +Journal.ForwardToKMsg, config_parse_bool, 0, offsetof(Server, forward_to_kmsg) +Journal.ForwardToConsole, config_parse_bool, 0, offsetof(Server, forward_to_console) +Journal.ForwardToWall, config_parse_bool, 0, offsetof(Server, forward_to_wall) +Journal.TTYPath, config_parse_path, 0, offsetof(Server, tty_path) +Journal.MaxLevelStore, config_parse_log_level, 0, offsetof(Server, max_level_store) +Journal.MaxLevelSyslog, config_parse_log_level, 0, offsetof(Server, max_level_syslog) +Journal.MaxLevelKMsg, config_parse_log_level, 0, offsetof(Server, max_level_kmsg) +Journal.MaxLevelConsole, config_parse_log_level, 0, offsetof(Server, max_level_console) +Journal.MaxLevelWall, config_parse_log_level, 0, offsetof(Server, max_level_wall) +Journal.SplitMode, config_parse_split_mode, 0, offsetof(Server, split_mode) diff --git a/src/grp-journal/libjournal-core/src/journald-kmsg.c b/src/grp-journal/libjournal-core/src/journald-kmsg.c new file mode 100644 index 0000000000..598c2d6c80 --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-kmsg.c @@ -0,0 +1,473 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include +#include +#include + +#include +#include + +#include "journal-core/journald-kmsg.h" +#include "journal-core/journald-server.h" +#include "journal-core/journald-syslog.h" +#include "systemd-basic/escape.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/formats-util.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/process-util.h" +#include "systemd-basic/stdio-util.h" +#include "systemd-basic/string-util.h" + +void server_forward_kmsg( + Server *s, + int priority, + const char *identifier, + const char *message, + const struct ucred *ucred) { + + struct iovec iovec[5]; + char header_priority[DECIMAL_STR_MAX(priority) + 3], + header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; + int n = 0; + char *ident_buf = NULL; + + assert(s); + assert(priority >= 0); + assert(priority <= 999); + assert(message); + + if (_unlikely_(LOG_PRI(priority) > s->max_level_kmsg)) + return; + + if (_unlikely_(s->dev_kmsg_fd < 0)) + return; + + /* Never allow messages with kernel facility to be written to + * kmsg, regardless where the data comes from. */ + priority = syslog_fixup_facility(priority); + + /* First: priority field */ + xsprintf(header_priority, "<%i>", priority); + IOVEC_SET_STRING(iovec[n++], header_priority); + + /* Second: identifier and PID */ + if (ucred) { + if (!identifier) { + get_process_comm(ucred->pid, &ident_buf); + identifier = ident_buf; + } + + xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); + + if (identifier) + IOVEC_SET_STRING(iovec[n++], identifier); + + IOVEC_SET_STRING(iovec[n++], header_pid); + } else if (identifier) { + IOVEC_SET_STRING(iovec[n++], identifier); + IOVEC_SET_STRING(iovec[n++], ": "); + } + + /* Fourth: message */ + IOVEC_SET_STRING(iovec[n++], message); + IOVEC_SET_STRING(iovec[n++], "\n"); + + if (writev(s->dev_kmsg_fd, iovec, n) < 0) + log_debug_errno(errno, "Failed to write to /dev/kmsg for logging: %m"); + + free(ident_buf); +} + +static bool is_us(const char *pid) { + pid_t t; + + assert(pid); + + if (parse_pid(pid, &t) < 0) + return false; + + return t == getpid(); +} + +static void dev_kmsg_record(Server *s, const char *p, size_t l) { + struct iovec iovec[N_IOVEC_META_FIELDS + 7 + N_IOVEC_KERNEL_FIELDS + 2 + N_IOVEC_UDEV_FIELDS]; + char *message = NULL, *syslog_priority = NULL, *syslog_pid = NULL, *syslog_facility = NULL, *syslog_identifier = NULL, *source_time = NULL; + int priority, r; + unsigned n = 0, z = 0, j; + unsigned long long usec; + char *identifier = NULL, *pid = NULL, *e, *f, *k; + uint64_t serial; + size_t pl; + char *kernel_device = NULL; + + assert(s); + assert(p); + + if (l <= 0) + return; + + e = memchr(p, ',', l); + if (!e) + return; + *e = 0; + + r = safe_atoi(p, &priority); + if (r < 0 || priority < 0 || priority > 999) + return; + + if (s->forward_to_kmsg && (priority & LOG_FACMASK) != LOG_KERN) + return; + + l -= (e - p) + 1; + p = e + 1; + e = memchr(p, ',', l); + if (!e) + return; + *e = 0; + + r = safe_atou64(p, &serial); + if (r < 0) + return; + + if (s->kernel_seqnum) { + /* We already read this one? */ + if (serial < *s->kernel_seqnum) + return; + + /* Did we lose any? */ + if (serial > *s->kernel_seqnum) + server_driver_message(s, SD_MESSAGE_JOURNAL_MISSED, + LOG_MESSAGE("Missed %"PRIu64" kernel messages", + serial - *s->kernel_seqnum), + NULL); + + /* Make sure we never read this one again. Note that + * we always store the next message serial we expect + * here, simply because this makes handling the first + * message with serial 0 easy. */ + *s->kernel_seqnum = serial + 1; + } + + l -= (e - p) + 1; + p = e + 1; + f = memchr(p, ';', l); + if (!f) + return; + /* Kernel 3.6 has the flags field, kernel 3.5 lacks that */ + e = memchr(p, ',', l); + if (!e || f < e) + e = f; + *e = 0; + + r = safe_atollu(p, &usec); + if (r < 0) + return; + + l -= (f - p) + 1; + p = f + 1; + e = memchr(p, '\n', l); + if (!e) + return; + *e = 0; + + pl = e - p; + l -= (e - p) + 1; + k = e + 1; + + for (j = 0; l > 0 && j < N_IOVEC_KERNEL_FIELDS; j++) { + char *m; + /* Metadata fields attached */ + + if (*k != ' ') + break; + + k++, l--; + + e = memchr(k, '\n', l); + if (!e) + return; + + *e = 0; + + if (cunescape_length_with_prefix(k, e - k, "_KERNEL_", UNESCAPE_RELAX, &m) < 0) + break; + + if (startswith(m, "_KERNEL_DEVICE=")) + kernel_device = m + 15; + + IOVEC_SET_STRING(iovec[n++], m); + z++; + + l -= (e - k) + 1; + k = e + 1; + } + + if (kernel_device) { + struct udev_device *ud; + + ud = udev_device_new_from_device_id(s->udev, kernel_device); + if (ud) { + const char *g; + struct udev_list_entry *ll; + char *b; + + g = udev_device_get_devnode(ud); + if (g) { + b = strappend("_UDEV_DEVNODE=", g); + if (b) { + IOVEC_SET_STRING(iovec[n++], b); + z++; + } + } + + g = udev_device_get_sysname(ud); + if (g) { + b = strappend("_UDEV_SYSNAME=", g); + if (b) { + IOVEC_SET_STRING(iovec[n++], b); + z++; + } + } + + j = 0; + ll = udev_device_get_devlinks_list_entry(ud); + udev_list_entry_foreach(ll, ll) { + + if (j > N_IOVEC_UDEV_FIELDS) + break; + + g = udev_list_entry_get_name(ll); + if (g) { + b = strappend("_UDEV_DEVLINK=", g); + if (b) { + IOVEC_SET_STRING(iovec[n++], b); + z++; + } + } + + j++; + } + + udev_device_unref(ud); + } + } + + if (asprintf(&source_time, "_SOURCE_MONOTONIC_TIMESTAMP=%llu", usec) >= 0) + IOVEC_SET_STRING(iovec[n++], source_time); + + IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=kernel"); + + if (asprintf(&syslog_priority, "PRIORITY=%i", priority & LOG_PRIMASK) >= 0) + IOVEC_SET_STRING(iovec[n++], syslog_priority); + + if (asprintf(&syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)) >= 0) + IOVEC_SET_STRING(iovec[n++], syslog_facility); + + if ((priority & LOG_FACMASK) == LOG_KERN) + IOVEC_SET_STRING(iovec[n++], "SYSLOG_IDENTIFIER=kernel"); + else { + pl -= syslog_parse_identifier((const char**) &p, &identifier, &pid); + + /* Avoid any messages we generated ourselves via + * log_info() and friends. */ + if (pid && is_us(pid)) + goto finish; + + if (identifier) { + syslog_identifier = strappend("SYSLOG_IDENTIFIER=", identifier); + if (syslog_identifier) + IOVEC_SET_STRING(iovec[n++], syslog_identifier); + } + + if (pid) { + syslog_pid = strappend("SYSLOG_PID=", pid); + if (syslog_pid) + IOVEC_SET_STRING(iovec[n++], syslog_pid); + } + } + + if (cunescape_length_with_prefix(p, pl, "MESSAGE=", UNESCAPE_RELAX, &message) >= 0) + IOVEC_SET_STRING(iovec[n++], message); + + server_dispatch_message(s, iovec, n, ELEMENTSOF(iovec), NULL, NULL, NULL, 0, NULL, priority, 0); + +finish: + for (j = 0; j < z; j++) + free(iovec[j].iov_base); + + free(message); + free(syslog_priority); + free(syslog_identifier); + free(syslog_pid); + free(syslog_facility); + free(source_time); + free(identifier); + free(pid); +} + +static int server_read_dev_kmsg(Server *s) { + char buffer[8192+1]; /* the kernel-side limit per record is 8K currently */ + ssize_t l; + + assert(s); + assert(s->dev_kmsg_fd >= 0); + + l = read(s->dev_kmsg_fd, buffer, sizeof(buffer) - 1); + if (l == 0) + return 0; + if (l < 0) { + /* Old kernels who don't allow reading from /dev/kmsg + * return EINVAL when we try. So handle this cleanly, + * but don' try to ever read from it again. */ + if (errno == EINVAL) { + s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source); + return 0; + } + + if (errno == EAGAIN || errno == EINTR || errno == EPIPE) + return 0; + + return log_error_errno(errno, "Failed to read from kernel: %m"); + } + + dev_kmsg_record(s, buffer, l); + return 1; +} + +int server_flush_dev_kmsg(Server *s) { + int r; + + assert(s); + + if (s->dev_kmsg_fd < 0) + return 0; + + if (!s->dev_kmsg_readable) + return 0; + + log_debug("Flushing /dev/kmsg..."); + + for (;;) { + r = server_read_dev_kmsg(s); + if (r < 0) + return r; + + if (r == 0) + break; + } + + return 0; +} + +static int dispatch_dev_kmsg(sd_event_source *es, int fd, uint32_t revents, void *userdata) { + Server *s = userdata; + + assert(es); + assert(fd == s->dev_kmsg_fd); + assert(s); + + if (revents & EPOLLERR) + log_warning("/dev/kmsg buffer overrun, some messages lost."); + + if (!(revents & EPOLLIN)) + log_error("Got invalid event from epoll for /dev/kmsg: %"PRIx32, revents); + + return server_read_dev_kmsg(s); +} + +int server_open_dev_kmsg(Server *s) { + int r; + + assert(s); + + s->dev_kmsg_fd = open("/dev/kmsg", O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); + if (s->dev_kmsg_fd < 0) { + log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, + "Failed to open /dev/kmsg, ignoring: %m"); + return 0; + } + + r = sd_event_add_io(s->event, &s->dev_kmsg_event_source, s->dev_kmsg_fd, EPOLLIN, dispatch_dev_kmsg, s); + if (r < 0) { + + /* This will fail with EPERM on older kernels where + * /dev/kmsg is not readable. */ + if (r == -EPERM) { + r = 0; + goto fail; + } + + log_error_errno(r, "Failed to add /dev/kmsg fd to event loop: %m"); + goto fail; + } + + r = sd_event_source_set_priority(s->dev_kmsg_event_source, SD_EVENT_PRIORITY_IMPORTANT+10); + if (r < 0) { + log_error_errno(r, "Failed to adjust priority of kmsg event source: %m"); + goto fail; + } + + s->dev_kmsg_readable = true; + + return 0; + +fail: + s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source); + s->dev_kmsg_fd = safe_close(s->dev_kmsg_fd); + + return r; +} + +int server_open_kernel_seqnum(Server *s) { + _cleanup_close_ int fd; + uint64_t *p; + int r; + + assert(s); + + /* We store the seqnum we last read in an mmaped file. That + * way we can just use it like a variable, but it is + * persistent and automatically flushed at reboot. */ + + fd = open("/run/systemd/journal/kernel-seqnum", O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, 0644); + if (fd < 0) { + log_error_errno(errno, "Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); + return 0; + } + + r = posix_fallocate(fd, 0, sizeof(uint64_t)); + if (r != 0) { + log_error_errno(r, "Failed to allocate sequential number file, ignoring: %m"); + return 0; + } + + p = mmap(NULL, sizeof(uint64_t), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + if (p == MAP_FAILED) { + log_error_errno(errno, "Failed to map sequential number file, ignoring: %m"); + return 0; + } + + s->kernel_seqnum = p; + + return 0; +} diff --git a/src/grp-journal/libjournal-core/src/journald-native.c b/src/grp-journal/libjournal-core/src/journald-native.c new file mode 100644 index 0000000000..536765f414 --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-native.c @@ -0,0 +1,501 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include +#include +#include + +#include "journal-core/journald-console.h" +#include "journal-core/journald-kmsg.h" +#include "journal-core/journald-native.h" +#include "journal-core/journald-server.h" +#include "journal-core/journald-syslog.h" +#include "journal-core/journald-wall.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fs-util.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/memfd-util.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/path-util.h" +#include "systemd-basic/selinux-util.h" +#include "systemd-basic/socket-util.h" +#include "systemd-basic/string-util.h" + +bool valid_user_field(const char *p, size_t l, bool allow_protected) { + const char *a; + + /* We kinda enforce POSIX syntax recommendations for + environment variables here, but make a couple of additional + requirements. + + http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html */ + + /* No empty field names */ + if (l <= 0) + return false; + + /* Don't allow names longer than 64 chars */ + if (l > 64) + return false; + + /* Variables starting with an underscore are protected */ + if (!allow_protected && p[0] == '_') + return false; + + /* Don't allow digits as first character */ + if (p[0] >= '0' && p[0] <= '9') + return false; + + /* Only allow A-Z0-9 and '_' */ + for (a = p; a < p + l; a++) + if ((*a < 'A' || *a > 'Z') && + (*a < '0' || *a > '9') && + *a != '_') + return false; + + return true; +} + +static bool allow_object_pid(const struct ucred *ucred) { + return ucred && ucred->uid == 0; +} + +void server_process_native_message( + Server *s, + const void *buffer, size_t buffer_size, + const struct ucred *ucred, + const struct timeval *tv, + const char *label, size_t label_len) { + + struct iovec *iovec = NULL; + unsigned n = 0, j, tn = (unsigned) -1; + const char *p; + size_t remaining, m = 0, entry_size = 0; + int priority = LOG_INFO; + char *identifier = NULL, *message = NULL; + pid_t object_pid = 0; + + assert(s); + assert(buffer || buffer_size == 0); + + p = buffer; + remaining = buffer_size; + + while (remaining > 0) { + const char *e, *q; + + e = memchr(p, '\n', remaining); + + if (!e) { + /* Trailing noise, let's ignore it, and flush what we collected */ + log_debug("Received message with trailing noise, ignoring."); + break; + } + + if (e == p) { + /* Entry separator */ + + if (entry_size + n + 1 > ENTRY_SIZE_MAX) { /* data + separators + trailer */ + log_debug("Entry is too big with %u properties and %zu bytes, ignoring.", n, entry_size); + continue; + } + + server_dispatch_message(s, iovec, n, m, ucred, tv, label, label_len, NULL, priority, object_pid); + n = 0; + priority = LOG_INFO; + entry_size = 0; + + p++; + remaining--; + continue; + } + + if (*p == '.' || *p == '#') { + /* Ignore control commands for now, and + * comments too. */ + remaining -= (e - p) + 1; + p = e + 1; + continue; + } + + /* A property follows */ + + /* n existing properties, 1 new, +1 for _TRANSPORT */ + if (!GREEDY_REALLOC(iovec, m, n + 2 + N_IOVEC_META_FIELDS + N_IOVEC_OBJECT_FIELDS)) { + log_oom(); + break; + } + + q = memchr(p, '=', e - p); + if (q) { + if (valid_user_field(p, q - p, false)) { + size_t l; + + l = e - p; + + /* If the field name starts with an + * underscore, skip the variable, + * since that indidates a trusted + * field */ + iovec[n].iov_base = (char*) p; + iovec[n].iov_len = l; + entry_size += iovec[n].iov_len; + n++; + + /* We need to determine the priority + * of this entry for the rate limiting + * logic */ + if (l == 10 && + startswith(p, "PRIORITY=") && + p[9] >= '0' && p[9] <= '9') + priority = (priority & LOG_FACMASK) | (p[9] - '0'); + + else if (l == 17 && + startswith(p, "SYSLOG_FACILITY=") && + p[16] >= '0' && p[16] <= '9') + priority = (priority & LOG_PRIMASK) | ((p[16] - '0') << 3); + + else if (l == 18 && + startswith(p, "SYSLOG_FACILITY=") && + p[16] >= '0' && p[16] <= '9' && + p[17] >= '0' && p[17] <= '9') + priority = (priority & LOG_PRIMASK) | (((p[16] - '0')*10 + (p[17] - '0')) << 3); + + else if (l >= 19 && + startswith(p, "SYSLOG_IDENTIFIER=")) { + char *t; + + t = strndup(p + 18, l - 18); + if (t) { + free(identifier); + identifier = t; + } + + } else if (l >= 8 && + startswith(p, "MESSAGE=")) { + char *t; + + t = strndup(p + 8, l - 8); + if (t) { + free(message); + message = t; + } + + } else if (l > strlen("OBJECT_PID=") && + l < strlen("OBJECT_PID=") + DECIMAL_STR_MAX(pid_t) && + startswith(p, "OBJECT_PID=") && + allow_object_pid(ucred)) { + char buf[DECIMAL_STR_MAX(pid_t)]; + memcpy(buf, p + strlen("OBJECT_PID="), l - strlen("OBJECT_PID=")); + buf[l-strlen("OBJECT_PID=")] = '\0'; + + /* ignore error */ + parse_pid(buf, &object_pid); + } + } + + remaining -= (e - p) + 1; + p = e + 1; + continue; + } else { + le64_t l_le; + uint64_t l; + char *k; + + if (remaining < e - p + 1 + sizeof(uint64_t) + 1) { + log_debug("Failed to parse message, ignoring."); + break; + } + + memcpy(&l_le, e + 1, sizeof(uint64_t)); + l = le64toh(l_le); + + if (l > DATA_SIZE_MAX) { + log_debug("Received binary data block of %"PRIu64" bytes is too large, ignoring.", l); + break; + } + + if ((uint64_t) remaining < e - p + 1 + sizeof(uint64_t) + l + 1 || + e[1+sizeof(uint64_t)+l] != '\n') { + log_debug("Failed to parse message, ignoring."); + break; + } + + k = malloc((e - p) + 1 + l); + if (!k) { + log_oom(); + break; + } + + memcpy(k, p, e - p); + k[e - p] = '='; + memcpy(k + (e - p) + 1, e + 1 + sizeof(uint64_t), l); + + if (valid_user_field(p, e - p, false)) { + iovec[n].iov_base = k; + iovec[n].iov_len = (e - p) + 1 + l; + entry_size += iovec[n].iov_len; + n++; + } else + free(k); + + remaining -= (e - p) + 1 + sizeof(uint64_t) + l + 1; + p = e + 1 + sizeof(uint64_t) + l + 1; + } + } + + if (n <= 0) + goto finish; + + tn = n++; + IOVEC_SET_STRING(iovec[tn], "_TRANSPORT=journal"); + entry_size += strlen("_TRANSPORT=journal"); + + if (entry_size + n + 1 > ENTRY_SIZE_MAX) { /* data + separators + trailer */ + log_debug("Entry is too big with %u properties and %zu bytes, ignoring.", + n, entry_size); + goto finish; + } + + if (message) { + if (s->forward_to_syslog) + server_forward_syslog(s, priority, identifier, message, ucred, tv); + + if (s->forward_to_kmsg) + server_forward_kmsg(s, priority, identifier, message, ucred); + + if (s->forward_to_console) + server_forward_console(s, priority, identifier, message, ucred); + + if (s->forward_to_wall) + server_forward_wall(s, priority, identifier, message, ucred); + } + + server_dispatch_message(s, iovec, n, m, ucred, tv, label, label_len, NULL, priority, object_pid); + +finish: + for (j = 0; j < n; j++) { + if (j == tn) + continue; + + if (iovec[j].iov_base < buffer || + (const uint8_t*) iovec[j].iov_base >= (const uint8_t*) buffer + buffer_size) + free(iovec[j].iov_base); + } + + free(iovec); + free(identifier); + free(message); +} + +void server_process_native_file( + Server *s, + int fd, + const struct ucred *ucred, + const struct timeval *tv, + const char *label, size_t label_len) { + + struct stat st; + bool sealed; + int r; + + /* Data is in the passed fd, since it didn't fit in a + * datagram. */ + + assert(s); + assert(fd >= 0); + + /* If it's a memfd, check if it is sealed. If so, we can just + * use map it and use it, and do not need to copy the data + * out. */ + sealed = memfd_get_sealed(fd) > 0; + + if (!sealed && (!ucred || ucred->uid != 0)) { + _cleanup_free_ char *sl = NULL, *k = NULL; + const char *e; + + /* If this is not a sealed memfd, and the peer is unknown or + * unprivileged, then verify the path. */ + + if (asprintf(&sl, "/proc/self/fd/%i", fd) < 0) { + log_oom(); + return; + } + + r = readlink_malloc(sl, &k); + if (r < 0) { + log_error_errno(r, "readlink(%s) failed: %m", sl); + return; + } + + e = path_startswith(k, "/dev/shm/"); + if (!e) + e = path_startswith(k, "/tmp/"); + if (!e) + e = path_startswith(k, "/var/tmp/"); + if (!e) { + log_error("Received file outside of allowed directories. Refusing."); + return; + } + + if (!filename_is_valid(e)) { + log_error("Received file in subdirectory of allowed directories. Refusing."); + return; + } + } + + if (fstat(fd, &st) < 0) { + log_error_errno(errno, "Failed to stat passed file, ignoring: %m"); + return; + } + + if (!S_ISREG(st.st_mode)) { + log_error("File passed is not regular. Ignoring."); + return; + } + + if (st.st_size <= 0) + return; + + if (st.st_size > ENTRY_SIZE_MAX) { + log_error("File passed too large. Ignoring."); + return; + } + + if (sealed) { + void *p; + size_t ps; + + /* The file is sealed, we can just map it and use it. */ + + ps = PAGE_ALIGN(st.st_size); + p = mmap(NULL, ps, PROT_READ, MAP_PRIVATE, fd, 0); + if (p == MAP_FAILED) { + log_error_errno(errno, "Failed to map memfd, ignoring: %m"); + return; + } + + server_process_native_message(s, p, st.st_size, ucred, tv, label, label_len); + assert_se(munmap(p, ps) >= 0); + } else { + _cleanup_free_ void *p = NULL; + struct statvfs vfs; + ssize_t n; + + if (fstatvfs(fd, &vfs) < 0) { + log_error_errno(errno, "Failed to stat file system of passed file, ignoring: %m"); + return; + } + + /* Refuse operating on file systems that have + * mandatory locking enabled, see: + * + * https://github.com/systemd/systemd/issues/1822 + */ + if (vfs.f_flag & ST_MANDLOCK) { + log_error("Received file descriptor from file system with mandatory locking enable, refusing."); + return; + } + + /* Make the fd non-blocking. On regular files this has + * the effect of bypassing mandatory locking. Of + * course, this should normally not be necessary given + * the check above, but let's better be safe than + * sorry, after all NFS is pretty confusing regarding + * file system flags, and we better don't trust it, + * and so is SMB. */ + r = fd_nonblock(fd, true); + if (r < 0) { + log_error_errno(r, "Failed to make fd non-blocking, ignoring: %m"); + return; + } + + /* The file is not sealed, we can't map the file here, since + * clients might then truncate it and trigger a SIGBUS for + * us. So let's stupidly read it */ + + p = malloc(st.st_size); + if (!p) { + log_oom(); + return; + } + + n = pread(fd, p, st.st_size, 0); + if (n < 0) + log_error_errno(errno, "Failed to read file, ignoring: %m"); + else if (n > 0) + server_process_native_message(s, p, n, ucred, tv, label, label_len); + } +} + +int server_open_native_socket(Server*s) { + + static const union sockaddr_union sa = { + .un.sun_family = AF_UNIX, + .un.sun_path = "/run/systemd/journal/socket", + }; + static const int one = 1; + int r; + + assert(s); + + if (s->native_fd < 0) { + s->native_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); + if (s->native_fd < 0) + return log_error_errno(errno, "socket() failed: %m"); + + (void) unlink(sa.un.sun_path); + + r = bind(s->native_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); + if (r < 0) + return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path); + + (void) chmod(sa.un.sun_path, 0666); + } else + fd_nonblock(s->native_fd, 1); + + r = setsockopt(s->native_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); + if (r < 0) + return log_error_errno(errno, "SO_PASSCRED failed: %m"); + +#ifdef HAVE_SELINUX + if (mac_selinux_have()) { + r = setsockopt(s->native_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one)); + if (r < 0) + log_warning_errno(errno, "SO_PASSSEC failed: %m"); + } +#endif + + r = setsockopt(s->native_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)); + if (r < 0) + return log_error_errno(errno, "SO_TIMESTAMP failed: %m"); + + r = sd_event_add_io(s->event, &s->native_event_source, s->native_fd, EPOLLIN, server_process_datagram, s); + if (r < 0) + return log_error_errno(r, "Failed to add native server fd to event loop: %m"); + + r = sd_event_source_set_priority(s->native_event_source, SD_EVENT_PRIORITY_NORMAL+5); + if (r < 0) + return log_error_errno(r, "Failed to adjust native event source priority: %m"); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/src/journald-rate-limit.c b/src/grp-journal/libjournal-core/src/journald-rate-limit.c new file mode 100644 index 0000000000..a3f17da16d --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-rate-limit.c @@ -0,0 +1,271 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#include "journal-core/journald-rate-limit.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/hashmap.h" +#include "systemd-basic/list.h" +#include "systemd-basic/random-util.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/util.h" + +#define POOLS_MAX 5 +#define BUCKETS_MAX 127 +#define GROUPS_MAX 2047 + +static const int priority_map[] = { + [LOG_EMERG] = 0, + [LOG_ALERT] = 0, + [LOG_CRIT] = 0, + [LOG_ERR] = 1, + [LOG_WARNING] = 2, + [LOG_NOTICE] = 3, + [LOG_INFO] = 3, + [LOG_DEBUG] = 4 +}; + +typedef struct JournalRateLimitPool JournalRateLimitPool; +typedef struct JournalRateLimitGroup JournalRateLimitGroup; + +struct JournalRateLimitPool { + usec_t begin; + unsigned num; + unsigned suppressed; +}; + +struct JournalRateLimitGroup { + JournalRateLimit *parent; + + char *id; + JournalRateLimitPool pools[POOLS_MAX]; + uint64_t hash; + + LIST_FIELDS(JournalRateLimitGroup, bucket); + LIST_FIELDS(JournalRateLimitGroup, lru); +}; + +struct JournalRateLimit { + usec_t interval; + unsigned burst; + + JournalRateLimitGroup* buckets[BUCKETS_MAX]; + JournalRateLimitGroup *lru, *lru_tail; + + unsigned n_groups; + + uint8_t hash_key[16]; +}; + +JournalRateLimit *journal_rate_limit_new(usec_t interval, unsigned burst) { + JournalRateLimit *r; + + assert(interval > 0 || burst == 0); + + r = new0(JournalRateLimit, 1); + if (!r) + return NULL; + + r->interval = interval; + r->burst = burst; + + random_bytes(r->hash_key, sizeof(r->hash_key)); + + return r; +} + +static void journal_rate_limit_group_free(JournalRateLimitGroup *g) { + assert(g); + + if (g->parent) { + assert(g->parent->n_groups > 0); + + if (g->parent->lru_tail == g) + g->parent->lru_tail = g->lru_prev; + + LIST_REMOVE(lru, g->parent->lru, g); + LIST_REMOVE(bucket, g->parent->buckets[g->hash % BUCKETS_MAX], g); + + g->parent->n_groups--; + } + + free(g->id); + free(g); +} + +void journal_rate_limit_free(JournalRateLimit *r) { + assert(r); + + while (r->lru) + journal_rate_limit_group_free(r->lru); + + free(r); +} + +_pure_ static bool journal_rate_limit_group_expired(JournalRateLimitGroup *g, usec_t ts) { + unsigned i; + + assert(g); + + for (i = 0; i < POOLS_MAX; i++) + if (g->pools[i].begin + g->parent->interval >= ts) + return false; + + return true; +} + +static void journal_rate_limit_vacuum(JournalRateLimit *r, usec_t ts) { + assert(r); + + /* Makes room for at least one new item, but drop all + * expored items too. */ + + while (r->n_groups >= GROUPS_MAX || + (r->lru_tail && journal_rate_limit_group_expired(r->lru_tail, ts))) + journal_rate_limit_group_free(r->lru_tail); +} + +static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r, const char *id, usec_t ts) { + JournalRateLimitGroup *g; + struct siphash state; + + assert(r); + assert(id); + + g = new0(JournalRateLimitGroup, 1); + if (!g) + return NULL; + + g->id = strdup(id); + if (!g->id) + goto fail; + + siphash24_init(&state, r->hash_key); + string_hash_func(g->id, &state); + g->hash = siphash24_finalize(&state); + + journal_rate_limit_vacuum(r, ts); + + LIST_PREPEND(bucket, r->buckets[g->hash % BUCKETS_MAX], g); + LIST_PREPEND(lru, r->lru, g); + if (!g->lru_next) + r->lru_tail = g; + r->n_groups++; + + g->parent = r; + return g; + +fail: + journal_rate_limit_group_free(g); + return NULL; +} + +static unsigned burst_modulate(unsigned burst, uint64_t available) { + unsigned k; + + /* Modulates the burst rate a bit with the amount of available + * disk space */ + + k = u64log2(available); + + /* 1MB */ + if (k <= 20) + return burst; + + burst = (burst * (k-20)) / 4; + + /* + * Example: + * + * <= 1MB = rate * 1 + * 16MB = rate * 2 + * 256MB = rate * 3 + * 4GB = rate * 4 + * 64GB = rate * 5 + * 1TB = rate * 6 + */ + + return burst; +} + +int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, uint64_t available) { + uint64_t h; + JournalRateLimitGroup *g; + JournalRateLimitPool *p; + struct siphash state; + unsigned burst; + usec_t ts; + + assert(id); + + if (!r) + return 1; + + if (r->interval == 0 || r->burst == 0) + return 1; + + burst = burst_modulate(r->burst, available); + + ts = now(CLOCK_MONOTONIC); + + siphash24_init(&state, r->hash_key); + string_hash_func(id, &state); + h = siphash24_finalize(&state); + g = r->buckets[h % BUCKETS_MAX]; + + LIST_FOREACH(bucket, g, g) + if (streq(g->id, id)) + break; + + if (!g) { + g = journal_rate_limit_group_new(r, id, ts); + if (!g) + return -ENOMEM; + } + + p = &g->pools[priority_map[priority]]; + + if (p->begin <= 0) { + p->suppressed = 0; + p->num = 1; + p->begin = ts; + return 1; + } + + if (p->begin + r->interval < ts) { + unsigned s; + + s = p->suppressed; + p->suppressed = 0; + p->num = 1; + p->begin = ts; + + return 1 + s; + } + + if (p->num <= burst) { + p->num++; + return 1; + } + + p->suppressed++; + return 0; +} diff --git a/src/grp-journal/libjournal-core/src/journald-server.c b/src/grp-journal/libjournal-core/src/journald-server.c new file mode 100644 index 0000000000..b3702d99a6 --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-server.c @@ -0,0 +1,2008 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#ifdef HAVE_SELINUX +#include +#endif +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "journal-core/journald-audit.h" +#include "journal-core/journald-kmsg.h" +#include "journal-core/journald-native.h" +#include "journal-core/journald-rate-limit.h" +#include "journal-core/journald-server.h" +#include "journal-core/journald-stream.h" +#include "journal-core/journald-syslog.h" +#include "sd-journal/journal-authenticate.h" +#include "sd-journal/journal-file.h" +#include "sd-journal/journal-internal.h" +#include "sd-journal/journal-vacuum.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/audit-util.h" +#include "systemd-basic/cgroup-util.h" +#include "systemd-basic/dirent-util.h" +#include "systemd-basic/extract-word.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/formats-util.h" +#include "systemd-basic/fs-util.h" +#include "systemd-basic/hashmap.h" +#include "systemd-basic/hostname-util.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/missing.h" +#include "systemd-basic/mkdir.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/proc-cmdline.h" +#include "systemd-basic/process-util.h" +#include "systemd-basic/rm-rf.h" +#include "systemd-basic/selinux-util.h" +#include "systemd-basic/signal-util.h" +#include "systemd-basic/socket-util.h" +#include "systemd-basic/stdio-util.h" +#include "systemd-basic/string-table.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/user-util.h" +#include "systemd-shared/acl-util.h" +#include "systemd-shared/conf-parser.h" + +#define USER_JOURNALS_MAX 1024 + +#define DEFAULT_SYNC_INTERVAL_USEC (5*USEC_PER_MINUTE) +#define DEFAULT_RATE_LIMIT_INTERVAL (30*USEC_PER_SEC) +#define DEFAULT_RATE_LIMIT_BURST 1000 +#define DEFAULT_MAX_FILE_USEC USEC_PER_MONTH + +#define RECHECK_SPACE_USEC (30*USEC_PER_SEC) + +#define NOTIFY_SNDBUF_SIZE (8*1024*1024) + +/* The period to insert between posting changes for coalescing */ +#define POST_CHANGE_TIMER_INTERVAL_USEC (250*USEC_PER_MSEC) + +static int determine_space_for( + Server *s, + JournalMetrics *metrics, + const char *path, + const char *name, + bool verbose, + bool patch_min_use, + uint64_t *available, + uint64_t *limit) { + + uint64_t sum = 0, ss_avail, avail; + _cleanup_closedir_ DIR *d = NULL; + struct dirent *de; + struct statvfs ss; + const char *p; + usec_t ts; + + assert(s); + assert(metrics); + assert(path); + assert(name); + + ts = now(CLOCK_MONOTONIC); + + if (!verbose && s->cached_space_timestamp + RECHECK_SPACE_USEC > ts) { + + if (available) + *available = s->cached_space_available; + if (limit) + *limit = s->cached_space_limit; + + return 0; + } + + p = strjoina(path, SERVER_MACHINE_ID(s)); + d = opendir(p); + if (!d) + return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, "Failed to open %s: %m", p); + + if (fstatvfs(dirfd(d), &ss) < 0) + return log_error_errno(errno, "Failed to fstatvfs(%s): %m", p); + + FOREACH_DIRENT_ALL(de, d, break) { + struct stat st; + + if (!endswith(de->d_name, ".journal") && + !endswith(de->d_name, ".journal~")) + continue; + + if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { + log_debug_errno(errno, "Failed to stat %s/%s, ignoring: %m", p, de->d_name); + continue; + } + + if (!S_ISREG(st.st_mode)) + continue; + + sum += (uint64_t) st.st_blocks * 512UL; + } + + /* If requested, then let's bump the min_use limit to the + * current usage on disk. We do this when starting up and + * first opening the journal files. This way sudden spikes in + * disk usage will not cause journald to vacuum files without + * bounds. Note that this means that only a restart of + * journald will make it reset this value. */ + + if (patch_min_use) + metrics->min_use = MAX(metrics->min_use, sum); + + ss_avail = ss.f_bsize * ss.f_bavail; + avail = LESS_BY(ss_avail, metrics->keep_free); + + s->cached_space_limit = MIN(MAX(sum + avail, metrics->min_use), metrics->max_use); + s->cached_space_available = LESS_BY(s->cached_space_limit, sum); + s->cached_space_timestamp = ts; + + if (verbose) { + char fb1[FORMAT_BYTES_MAX], fb2[FORMAT_BYTES_MAX], fb3[FORMAT_BYTES_MAX], + fb4[FORMAT_BYTES_MAX], fb5[FORMAT_BYTES_MAX], fb6[FORMAT_BYTES_MAX]; + format_bytes(fb1, sizeof(fb1), sum); + format_bytes(fb2, sizeof(fb2), metrics->max_use); + format_bytes(fb3, sizeof(fb3), metrics->keep_free); + format_bytes(fb4, sizeof(fb4), ss_avail); + format_bytes(fb5, sizeof(fb5), s->cached_space_limit); + format_bytes(fb6, sizeof(fb6), s->cached_space_available); + + server_driver_message(s, SD_MESSAGE_JOURNAL_USAGE, + LOG_MESSAGE("%s (%s) is %s, max %s, %s free.", + name, path, fb1, fb5, fb6), + "JOURNAL_NAME=%s", name, + "JOURNAL_PATH=%s", path, + "CURRENT_USE=%"PRIu64, sum, + "CURRENT_USE_PRETTY=%s", fb1, + "MAX_USE=%"PRIu64, metrics->max_use, + "MAX_USE_PRETTY=%s", fb2, + "DISK_KEEP_FREE=%"PRIu64, metrics->keep_free, + "DISK_KEEP_FREE_PRETTY=%s", fb3, + "DISK_AVAILABLE=%"PRIu64, ss_avail, + "DISK_AVAILABLE_PRETTY=%s", fb4, + "LIMIT=%"PRIu64, s->cached_space_limit, + "LIMIT_PRETTY=%s", fb5, + "AVAILABLE=%"PRIu64, s->cached_space_available, + "AVAILABLE_PRETTY=%s", fb6, + NULL); + } + + if (available) + *available = s->cached_space_available; + if (limit) + *limit = s->cached_space_limit; + + return 1; +} + +static int determine_space(Server *s, bool verbose, bool patch_min_use, uint64_t *available, uint64_t *limit) { + JournalMetrics *metrics; + const char *path, *name; + + assert(s); + + if (s->system_journal) { + path = "/var/log/journal/"; + metrics = &s->system_metrics; + name = "System journal"; + } else { + path = "/run/log/journal/"; + metrics = &s->runtime_metrics; + name = "Runtime journal"; + } + + return determine_space_for(s, metrics, path, name, verbose, patch_min_use, available, limit); +} + +static void server_add_acls(JournalFile *f, uid_t uid) { +#ifdef HAVE_ACL + int r; +#endif + assert(f); + +#ifdef HAVE_ACL + if (uid <= SYSTEM_UID_MAX) + return; + + r = add_acls_for_user(f->fd, uid); + if (r < 0) + log_warning_errno(r, "Failed to set ACL on %s, ignoring: %m", f->path); +#endif +} + +static int open_journal( + Server *s, + bool reliably, + const char *fname, + int flags, + bool seal, + JournalMetrics *metrics, + JournalFile **ret) { + int r; + JournalFile *f; + + assert(s); + assert(fname); + assert(ret); + + if (reliably) + r = journal_file_open_reliably(fname, flags, 0640, s->compress, seal, metrics, s->mmap, s->deferred_closes, NULL, &f); + else + r = journal_file_open(-1, fname, flags, 0640, s->compress, seal, metrics, s->mmap, s->deferred_closes, NULL, &f); + if (r < 0) + return r; + + r = journal_file_enable_post_change_timer(f, s->event, POST_CHANGE_TIMER_INTERVAL_USEC); + if (r < 0) { + (void) journal_file_close(f); + return r; + } + + *ret = f; + return r; +} + +static JournalFile* find_journal(Server *s, uid_t uid) { + _cleanup_free_ char *p = NULL; + int r; + JournalFile *f; + sd_id128_t machine; + + assert(s); + + /* We split up user logs only on /var, not on /run. If the + * runtime file is open, we write to it exclusively, in order + * to guarantee proper order as soon as we flush /run to + * /var and close the runtime file. */ + + if (s->runtime_journal) + return s->runtime_journal; + + if (uid <= SYSTEM_UID_MAX) + return s->system_journal; + + r = sd_id128_get_machine(&machine); + if (r < 0) + return s->system_journal; + + f = ordered_hashmap_get(s->user_journals, UID_TO_PTR(uid)); + if (f) + return f; + + if (asprintf(&p, "/var/log/journal/" SD_ID128_FORMAT_STR "/user-"UID_FMT".journal", + SD_ID128_FORMAT_VAL(machine), uid) < 0) + return s->system_journal; + + while (ordered_hashmap_size(s->user_journals) >= USER_JOURNALS_MAX) { + /* Too many open? Then let's close one */ + f = ordered_hashmap_steal_first(s->user_journals); + assert(f); + (void) journal_file_close(f); + } + + r = open_journal(s, true, p, O_RDWR|O_CREAT, s->seal, &s->system_metrics, &f); + if (r < 0) + return s->system_journal; + + server_add_acls(f, uid); + + r = ordered_hashmap_put(s->user_journals, UID_TO_PTR(uid), f); + if (r < 0) { + (void) journal_file_close(f); + return s->system_journal; + } + + return f; +} + +static int do_rotate( + Server *s, + JournalFile **f, + const char* name, + bool seal, + uint32_t uid) { + + int r; + assert(s); + + if (!*f) + return -EINVAL; + + r = journal_file_rotate(f, s->compress, seal, s->deferred_closes); + if (r < 0) + if (*f) + log_error_errno(r, "Failed to rotate %s: %m", (*f)->path); + else + log_error_errno(r, "Failed to create new %s journal: %m", name); + else + server_add_acls(*f, uid); + + return r; +} + +void server_rotate(Server *s) { + JournalFile *f; + void *k; + Iterator i; + int r; + + log_debug("Rotating..."); + + (void) do_rotate(s, &s->runtime_journal, "runtime", false, 0); + (void) do_rotate(s, &s->system_journal, "system", s->seal, 0); + + ORDERED_HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) { + r = do_rotate(s, &f, "user", s->seal, PTR_TO_UID(k)); + if (r >= 0) + ordered_hashmap_replace(s->user_journals, k, f); + else if (!f) + /* Old file has been closed and deallocated */ + ordered_hashmap_remove(s->user_journals, k); + } + + /* Perform any deferred closes which aren't still offlining. */ + SET_FOREACH(f, s->deferred_closes, i) + if (!journal_file_is_offlining(f)) { + (void) set_remove(s->deferred_closes, f); + (void) journal_file_close(f); + } +} + +void server_sync(Server *s) { + JournalFile *f; + Iterator i; + int r; + + if (s->system_journal) { + r = journal_file_set_offline(s->system_journal, false); + if (r < 0) + log_warning_errno(r, "Failed to sync system journal, ignoring: %m"); + } + + ORDERED_HASHMAP_FOREACH(f, s->user_journals, i) { + r = journal_file_set_offline(f, false); + if (r < 0) + log_warning_errno(r, "Failed to sync user journal, ignoring: %m"); + } + + if (s->sync_event_source) { + r = sd_event_source_set_enabled(s->sync_event_source, SD_EVENT_OFF); + if (r < 0) + log_error_errno(r, "Failed to disable sync timer source: %m"); + } + + s->sync_scheduled = false; +} + +static void do_vacuum( + Server *s, + JournalFile *f, + JournalMetrics *metrics, + const char *path, + const char *name, + bool verbose, + bool patch_min_use) { + + const char *p; + uint64_t limit; + int r; + + assert(s); + assert(metrics); + assert(path); + assert(name); + + if (!f) + return; + + p = strjoina(path, SERVER_MACHINE_ID(s)); + + limit = metrics->max_use; + (void) determine_space_for(s, metrics, path, name, verbose, patch_min_use, NULL, &limit); + + r = journal_directory_vacuum(p, limit, metrics->n_max_files, s->max_retention_usec, &s->oldest_file_usec, verbose); + if (r < 0 && r != -ENOENT) + log_warning_errno(r, "Failed to vacuum %s, ignoring: %m", p); +} + +int server_vacuum(Server *s, bool verbose, bool patch_min_use) { + assert(s); + + log_debug("Vacuuming..."); + + s->oldest_file_usec = 0; + + do_vacuum(s, s->system_journal, &s->system_metrics, "/var/log/journal/", "System journal", verbose, patch_min_use); + do_vacuum(s, s->runtime_journal, &s->runtime_metrics, "/run/log/journal/", "Runtime journal", verbose, patch_min_use); + + s->cached_space_limit = 0; + s->cached_space_available = 0; + s->cached_space_timestamp = 0; + + return 0; +} + +static void server_cache_machine_id(Server *s) { + sd_id128_t id; + int r; + + assert(s); + + r = sd_id128_get_machine(&id); + if (r < 0) + return; + + sd_id128_to_string(id, stpcpy(s->machine_id_field, "_MACHINE_ID=")); +} + +static void server_cache_boot_id(Server *s) { + sd_id128_t id; + int r; + + assert(s); + + r = sd_id128_get_boot(&id); + if (r < 0) + return; + + sd_id128_to_string(id, stpcpy(s->boot_id_field, "_BOOT_ID=")); +} + +static void server_cache_hostname(Server *s) { + _cleanup_free_ char *t = NULL; + char *x; + + assert(s); + + t = gethostname_malloc(); + if (!t) + return; + + x = strappend("_HOSTNAME=", t); + if (!x) + return; + + free(s->hostname_field); + s->hostname_field = x; +} + +static bool shall_try_append_again(JournalFile *f, int r) { + switch(r) { + case -E2BIG: /* Hit configured limit */ + case -EFBIG: /* Hit fs limit */ + case -EDQUOT: /* Quota limit hit */ + case -ENOSPC: /* Disk full */ + log_debug("%s: Allocation limit reached, rotating.", f->path); + return true; + case -EIO: /* I/O error of some kind (mmap) */ + log_warning("%s: IO error, rotating.", f->path); + return true; + case -EHOSTDOWN: /* Other machine */ + log_info("%s: Journal file from other machine, rotating.", f->path); + return true; + case -EBUSY: /* Unclean shutdown */ + log_info("%s: Unclean shutdown, rotating.", f->path); + return true; + case -EPROTONOSUPPORT: /* Unsupported feature */ + log_info("%s: Unsupported feature, rotating.", f->path); + return true; + case -EBADMSG: /* Corrupted */ + case -ENODATA: /* Truncated */ + case -ESHUTDOWN: /* Already archived */ + log_warning("%s: Journal file corrupted, rotating.", f->path); + return true; + case -EIDRM: /* Journal file has been deleted */ + log_warning("%s: Journal file has been deleted, rotating.", f->path); + return true; + default: + return false; + } +} + +static void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, unsigned n, int priority) { + JournalFile *f; + bool vacuumed = false; + int r; + + assert(s); + assert(iovec); + assert(n > 0); + + f = find_journal(s, uid); + if (!f) + return; + + if (journal_file_rotate_suggested(f, s->max_file_usec)) { + log_debug("%s: Journal header limits reached or header out-of-date, rotating.", f->path); + server_rotate(s); + server_vacuum(s, false, false); + vacuumed = true; + + f = find_journal(s, uid); + if (!f) + return; + } + + r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL); + if (r >= 0) { + server_schedule_sync(s, priority); + return; + } + + if (vacuumed || !shall_try_append_again(f, r)) { + log_error_errno(r, "Failed to write entry (%d items, %zu bytes), ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n)); + return; + } + + server_rotate(s); + server_vacuum(s, false, false); + + f = find_journal(s, uid); + if (!f) + return; + + log_debug("Retrying write."); + r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL); + if (r < 0) + log_error_errno(r, "Failed to write entry (%d items, %zu bytes) despite vacuuming, ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n)); + else + server_schedule_sync(s, priority); +} + +static void dispatch_message_real( + Server *s, + struct iovec *iovec, unsigned n, unsigned m, + const struct ucred *ucred, + const struct timeval *tv, + const char *label, size_t label_len, + const char *unit_id, + int priority, + pid_t object_pid) { + + char pid[sizeof("_PID=") + DECIMAL_STR_MAX(pid_t)], + uid[sizeof("_UID=") + DECIMAL_STR_MAX(uid_t)], + gid[sizeof("_GID=") + DECIMAL_STR_MAX(gid_t)], + owner_uid[sizeof("_SYSTEMD_OWNER_UID=") + DECIMAL_STR_MAX(uid_t)], + source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)], + o_uid[sizeof("OBJECT_UID=") + DECIMAL_STR_MAX(uid_t)], + o_gid[sizeof("OBJECT_GID=") + DECIMAL_STR_MAX(gid_t)], + o_owner_uid[sizeof("OBJECT_SYSTEMD_OWNER_UID=") + DECIMAL_STR_MAX(uid_t)]; + uid_t object_uid; + gid_t object_gid; + char *x; + int r; + char *t, *c; + uid_t realuid = 0, owner = 0, journal_uid; + bool owner_valid = false; +#ifdef HAVE_AUDIT + char audit_session[sizeof("_AUDIT_SESSION=") + DECIMAL_STR_MAX(uint32_t)], + audit_loginuid[sizeof("_AUDIT_LOGINUID=") + DECIMAL_STR_MAX(uid_t)], + o_audit_session[sizeof("OBJECT_AUDIT_SESSION=") + DECIMAL_STR_MAX(uint32_t)], + o_audit_loginuid[sizeof("OBJECT_AUDIT_LOGINUID=") + DECIMAL_STR_MAX(uid_t)]; + + uint32_t audit; + uid_t loginuid; +#endif + + assert(s); + assert(iovec); + assert(n > 0); + assert(n + N_IOVEC_META_FIELDS + (object_pid ? N_IOVEC_OBJECT_FIELDS : 0) <= m); + + if (ucred) { + realuid = ucred->uid; + + sprintf(pid, "_PID="PID_FMT, ucred->pid); + IOVEC_SET_STRING(iovec[n++], pid); + + sprintf(uid, "_UID="UID_FMT, ucred->uid); + IOVEC_SET_STRING(iovec[n++], uid); + + sprintf(gid, "_GID="GID_FMT, ucred->gid); + IOVEC_SET_STRING(iovec[n++], gid); + + r = get_process_comm(ucred->pid, &t); + if (r >= 0) { + x = strjoina("_COMM=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + r = get_process_exe(ucred->pid, &t); + if (r >= 0) { + x = strjoina("_EXE=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + r = get_process_cmdline(ucred->pid, 0, false, &t); + if (r >= 0) { + x = strjoina("_CMDLINE=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + r = get_process_capeff(ucred->pid, &t); + if (r >= 0) { + x = strjoina("_CAP_EFFECTIVE=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + +#ifdef HAVE_AUDIT + r = audit_session_from_pid(ucred->pid, &audit); + if (r >= 0) { + sprintf(audit_session, "_AUDIT_SESSION=%"PRIu32, audit); + IOVEC_SET_STRING(iovec[n++], audit_session); + } + + r = audit_loginuid_from_pid(ucred->pid, &loginuid); + if (r >= 0) { + sprintf(audit_loginuid, "_AUDIT_LOGINUID="UID_FMT, loginuid); + IOVEC_SET_STRING(iovec[n++], audit_loginuid); + } +#endif + + r = cg_pid_get_path_shifted(ucred->pid, s->cgroup_root, &c); + if (r >= 0) { + char *session = NULL; + + x = strjoina("_SYSTEMD_CGROUP=", c); + IOVEC_SET_STRING(iovec[n++], x); + + r = cg_path_get_session(c, &t); + if (r >= 0) { + session = strjoina("_SYSTEMD_SESSION=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], session); + } + + if (cg_path_get_owner_uid(c, &owner) >= 0) { + owner_valid = true; + + sprintf(owner_uid, "_SYSTEMD_OWNER_UID="UID_FMT, owner); + IOVEC_SET_STRING(iovec[n++], owner_uid); + } + + if (cg_path_get_unit(c, &t) >= 0) { + x = strjoina("_SYSTEMD_UNIT=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } else if (unit_id && !session) { + x = strjoina("_SYSTEMD_UNIT=", unit_id); + IOVEC_SET_STRING(iovec[n++], x); + } + + if (cg_path_get_user_unit(c, &t) >= 0) { + x = strjoina("_SYSTEMD_USER_UNIT=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } else if (unit_id && session) { + x = strjoina("_SYSTEMD_USER_UNIT=", unit_id); + IOVEC_SET_STRING(iovec[n++], x); + } + + if (cg_path_get_slice(c, &t) >= 0) { + x = strjoina("_SYSTEMD_SLICE=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + free(c); + } else if (unit_id) { + x = strjoina("_SYSTEMD_UNIT=", unit_id); + IOVEC_SET_STRING(iovec[n++], x); + } + +#ifdef HAVE_SELINUX + if (mac_selinux_have()) { + if (label) { + x = alloca(strlen("_SELINUX_CONTEXT=") + label_len + 1); + + *((char*) mempcpy(stpcpy(x, "_SELINUX_CONTEXT="), label, label_len)) = 0; + IOVEC_SET_STRING(iovec[n++], x); + } else { + char *con; + + if (getpidcon(ucred->pid, &con) >= 0) { + x = strjoina("_SELINUX_CONTEXT=", con); + + freecon(con); + IOVEC_SET_STRING(iovec[n++], x); + } + } + } +#endif + } + assert(n <= m); + + if (object_pid) { + r = get_process_uid(object_pid, &object_uid); + if (r >= 0) { + sprintf(o_uid, "OBJECT_UID="UID_FMT, object_uid); + IOVEC_SET_STRING(iovec[n++], o_uid); + } + + r = get_process_gid(object_pid, &object_gid); + if (r >= 0) { + sprintf(o_gid, "OBJECT_GID="GID_FMT, object_gid); + IOVEC_SET_STRING(iovec[n++], o_gid); + } + + r = get_process_comm(object_pid, &t); + if (r >= 0) { + x = strjoina("OBJECT_COMM=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + r = get_process_exe(object_pid, &t); + if (r >= 0) { + x = strjoina("OBJECT_EXE=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + r = get_process_cmdline(object_pid, 0, false, &t); + if (r >= 0) { + x = strjoina("OBJECT_CMDLINE=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + +#ifdef HAVE_AUDIT + r = audit_session_from_pid(object_pid, &audit); + if (r >= 0) { + sprintf(o_audit_session, "OBJECT_AUDIT_SESSION=%"PRIu32, audit); + IOVEC_SET_STRING(iovec[n++], o_audit_session); + } + + r = audit_loginuid_from_pid(object_pid, &loginuid); + if (r >= 0) { + sprintf(o_audit_loginuid, "OBJECT_AUDIT_LOGINUID="UID_FMT, loginuid); + IOVEC_SET_STRING(iovec[n++], o_audit_loginuid); + } +#endif + + r = cg_pid_get_path_shifted(object_pid, s->cgroup_root, &c); + if (r >= 0) { + x = strjoina("OBJECT_SYSTEMD_CGROUP=", c); + IOVEC_SET_STRING(iovec[n++], x); + + r = cg_path_get_session(c, &t); + if (r >= 0) { + x = strjoina("OBJECT_SYSTEMD_SESSION=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + if (cg_path_get_owner_uid(c, &owner) >= 0) { + sprintf(o_owner_uid, "OBJECT_SYSTEMD_OWNER_UID="UID_FMT, owner); + IOVEC_SET_STRING(iovec[n++], o_owner_uid); + } + + if (cg_path_get_unit(c, &t) >= 0) { + x = strjoina("OBJECT_SYSTEMD_UNIT=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + if (cg_path_get_user_unit(c, &t) >= 0) { + x = strjoina("OBJECT_SYSTEMD_USER_UNIT=", t); + free(t); + IOVEC_SET_STRING(iovec[n++], x); + } + + free(c); + } + } + assert(n <= m); + + if (tv) { + sprintf(source_time, "_SOURCE_REALTIME_TIMESTAMP=%llu", (unsigned long long) timeval_load(tv)); + IOVEC_SET_STRING(iovec[n++], source_time); + } + + /* Note that strictly speaking storing the boot id here is + * redundant since the entry includes this in-line + * anyway. However, we need this indexed, too. */ + if (!isempty(s->boot_id_field)) + IOVEC_SET_STRING(iovec[n++], s->boot_id_field); + + if (!isempty(s->machine_id_field)) + IOVEC_SET_STRING(iovec[n++], s->machine_id_field); + + if (!isempty(s->hostname_field)) + IOVEC_SET_STRING(iovec[n++], s->hostname_field); + + assert(n <= m); + + if (s->split_mode == SPLIT_UID && realuid > 0) + /* Split up strictly by any UID */ + journal_uid = realuid; + else if (s->split_mode == SPLIT_LOGIN && realuid > 0 && owner_valid && owner > 0) + /* Split up by login UIDs. We do this only if the + * realuid is not root, in order not to accidentally + * leak privileged information to the user that is + * logged by a privileged process that is part of an + * unprivileged session. */ + journal_uid = owner; + else + journal_uid = 0; + + write_to_journal(s, journal_uid, iovec, n, priority); +} + +void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) { + char mid[11 + 32 + 1]; + struct iovec iovec[N_IOVEC_META_FIELDS + 5 + N_IOVEC_PAYLOAD_FIELDS]; + unsigned n = 0, m; + int r; + va_list ap; + struct ucred ucred = {}; + + assert(s); + assert(format); + + assert_cc(3 == LOG_FAC(LOG_DAEMON)); + IOVEC_SET_STRING(iovec[n++], "SYSLOG_FACILITY=3"); + IOVEC_SET_STRING(iovec[n++], "SYSLOG_IDENTIFIER=systemd-journald"); + + IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=driver"); + assert_cc(6 == LOG_INFO); + IOVEC_SET_STRING(iovec[n++], "PRIORITY=6"); + + if (!sd_id128_is_null(message_id)) { + snprintf(mid, sizeof(mid), LOG_MESSAGE_ID(message_id)); + IOVEC_SET_STRING(iovec[n++], mid); + } + + m = n; + + va_start(ap, format); + r = log_format_iovec(iovec, ELEMENTSOF(iovec), &n, false, 0, format, ap); + /* Error handling below */ + va_end(ap); + + ucred.pid = getpid(); + ucred.uid = getuid(); + ucred.gid = getgid(); + + if (r >= 0) + dispatch_message_real(s, iovec, n, ELEMENTSOF(iovec), &ucred, NULL, NULL, 0, NULL, LOG_INFO, 0); + + while (m < n) + free(iovec[m++].iov_base); + + if (r < 0) { + /* We failed to format the message. Emit a warning instead. */ + char buf[LINE_MAX]; + + xsprintf(buf, "MESSAGE=Entry printing failed: %s", strerror(-r)); + + n = 3; + IOVEC_SET_STRING(iovec[n++], "PRIORITY=4"); + IOVEC_SET_STRING(iovec[n++], buf); + dispatch_message_real(s, iovec, n, ELEMENTSOF(iovec), &ucred, NULL, NULL, 0, NULL, LOG_INFO, 0); + } +} + +void server_dispatch_message( + Server *s, + struct iovec *iovec, unsigned n, unsigned m, + const struct ucred *ucred, + const struct timeval *tv, + const char *label, size_t label_len, + const char *unit_id, + int priority, + pid_t object_pid) { + + int rl, r; + _cleanup_free_ char *path = NULL; + uint64_t available = 0; + char *c; + + assert(s); + assert(iovec || n == 0); + + if (n == 0) + return; + + if (LOG_PRI(priority) > s->max_level_store) + return; + + /* Stop early in case the information will not be stored + * in a journal. */ + if (s->storage == STORAGE_NONE) + return; + + if (!ucred) + goto finish; + + r = cg_pid_get_path_shifted(ucred->pid, s->cgroup_root, &path); + if (r < 0) + goto finish; + + /* example: /user/lennart/3/foobar + * /system/dbus.service/foobar + * + * So let's cut of everything past the third /, since that is + * where user directories start */ + + c = strchr(path, '/'); + if (c) { + c = strchr(c+1, '/'); + if (c) { + c = strchr(c+1, '/'); + if (c) + *c = 0; + } + } + + (void) determine_space(s, false, false, &available, NULL); + rl = journal_rate_limit_test(s->rate_limit, path, priority & LOG_PRIMASK, available); + if (rl == 0) + return; + + /* Write a suppression message if we suppressed something */ + if (rl > 1) + server_driver_message(s, SD_MESSAGE_JOURNAL_DROPPED, + LOG_MESSAGE("Suppressed %u messages from %s", rl - 1, path), + NULL); + +finish: + dispatch_message_real(s, iovec, n, m, ucred, tv, label, label_len, unit_id, priority, object_pid); +} + + +static int system_journal_open(Server *s, bool flush_requested) { + const char *fn; + int r = 0; + + if (!s->system_journal && + (s->storage == STORAGE_PERSISTENT || s->storage == STORAGE_AUTO) && + (flush_requested + || access("/run/systemd/journal/flushed", F_OK) >= 0)) { + + /* If in auto mode: first try to create the machine + * path, but not the prefix. + * + * If in persistent mode: create /var/log/journal and + * the machine path */ + + if (s->storage == STORAGE_PERSISTENT) + (void) mkdir_p("/var/log/journal/", 0755); + + fn = strjoina("/var/log/journal/", SERVER_MACHINE_ID(s)); + (void) mkdir(fn, 0755); + + fn = strjoina(fn, "/system.journal"); + r = open_journal(s, true, fn, O_RDWR|O_CREAT, s->seal, &s->system_metrics, &s->system_journal); + if (r >= 0) { + server_add_acls(s->system_journal, 0); + (void) determine_space_for(s, &s->system_metrics, "/var/log/journal/", "System journal", true, true, NULL, NULL); + } else if (r < 0) { + if (r != -ENOENT && r != -EROFS) + log_warning_errno(r, "Failed to open system journal: %m"); + + r = 0; + } + } + + if (!s->runtime_journal && + (s->storage != STORAGE_NONE)) { + + fn = strjoina("/run/log/journal/", SERVER_MACHINE_ID(s), "/system.journal"); + + if (s->system_journal) { + + /* Try to open the runtime journal, but only + * if it already exists, so that we can flush + * it into the system journal */ + + r = open_journal(s, false, fn, O_RDWR, false, &s->runtime_metrics, &s->runtime_journal); + if (r < 0) { + if (r != -ENOENT) + log_warning_errno(r, "Failed to open runtime journal: %m"); + + r = 0; + } + + } else { + + /* OK, we really need the runtime journal, so create + * it if necessary. */ + + (void) mkdir("/run/log", 0755); + (void) mkdir("/run/log/journal", 0755); + (void) mkdir_parents(fn, 0750); + + r = open_journal(s, true, fn, O_RDWR|O_CREAT, false, &s->runtime_metrics, &s->runtime_journal); + if (r < 0) + return log_error_errno(r, "Failed to open runtime journal: %m"); + } + + if (s->runtime_journal) { + server_add_acls(s->runtime_journal, 0); + (void) determine_space_for(s, &s->runtime_metrics, "/run/log/journal/", "Runtime journal", true, true, NULL, NULL); + } + } + + return r; +} + +int server_flush_to_var(Server *s) { + sd_id128_t machine; + sd_journal *j = NULL; + char ts[FORMAT_TIMESPAN_MAX]; + usec_t start; + unsigned n = 0; + int r; + + assert(s); + + if (s->storage != STORAGE_AUTO && + s->storage != STORAGE_PERSISTENT) + return 0; + + if (!s->runtime_journal) + return 0; + + (void) system_journal_open(s, true); + + if (!s->system_journal) + return 0; + + log_debug("Flushing to /var..."); + + start = now(CLOCK_MONOTONIC); + + r = sd_id128_get_machine(&machine); + if (r < 0) + return r; + + r = sd_journal_open(&j, SD_JOURNAL_RUNTIME_ONLY); + if (r < 0) + return log_error_errno(r, "Failed to read runtime journal: %m"); + + sd_journal_set_data_threshold(j, 0); + + SD_JOURNAL_FOREACH(j) { + Object *o = NULL; + JournalFile *f; + + f = j->current_file; + assert(f && f->current_offset > 0); + + n++; + + r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o); + if (r < 0) { + log_error_errno(r, "Can't read entry: %m"); + goto finish; + } + + r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL); + if (r >= 0) + continue; + + if (!shall_try_append_again(s->system_journal, r)) { + log_error_errno(r, "Can't write entry: %m"); + goto finish; + } + + server_rotate(s); + server_vacuum(s, false, false); + + if (!s->system_journal) { + log_notice("Didn't flush runtime journal since rotation of system journal wasn't successful."); + r = -EIO; + goto finish; + } + + log_debug("Retrying write."); + r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL); + if (r < 0) { + log_error_errno(r, "Can't write entry: %m"); + goto finish; + } + } + + r = 0; + +finish: + journal_file_post_change(s->system_journal); + + s->runtime_journal = journal_file_close(s->runtime_journal); + + if (r >= 0) + (void) rm_rf("/run/log/journal", REMOVE_ROOT); + + sd_journal_close(j); + + server_driver_message(s, SD_ID128_NULL, + LOG_MESSAGE("Time spent on flushing to /var is %s for %u entries.", + format_timespan(ts, sizeof(ts), now(CLOCK_MONOTONIC) - start, 0), + n), + NULL); + + return r; +} + +int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata) { + Server *s = userdata; + struct ucred *ucred = NULL; + struct timeval *tv = NULL; + struct cmsghdr *cmsg; + char *label = NULL; + size_t label_len = 0, m; + struct iovec iovec; + ssize_t n; + int *fds = NULL, v = 0; + unsigned n_fds = 0; + + union { + struct cmsghdr cmsghdr; + + /* We use NAME_MAX space for the SELinux label + * here. The kernel currently enforces no + * limit, but according to suggestions from + * the SELinux people this will change and it + * will probably be identical to NAME_MAX. For + * now we use that, but this should be updated + * one day when the final limit is known. */ + uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) + + CMSG_SPACE(sizeof(struct timeval)) + + CMSG_SPACE(sizeof(int)) + /* fd */ + CMSG_SPACE(NAME_MAX)]; /* selinux label */ + } control = {}; + + union sockaddr_union sa = {}; + + struct msghdr msghdr = { + .msg_iov = &iovec, + .msg_iovlen = 1, + .msg_control = &control, + .msg_controllen = sizeof(control), + .msg_name = &sa, + .msg_namelen = sizeof(sa), + }; + + assert(s); + assert(fd == s->native_fd || fd == s->syslog_fd || fd == s->audit_fd); + + if (revents != EPOLLIN) { + log_error("Got invalid event from epoll for datagram fd: %"PRIx32, revents); + return -EIO; + } + + /* Try to get the right size, if we can. (Not all + * sockets support SIOCINQ, hence we just try, but + * don't rely on it. */ + (void) ioctl(fd, SIOCINQ, &v); + + /* Fix it up, if it is too small. We use the same fixed value as auditd here. Awful! */ + m = PAGE_ALIGN(MAX3((size_t) v + 1, + (size_t) LINE_MAX, + ALIGN(sizeof(struct nlmsghdr)) + ALIGN((size_t) MAX_AUDIT_MESSAGE_LENGTH)) + 1); + + if (!GREEDY_REALLOC(s->buffer, s->buffer_size, m)) + return log_oom(); + + iovec.iov_base = s->buffer; + iovec.iov_len = s->buffer_size - 1; /* Leave room for trailing NUL we add later */ + + n = recvmsg(fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC); + if (n < 0) { + if (errno == EINTR || errno == EAGAIN) + return 0; + + return log_error_errno(errno, "recvmsg() failed: %m"); + } + + CMSG_FOREACH(cmsg, &msghdr) { + + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDENTIALS && + cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) + ucred = (struct ucred*) CMSG_DATA(cmsg); + else if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_SECURITY) { + label = (char*) CMSG_DATA(cmsg); + label_len = cmsg->cmsg_len - CMSG_LEN(0); + } else if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SO_TIMESTAMP && + cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) + tv = (struct timeval*) CMSG_DATA(cmsg); + else if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_RIGHTS) { + fds = (int*) CMSG_DATA(cmsg); + n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); + } + } + + /* And a trailing NUL, just in case */ + s->buffer[n] = 0; + + if (fd == s->syslog_fd) { + if (n > 0 && n_fds == 0) + server_process_syslog_message(s, strstrip(s->buffer), ucred, tv, label, label_len); + else if (n_fds > 0) + log_warning("Got file descriptors via syslog socket. Ignoring."); + + } else if (fd == s->native_fd) { + if (n > 0 && n_fds == 0) + server_process_native_message(s, s->buffer, n, ucred, tv, label, label_len); + else if (n == 0 && n_fds == 1) + server_process_native_file(s, fds[0], ucred, tv, label, label_len); + else if (n_fds > 0) + log_warning("Got too many file descriptors via native socket. Ignoring."); + + } else { + assert(fd == s->audit_fd); + + if (n > 0 && n_fds == 0) + server_process_audit_message(s, s->buffer, n, ucred, &sa, msghdr.msg_namelen); + else if (n_fds > 0) + log_warning("Got file descriptors via audit socket. Ignoring."); + } + + close_many(fds, n_fds); + return 0; +} + +static int dispatch_sigusr1(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { + Server *s = userdata; + int r; + + assert(s); + + log_info("Received request to flush runtime journal from PID " PID_FMT, si->ssi_pid); + + server_flush_to_var(s); + server_sync(s); + server_vacuum(s, false, false); + + r = touch("/run/systemd/journal/flushed"); + if (r < 0) + log_warning_errno(r, "Failed to touch /run/systemd/journal/flushed, ignoring: %m"); + + return 0; +} + +static int dispatch_sigusr2(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { + Server *s = userdata; + int r; + + assert(s); + + log_info("Received request to rotate journal from PID " PID_FMT, si->ssi_pid); + server_rotate(s); + server_vacuum(s, true, true); + + /* Let clients know when the most recent rotation happened. */ + r = write_timestamp_file_atomic("/run/systemd/journal/rotated", now(CLOCK_MONOTONIC)); + if (r < 0) + log_warning_errno(r, "Failed to write /run/systemd/journal/rotated, ignoring: %m"); + + return 0; +} + +static int dispatch_sigterm(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { + Server *s = userdata; + + assert(s); + + log_received_signal(LOG_INFO, si); + + sd_event_exit(s->event, 0); + return 0; +} + +static int dispatch_sigrtmin1(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) { + Server *s = userdata; + int r; + + assert(s); + + log_debug("Received request to sync from PID " PID_FMT, si->ssi_pid); + + server_sync(s); + + /* Let clients know when the most recent sync happened. */ + r = write_timestamp_file_atomic("/run/systemd/journal/synced", now(CLOCK_MONOTONIC)); + if (r < 0) + log_warning_errno(r, "Failed to write /run/systemd/journal/synced, ignoring: %m"); + + return 0; +} + +static int setup_signals(Server *s) { + int r; + + assert(s); + + assert(sigprocmask_many(SIG_SETMASK, NULL, SIGINT, SIGTERM, SIGUSR1, SIGUSR2, SIGRTMIN+1, -1) >= 0); + + r = sd_event_add_signal(s->event, &s->sigusr1_event_source, SIGUSR1, dispatch_sigusr1, s); + if (r < 0) + return r; + + r = sd_event_add_signal(s->event, &s->sigusr2_event_source, SIGUSR2, dispatch_sigusr2, s); + if (r < 0) + return r; + + r = sd_event_add_signal(s->event, &s->sigterm_event_source, SIGTERM, dispatch_sigterm, s); + if (r < 0) + return r; + + /* Let's process SIGTERM late, so that we flush all queued + * messages to disk before we exit */ + r = sd_event_source_set_priority(s->sigterm_event_source, SD_EVENT_PRIORITY_NORMAL+20); + if (r < 0) + return r; + + /* When journald is invoked on the terminal (when debugging), + * it's useful if C-c is handled equivalent to SIGTERM. */ + r = sd_event_add_signal(s->event, &s->sigint_event_source, SIGINT, dispatch_sigterm, s); + if (r < 0) + return r; + + r = sd_event_source_set_priority(s->sigint_event_source, SD_EVENT_PRIORITY_NORMAL+20); + if (r < 0) + return r; + + /* SIGRTMIN+1 causes an immediate sync. We process this very + * late, so that everything else queued at this point is + * really written to disk. Clients can watch + * /run/systemd/journal/synced with inotify until its mtime + * changes to see when a sync happened. */ + r = sd_event_add_signal(s->event, &s->sigrtmin1_event_source, SIGRTMIN+1, dispatch_sigrtmin1, s); + if (r < 0) + return r; + + r = sd_event_source_set_priority(s->sigrtmin1_event_source, SD_EVENT_PRIORITY_NORMAL+15); + if (r < 0) + return r; + + return 0; +} + +static int server_parse_proc_cmdline(Server *s) { + _cleanup_free_ char *line = NULL; + const char *p; + int r; + + r = proc_cmdline(&line); + if (r < 0) { + log_warning_errno(r, "Failed to read /proc/cmdline, ignoring: %m"); + return 0; + } + + p = line; + for (;;) { + _cleanup_free_ char *word = NULL; + + r = extract_first_word(&p, &word, NULL, 0); + if (r < 0) + return log_error_errno(r, "Failed to parse journald syntax \"%s\": %m", line); + + if (r == 0) + break; + + if (startswith(word, "systemd.journald.forward_to_syslog=")) { + r = parse_boolean(word + 35); + if (r < 0) + log_warning("Failed to parse forward to syslog switch %s. Ignoring.", word + 35); + else + s->forward_to_syslog = r; + } else if (startswith(word, "systemd.journald.forward_to_kmsg=")) { + r = parse_boolean(word + 33); + if (r < 0) + log_warning("Failed to parse forward to kmsg switch %s. Ignoring.", word + 33); + else + s->forward_to_kmsg = r; + } else if (startswith(word, "systemd.journald.forward_to_console=")) { + r = parse_boolean(word + 36); + if (r < 0) + log_warning("Failed to parse forward to console switch %s. Ignoring.", word + 36); + else + s->forward_to_console = r; + } else if (startswith(word, "systemd.journald.forward_to_wall=")) { + r = parse_boolean(word + 33); + if (r < 0) + log_warning("Failed to parse forward to wall switch %s. Ignoring.", word + 33); + else + s->forward_to_wall = r; + } else if (startswith(word, "systemd.journald")) + log_warning("Invalid systemd.journald parameter. Ignoring."); + } + + /* do not warn about state here, since probably systemd already did */ + return 0; +} + +static int server_parse_config_file(Server *s) { + assert(s); + + return config_parse_many(PKGSYSCONFDIR "/journald.conf", + CONF_PATHS_NULSTR("systemd/journald.conf.d"), + "Journal\0", + config_item_perf_lookup, journald_gperf_lookup, + false, s); +} + +static int server_dispatch_sync(sd_event_source *es, usec_t t, void *userdata) { + Server *s = userdata; + + assert(s); + + server_sync(s); + return 0; +} + +int server_schedule_sync(Server *s, int priority) { + int r; + + assert(s); + + if (priority <= LOG_CRIT) { + /* Immediately sync to disk when this is of priority CRIT, ALERT, EMERG */ + server_sync(s); + return 0; + } + + if (s->sync_scheduled) + return 0; + + if (s->sync_interval_usec > 0) { + usec_t when; + + r = sd_event_now(s->event, CLOCK_MONOTONIC, &when); + if (r < 0) + return r; + + when += s->sync_interval_usec; + + if (!s->sync_event_source) { + r = sd_event_add_time( + s->event, + &s->sync_event_source, + CLOCK_MONOTONIC, + when, 0, + server_dispatch_sync, s); + if (r < 0) + return r; + + r = sd_event_source_set_priority(s->sync_event_source, SD_EVENT_PRIORITY_IMPORTANT); + } else { + r = sd_event_source_set_time(s->sync_event_source, when); + if (r < 0) + return r; + + r = sd_event_source_set_enabled(s->sync_event_source, SD_EVENT_ONESHOT); + } + if (r < 0) + return r; + + s->sync_scheduled = true; + } + + return 0; +} + +static int dispatch_hostname_change(sd_event_source *es, int fd, uint32_t revents, void *userdata) { + Server *s = userdata; + + assert(s); + + server_cache_hostname(s); + return 0; +} + +static int server_open_hostname(Server *s) { + int r; + + assert(s); + + s->hostname_fd = open("/proc/sys/kernel/hostname", O_RDONLY|O_CLOEXEC|O_NDELAY|O_NOCTTY); + if (s->hostname_fd < 0) + return log_error_errno(errno, "Failed to open /proc/sys/kernel/hostname: %m"); + + r = sd_event_add_io(s->event, &s->hostname_event_source, s->hostname_fd, 0, dispatch_hostname_change, s); + if (r < 0) { + /* kernels prior to 3.2 don't support polling this file. Ignore + * the failure. */ + if (r == -EPERM) { + log_warning_errno(r, "Failed to register hostname fd in event loop, ignoring: %m"); + s->hostname_fd = safe_close(s->hostname_fd); + return 0; + } + + return log_error_errno(r, "Failed to register hostname fd in event loop: %m"); + } + + r = sd_event_source_set_priority(s->hostname_event_source, SD_EVENT_PRIORITY_IMPORTANT-10); + if (r < 0) + return log_error_errno(r, "Failed to adjust priority of host name event source: %m"); + + return 0; +} + +static int dispatch_notify_event(sd_event_source *es, int fd, uint32_t revents, void *userdata) { + Server *s = userdata; + int r; + + assert(s); + assert(s->notify_event_source == es); + assert(s->notify_fd == fd); + + /* The $NOTIFY_SOCKET is writable again, now send exactly one + * message on it. Either it's the wtachdog event, the initial + * READY=1 event or an stdout stream event. If there's nothing + * to write anymore, turn our event source off. The next time + * there's something to send it will be turned on again. */ + + if (!s->sent_notify_ready) { + static const char p[] = + "READY=1\n" + "STATUS=Processing requests..."; + ssize_t l; + + l = send(s->notify_fd, p, strlen(p), MSG_DONTWAIT); + if (l < 0) { + if (errno == EAGAIN) + return 0; + + return log_error_errno(errno, "Failed to send READY=1 notification message: %m"); + } + + s->sent_notify_ready = true; + log_debug("Sent READY=1 notification."); + + } else if (s->send_watchdog) { + + static const char p[] = + "WATCHDOG=1"; + + ssize_t l; + + l = send(s->notify_fd, p, strlen(p), MSG_DONTWAIT); + if (l < 0) { + if (errno == EAGAIN) + return 0; + + return log_error_errno(errno, "Failed to send WATCHDOG=1 notification message: %m"); + } + + s->send_watchdog = false; + log_debug("Sent WATCHDOG=1 notification."); + + } else if (s->stdout_streams_notify_queue) + /* Dispatch one stream notification event */ + stdout_stream_send_notify(s->stdout_streams_notify_queue); + + /* Leave us enabled if there's still more to do. */ + if (s->send_watchdog || s->stdout_streams_notify_queue) + return 0; + + /* There was nothing to do anymore, let's turn ourselves off. */ + r = sd_event_source_set_enabled(es, SD_EVENT_OFF); + if (r < 0) + return log_error_errno(r, "Failed to turn off notify event source: %m"); + + return 0; +} + +static int dispatch_watchdog(sd_event_source *es, uint64_t usec, void *userdata) { + Server *s = userdata; + int r; + + assert(s); + + s->send_watchdog = true; + + r = sd_event_source_set_enabled(s->notify_event_source, SD_EVENT_ON); + if (r < 0) + log_warning_errno(r, "Failed to turn on notify event source: %m"); + + r = sd_event_source_set_time(s->watchdog_event_source, usec + s->watchdog_usec / 2); + if (r < 0) + return log_error_errno(r, "Failed to restart watchdog event source: %m"); + + r = sd_event_source_set_enabled(s->watchdog_event_source, SD_EVENT_ON); + if (r < 0) + return log_error_errno(r, "Failed to enable watchdog event source: %m"); + + return 0; +} + +static int server_connect_notify(Server *s) { + union sockaddr_union sa = { + .un.sun_family = AF_UNIX, + }; + const char *e; + int r; + + assert(s); + assert(s->notify_fd < 0); + assert(!s->notify_event_source); + + /* + So here's the problem: we'd like to send notification + messages to PID 1, but we cannot do that via sd_notify(), + since that's synchronous, and we might end up blocking on + it. Specifically: given that PID 1 might block on + dbus-daemon during IPC, and dbus-daemon is logging to us, + and might hence block on us, we might end up in a deadlock + if we block on sending PID 1 notification messages — by + generating a full blocking circle. To avoid this, let's + create a non-blocking socket, and connect it to the + notification socket, and then wait for POLLOUT before we + send anything. This should efficiently avoid any deadlocks, + as we'll never block on PID 1, hence PID 1 can safely block + on dbus-daemon which can safely block on us again. + + Don't think that this issue is real? It is, see: + https://github.com/systemd/systemd/issues/1505 + */ + + e = getenv("NOTIFY_SOCKET"); + if (!e) + return 0; + + if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { + log_error("NOTIFY_SOCKET set to an invalid value: %s", e); + return -EINVAL; + } + + if (strlen(e) > sizeof(sa.un.sun_path)) { + log_error("NOTIFY_SOCKET path too long: %s", e); + return -EINVAL; + } + + s->notify_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); + if (s->notify_fd < 0) + return log_error_errno(errno, "Failed to create notify socket: %m"); + + (void) fd_inc_sndbuf(s->notify_fd, NOTIFY_SNDBUF_SIZE); + + strncpy(sa.un.sun_path, e, sizeof(sa.un.sun_path)); + if (sa.un.sun_path[0] == '@') + sa.un.sun_path[0] = 0; + + r = connect(s->notify_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); + if (r < 0) + return log_error_errno(errno, "Failed to connect to notify socket: %m"); + + r = sd_event_add_io(s->event, &s->notify_event_source, s->notify_fd, EPOLLOUT, dispatch_notify_event, s); + if (r < 0) + return log_error_errno(r, "Failed to watch notification socket: %m"); + + if (sd_watchdog_enabled(false, &s->watchdog_usec) > 0) { + s->send_watchdog = true; + + r = sd_event_add_time(s->event, &s->watchdog_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + s->watchdog_usec/2, s->watchdog_usec/4, dispatch_watchdog, s); + if (r < 0) + return log_error_errno(r, "Failed to add watchdog time event: %m"); + } + + /* This should fire pretty soon, which we'll use to send the + * READY=1 event. */ + + return 0; +} + +int server_init(Server *s) { + _cleanup_fdset_free_ FDSet *fds = NULL; + int n, r, fd; + bool no_sockets; + + assert(s); + + zero(*s); + s->syslog_fd = s->native_fd = s->stdout_fd = s->dev_kmsg_fd = s->audit_fd = s->hostname_fd = s->notify_fd = -1; + s->compress = true; + s->seal = true; + + s->watchdog_usec = USEC_INFINITY; + + s->sync_interval_usec = DEFAULT_SYNC_INTERVAL_USEC; + s->sync_scheduled = false; + + s->rate_limit_interval = DEFAULT_RATE_LIMIT_INTERVAL; + s->rate_limit_burst = DEFAULT_RATE_LIMIT_BURST; + + s->forward_to_wall = true; + + s->max_file_usec = DEFAULT_MAX_FILE_USEC; + + s->max_level_store = LOG_DEBUG; + s->max_level_syslog = LOG_DEBUG; + s->max_level_kmsg = LOG_NOTICE; + s->max_level_console = LOG_INFO; + s->max_level_wall = LOG_EMERG; + + journal_reset_metrics(&s->system_metrics); + journal_reset_metrics(&s->runtime_metrics); + + server_parse_config_file(s); + server_parse_proc_cmdline(s); + + if (!!s->rate_limit_interval ^ !!s->rate_limit_burst) { + log_debug("Setting both rate limit interval and burst from "USEC_FMT",%u to 0,0", + s->rate_limit_interval, s->rate_limit_burst); + s->rate_limit_interval = s->rate_limit_burst = 0; + } + + (void) mkdir_p("/run/systemd/journal", 0755); + + s->user_journals = ordered_hashmap_new(NULL); + if (!s->user_journals) + return log_oom(); + + s->mmap = mmap_cache_new(); + if (!s->mmap) + return log_oom(); + + s->deferred_closes = set_new(NULL); + if (!s->deferred_closes) + return log_oom(); + + r = sd_event_default(&s->event); + if (r < 0) + return log_error_errno(r, "Failed to create event loop: %m"); + + n = sd_listen_fds(true); + if (n < 0) + return log_error_errno(n, "Failed to read listening file descriptors from environment: %m"); + + for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) { + + if (sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/run/systemd/journal/socket", 0) > 0) { + + if (s->native_fd >= 0) { + log_error("Too many native sockets passed."); + return -EINVAL; + } + + s->native_fd = fd; + + } else if (sd_is_socket_unix(fd, SOCK_STREAM, 1, "/run/systemd/journal/stdout", 0) > 0) { + + if (s->stdout_fd >= 0) { + log_error("Too many stdout sockets passed."); + return -EINVAL; + } + + s->stdout_fd = fd; + + } else if (sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/dev/log", 0) > 0 || + sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/run/systemd/journal/dev-log", 0) > 0) { + + if (s->syslog_fd >= 0) { + log_error("Too many /dev/log sockets passed."); + return -EINVAL; + } + + s->syslog_fd = fd; + + } else if (sd_is_socket(fd, AF_NETLINK, SOCK_RAW, -1) > 0) { + + if (s->audit_fd >= 0) { + log_error("Too many audit sockets passed."); + return -EINVAL; + } + + s->audit_fd = fd; + + } else { + + if (!fds) { + fds = fdset_new(); + if (!fds) + return log_oom(); + } + + r = fdset_put(fds, fd); + if (r < 0) + return log_oom(); + } + } + + /* Try to restore streams, but don't bother if this fails */ + (void) server_restore_streams(s, fds); + + if (fdset_size(fds) > 0) { + log_warning("%u unknown file descriptors passed, closing.", fdset_size(fds)); + fds = fdset_free(fds); + } + + no_sockets = s->native_fd < 0 && s->stdout_fd < 0 && s->syslog_fd < 0 && s->audit_fd < 0; + + /* always open stdout, syslog, native, and kmsg sockets */ + + /* systemd-journald.socket: /run/systemd/journal/stdout */ + r = server_open_stdout_socket(s); + if (r < 0) + return r; + + /* systemd-journald-dev-log.socket: /run/systemd/journal/dev-log */ + r = server_open_syslog_socket(s); + if (r < 0) + return r; + + /* systemd-journald.socket: /run/systemd/journal/socket */ + r = server_open_native_socket(s); + if (r < 0) + return r; + + /* /dev/ksmg */ + r = server_open_dev_kmsg(s); + if (r < 0) + return r; + + /* Unless we got *some* sockets and not audit, open audit socket */ + if (s->audit_fd >= 0 || no_sockets) { + r = server_open_audit(s); + if (r < 0) + return r; + } + + r = server_open_kernel_seqnum(s); + if (r < 0) + return r; + + r = server_open_hostname(s); + if (r < 0) + return r; + + r = setup_signals(s); + if (r < 0) + return r; + + s->udev = udev_new(); + if (!s->udev) + return -ENOMEM; + + s->rate_limit = journal_rate_limit_new(s->rate_limit_interval, s->rate_limit_burst); + if (!s->rate_limit) + return -ENOMEM; + + r = cg_get_root_path(&s->cgroup_root); + if (r < 0) + return r; + + server_cache_hostname(s); + server_cache_boot_id(s); + server_cache_machine_id(s); + + (void) server_connect_notify(s); + + return system_journal_open(s, false); +} + +void server_maybe_append_tags(Server *s) { +#ifdef HAVE_GCRYPT + JournalFile *f; + Iterator i; + usec_t n; + + n = now(CLOCK_REALTIME); + + if (s->system_journal) + journal_file_maybe_append_tag(s->system_journal, n); + + ORDERED_HASHMAP_FOREACH(f, s->user_journals, i) + journal_file_maybe_append_tag(f, n); +#endif +} + +void server_done(Server *s) { + JournalFile *f; + assert(s); + + if (s->deferred_closes) { + journal_file_close_set(s->deferred_closes); + set_free(s->deferred_closes); + } + + while (s->stdout_streams) + stdout_stream_free(s->stdout_streams); + + if (s->system_journal) + (void) journal_file_close(s->system_journal); + + if (s->runtime_journal) + (void) journal_file_close(s->runtime_journal); + + while ((f = ordered_hashmap_steal_first(s->user_journals))) + (void) journal_file_close(f); + + ordered_hashmap_free(s->user_journals); + + sd_event_source_unref(s->syslog_event_source); + sd_event_source_unref(s->native_event_source); + sd_event_source_unref(s->stdout_event_source); + sd_event_source_unref(s->dev_kmsg_event_source); + sd_event_source_unref(s->audit_event_source); + sd_event_source_unref(s->sync_event_source); + sd_event_source_unref(s->sigusr1_event_source); + sd_event_source_unref(s->sigusr2_event_source); + sd_event_source_unref(s->sigterm_event_source); + sd_event_source_unref(s->sigint_event_source); + sd_event_source_unref(s->sigrtmin1_event_source); + sd_event_source_unref(s->hostname_event_source); + sd_event_source_unref(s->notify_event_source); + sd_event_source_unref(s->watchdog_event_source); + sd_event_unref(s->event); + + safe_close(s->syslog_fd); + safe_close(s->native_fd); + safe_close(s->stdout_fd); + safe_close(s->dev_kmsg_fd); + safe_close(s->audit_fd); + safe_close(s->hostname_fd); + safe_close(s->notify_fd); + + if (s->rate_limit) + journal_rate_limit_free(s->rate_limit); + + if (s->kernel_seqnum) + munmap(s->kernel_seqnum, sizeof(uint64_t)); + + free(s->buffer); + free(s->tty_path); + free(s->cgroup_root); + free(s->hostname_field); + + if (s->mmap) + mmap_cache_unref(s->mmap); + + udev_unref(s->udev); +} + +static const char* const storage_table[_STORAGE_MAX] = { + [STORAGE_AUTO] = "auto", + [STORAGE_VOLATILE] = "volatile", + [STORAGE_PERSISTENT] = "persistent", + [STORAGE_NONE] = "none" +}; + +DEFINE_STRING_TABLE_LOOKUP(storage, Storage); +DEFINE_CONFIG_PARSE_ENUM(config_parse_storage, storage, Storage, "Failed to parse storage setting"); + +static const char* const split_mode_table[_SPLIT_MAX] = { + [SPLIT_LOGIN] = "login", + [SPLIT_UID] = "uid", + [SPLIT_NONE] = "none", +}; + +DEFINE_STRING_TABLE_LOOKUP(split_mode, SplitMode); +DEFINE_CONFIG_PARSE_ENUM(config_parse_split_mode, split_mode, SplitMode, "Failed to parse split mode setting"); diff --git a/src/grp-journal/libjournal-core/src/journald-stream.c b/src/grp-journal/libjournal-core/src/journald-stream.c new file mode 100644 index 0000000000..1c56cce0fc --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-stream.c @@ -0,0 +1,785 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#ifdef HAVE_SELINUX +#include +#endif + +#include +#include + +#include "journal-core/journald-console.h" +#include "journal-core/journald-kmsg.h" +#include "journal-core/journald-server.h" +#include "journal-core/journald-stream.h" +#include "journal-core/journald-syslog.h" +#include "journal-core/journald-wall.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/dirent-util.h" +#include "systemd-basic/escape.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/mkdir.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/selinux-util.h" +#include "systemd-basic/socket-util.h" +#include "systemd-basic/stdio-util.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/syslog-util.h" + +#define STDOUT_STREAMS_MAX 4096 + +typedef enum StdoutStreamState { + STDOUT_STREAM_IDENTIFIER, + STDOUT_STREAM_UNIT_ID, + STDOUT_STREAM_PRIORITY, + STDOUT_STREAM_LEVEL_PREFIX, + STDOUT_STREAM_FORWARD_TO_SYSLOG, + STDOUT_STREAM_FORWARD_TO_KMSG, + STDOUT_STREAM_FORWARD_TO_CONSOLE, + STDOUT_STREAM_RUNNING +} StdoutStreamState; + +struct StdoutStream { + Server *server; + StdoutStreamState state; + + int fd; + + struct ucred ucred; + char *label; + char *identifier; + char *unit_id; + int priority; + bool level_prefix:1; + bool forward_to_syslog:1; + bool forward_to_kmsg:1; + bool forward_to_console:1; + + bool fdstore:1; + bool in_notify_queue:1; + + char buffer[LINE_MAX+1]; + size_t length; + + sd_event_source *event_source; + + char *state_file; + + LIST_FIELDS(StdoutStream, stdout_stream); + LIST_FIELDS(StdoutStream, stdout_stream_notify_queue); +}; + +void stdout_stream_free(StdoutStream *s) { + if (!s) + return; + + if (s->server) { + assert(s->server->n_stdout_streams > 0); + s->server->n_stdout_streams--; + LIST_REMOVE(stdout_stream, s->server->stdout_streams, s); + + if (s->in_notify_queue) + LIST_REMOVE(stdout_stream_notify_queue, s->server->stdout_streams_notify_queue, s); + } + + if (s->event_source) { + sd_event_source_set_enabled(s->event_source, SD_EVENT_OFF); + s->event_source = sd_event_source_unref(s->event_source); + } + + safe_close(s->fd); + free(s->label); + free(s->identifier); + free(s->unit_id); + free(s->state_file); + + free(s); +} + +DEFINE_TRIVIAL_CLEANUP_FUNC(StdoutStream*, stdout_stream_free); + +static void stdout_stream_destroy(StdoutStream *s) { + if (!s) + return; + + if (s->state_file) + (void) unlink(s->state_file); + + stdout_stream_free(s); +} + +static int stdout_stream_save(StdoutStream *s) { + _cleanup_free_ char *temp_path = NULL; + _cleanup_fclose_ FILE *f = NULL; + int r; + + assert(s); + + if (s->state != STDOUT_STREAM_RUNNING) + return 0; + + if (!s->state_file) { + struct stat st; + + r = fstat(s->fd, &st); + if (r < 0) + return log_warning_errno(errno, "Failed to stat connected stream: %m"); + + /* We use device and inode numbers as identifier for the stream */ + if (asprintf(&s->state_file, "/run/systemd/journal/streams/%lu:%lu", (unsigned long) st.st_dev, (unsigned long) st.st_ino) < 0) + return log_oom(); + } + + mkdir_p("/run/systemd/journal/streams", 0755); + + r = fopen_temporary(s->state_file, &f, &temp_path); + if (r < 0) + goto fail; + + fprintf(f, + "# This is private data. Do not parse\n" + "PRIORITY=%i\n" + "LEVEL_PREFIX=%i\n" + "FORWARD_TO_SYSLOG=%i\n" + "FORWARD_TO_KMSG=%i\n" + "FORWARD_TO_CONSOLE=%i\n", + s->priority, + s->level_prefix, + s->forward_to_syslog, + s->forward_to_kmsg, + s->forward_to_console); + + if (!isempty(s->identifier)) { + _cleanup_free_ char *escaped; + + escaped = cescape(s->identifier); + if (!escaped) { + r = -ENOMEM; + goto fail; + } + + fprintf(f, "IDENTIFIER=%s\n", escaped); + } + + if (!isempty(s->unit_id)) { + _cleanup_free_ char *escaped; + + escaped = cescape(s->unit_id); + if (!escaped) { + r = -ENOMEM; + goto fail; + } + + fprintf(f, "UNIT=%s\n", escaped); + } + + r = fflush_and_check(f); + if (r < 0) + goto fail; + + if (rename(temp_path, s->state_file) < 0) { + r = -errno; + goto fail; + } + + if (!s->fdstore && !s->in_notify_queue) { + LIST_PREPEND(stdout_stream_notify_queue, s->server->stdout_streams_notify_queue, s); + s->in_notify_queue = true; + + if (s->server->notify_event_source) { + r = sd_event_source_set_enabled(s->server->notify_event_source, SD_EVENT_ON); + if (r < 0) + log_warning_errno(r, "Failed to enable notify event source: %m"); + } + } + + return 0; + +fail: + (void) unlink(s->state_file); + + if (temp_path) + (void) unlink(temp_path); + + return log_error_errno(r, "Failed to save stream data %s: %m", s->state_file); +} + +static int stdout_stream_log(StdoutStream *s, const char *p) { + struct iovec iovec[N_IOVEC_META_FIELDS + 5]; + int priority; + char syslog_priority[] = "PRIORITY=\0"; + char syslog_facility[sizeof("SYSLOG_FACILITY=")-1 + DECIMAL_STR_MAX(int) + 1]; + _cleanup_free_ char *message = NULL, *syslog_identifier = NULL; + unsigned n = 0; + size_t label_len; + + assert(s); + assert(p); + + priority = s->priority; + + if (s->level_prefix) + syslog_parse_priority(&p, &priority, false); + + if (isempty(p)) + return 0; + + if (s->forward_to_syslog || s->server->forward_to_syslog) + server_forward_syslog(s->server, syslog_fixup_facility(priority), s->identifier, p, &s->ucred, NULL); + + if (s->forward_to_kmsg || s->server->forward_to_kmsg) + server_forward_kmsg(s->server, priority, s->identifier, p, &s->ucred); + + if (s->forward_to_console || s->server->forward_to_console) + server_forward_console(s->server, priority, s->identifier, p, &s->ucred); + + if (s->server->forward_to_wall) + server_forward_wall(s->server, priority, s->identifier, p, &s->ucred); + + IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=stdout"); + + syslog_priority[strlen("PRIORITY=")] = '0' + LOG_PRI(priority); + IOVEC_SET_STRING(iovec[n++], syslog_priority); + + if (priority & LOG_FACMASK) { + xsprintf(syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)); + IOVEC_SET_STRING(iovec[n++], syslog_facility); + } + + if (s->identifier) { + syslog_identifier = strappend("SYSLOG_IDENTIFIER=", s->identifier); + if (syslog_identifier) + IOVEC_SET_STRING(iovec[n++], syslog_identifier); + } + + message = strappend("MESSAGE=", p); + if (message) + IOVEC_SET_STRING(iovec[n++], message); + + label_len = s->label ? strlen(s->label) : 0; + server_dispatch_message(s->server, iovec, n, ELEMENTSOF(iovec), &s->ucred, NULL, s->label, label_len, s->unit_id, priority, 0); + return 0; +} + +static int stdout_stream_line(StdoutStream *s, char *p) { + int r; + char *orig; + + assert(s); + assert(p); + + orig = p; + p = strstrip(p); + + switch (s->state) { + + case STDOUT_STREAM_IDENTIFIER: + if (isempty(p)) + s->identifier = NULL; + else { + s->identifier = strdup(p); + if (!s->identifier) + return log_oom(); + } + + s->state = STDOUT_STREAM_UNIT_ID; + return 0; + + case STDOUT_STREAM_UNIT_ID: + if (s->ucred.uid == 0) { + if (isempty(p)) + s->unit_id = NULL; + else { + s->unit_id = strdup(p); + if (!s->unit_id) + return log_oom(); + } + } + + s->state = STDOUT_STREAM_PRIORITY; + return 0; + + case STDOUT_STREAM_PRIORITY: + r = safe_atoi(p, &s->priority); + if (r < 0 || s->priority < 0 || s->priority > 999) { + log_warning("Failed to parse log priority line."); + return -EINVAL; + } + + s->state = STDOUT_STREAM_LEVEL_PREFIX; + return 0; + + case STDOUT_STREAM_LEVEL_PREFIX: + r = parse_boolean(p); + if (r < 0) { + log_warning("Failed to parse level prefix line."); + return -EINVAL; + } + + s->level_prefix = !!r; + s->state = STDOUT_STREAM_FORWARD_TO_SYSLOG; + return 0; + + case STDOUT_STREAM_FORWARD_TO_SYSLOG: + r = parse_boolean(p); + if (r < 0) { + log_warning("Failed to parse forward to syslog line."); + return -EINVAL; + } + + s->forward_to_syslog = !!r; + s->state = STDOUT_STREAM_FORWARD_TO_KMSG; + return 0; + + case STDOUT_STREAM_FORWARD_TO_KMSG: + r = parse_boolean(p); + if (r < 0) { + log_warning("Failed to parse copy to kmsg line."); + return -EINVAL; + } + + s->forward_to_kmsg = !!r; + s->state = STDOUT_STREAM_FORWARD_TO_CONSOLE; + return 0; + + case STDOUT_STREAM_FORWARD_TO_CONSOLE: + r = parse_boolean(p); + if (r < 0) { + log_warning("Failed to parse copy to console line."); + return -EINVAL; + } + + s->forward_to_console = !!r; + s->state = STDOUT_STREAM_RUNNING; + + /* Try to save the stream, so that journald can be restarted and we can recover */ + (void) stdout_stream_save(s); + return 0; + + case STDOUT_STREAM_RUNNING: + return stdout_stream_log(s, orig); + } + + assert_not_reached("Unknown stream state"); +} + +static int stdout_stream_scan(StdoutStream *s, bool force_flush) { + char *p; + size_t remaining; + int r; + + assert(s); + + p = s->buffer; + remaining = s->length; + for (;;) { + char *end; + size_t skip; + + end = memchr(p, '\n', remaining); + if (end) + skip = end - p + 1; + else if (remaining >= sizeof(s->buffer) - 1) { + end = p + sizeof(s->buffer) - 1; + skip = remaining; + } else + break; + + *end = 0; + + r = stdout_stream_line(s, p); + if (r < 0) + return r; + + remaining -= skip; + p += skip; + } + + if (force_flush && remaining > 0) { + p[remaining] = 0; + r = stdout_stream_line(s, p); + if (r < 0) + return r; + + p += remaining; + remaining = 0; + } + + if (p > s->buffer) { + memmove(s->buffer, p, remaining); + s->length = remaining; + } + + return 0; +} + +static int stdout_stream_process(sd_event_source *es, int fd, uint32_t revents, void *userdata) { + StdoutStream *s = userdata; + ssize_t l; + int r; + + assert(s); + + if ((revents|EPOLLIN|EPOLLHUP) != (EPOLLIN|EPOLLHUP)) { + log_error("Got invalid event from epoll for stdout stream: %"PRIx32, revents); + goto terminate; + } + + l = read(s->fd, s->buffer+s->length, sizeof(s->buffer)-1-s->length); + if (l < 0) { + + if (errno == EAGAIN) + return 0; + + log_warning_errno(errno, "Failed to read from stream: %m"); + goto terminate; + } + + if (l == 0) { + stdout_stream_scan(s, true); + goto terminate; + } + + s->length += l; + r = stdout_stream_scan(s, false); + if (r < 0) + goto terminate; + + return 1; + +terminate: + stdout_stream_destroy(s); + return 0; +} + +static int stdout_stream_install(Server *s, int fd, StdoutStream **ret) { + _cleanup_(stdout_stream_freep) StdoutStream *stream = NULL; + int r; + + assert(s); + assert(fd >= 0); + + stream = new0(StdoutStream, 1); + if (!stream) + return log_oom(); + + stream->fd = -1; + stream->priority = LOG_INFO; + + r = getpeercred(fd, &stream->ucred); + if (r < 0) + return log_error_errno(r, "Failed to determine peer credentials: %m"); + + if (mac_selinux_have()) { + r = getpeersec(fd, &stream->label); + if (r < 0 && r != -EOPNOTSUPP) + (void) log_warning_errno(r, "Failed to determine peer security context: %m"); + } + + (void) shutdown(fd, SHUT_WR); + + r = sd_event_add_io(s->event, &stream->event_source, fd, EPOLLIN, stdout_stream_process, stream); + if (r < 0) + return log_error_errno(r, "Failed to add stream to event loop: %m"); + + r = sd_event_source_set_priority(stream->event_source, SD_EVENT_PRIORITY_NORMAL+5); + if (r < 0) + return log_error_errno(r, "Failed to adjust stdout event source priority: %m"); + + stream->fd = fd; + + stream->server = s; + LIST_PREPEND(stdout_stream, s->stdout_streams, stream); + s->n_stdout_streams++; + + if (ret) + *ret = stream; + + stream = NULL; + + return 0; +} + +static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revents, void *userdata) { + _cleanup_close_ int fd = -1; + Server *s = userdata; + int r; + + assert(s); + + if (revents != EPOLLIN) { + log_error("Got invalid event from epoll for stdout server fd: %"PRIx32, revents); + return -EIO; + } + + fd = accept4(s->stdout_fd, NULL, NULL, SOCK_NONBLOCK|SOCK_CLOEXEC); + if (fd < 0) { + if (errno == EAGAIN) + return 0; + + return log_error_errno(errno, "Failed to accept stdout connection: %m"); + } + + if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) { + log_warning("Too many stdout streams, refusing connection."); + return 0; + } + + r = stdout_stream_install(s, fd, NULL); + if (r < 0) + return r; + + fd = -1; + return 0; +} + +static int stdout_stream_load(StdoutStream *stream, const char *fname) { + _cleanup_free_ char + *priority = NULL, + *level_prefix = NULL, + *forward_to_syslog = NULL, + *forward_to_kmsg = NULL, + *forward_to_console = NULL; + int r; + + assert(stream); + assert(fname); + + if (!stream->state_file) { + stream->state_file = strappend("/run/systemd/journal/streams/", fname); + if (!stream->state_file) + return log_oom(); + } + + r = parse_env_file(stream->state_file, NEWLINE, + "PRIORITY", &priority, + "LEVEL_PREFIX", &level_prefix, + "FORWARD_TO_SYSLOG", &forward_to_syslog, + "FORWARD_TO_KMSG", &forward_to_kmsg, + "FORWARD_TO_CONSOLE", &forward_to_console, + "IDENTIFIER", &stream->identifier, + "UNIT", &stream->unit_id, + NULL); + if (r < 0) + return log_error_errno(r, "Failed to read: %s", stream->state_file); + + if (priority) { + int p; + + p = log_level_from_string(priority); + if (p >= 0) + stream->priority = p; + } + + if (level_prefix) { + r = parse_boolean(level_prefix); + if (r >= 0) + stream->level_prefix = r; + } + + if (forward_to_syslog) { + r = parse_boolean(forward_to_syslog); + if (r >= 0) + stream->forward_to_syslog = r; + } + + if (forward_to_kmsg) { + r = parse_boolean(forward_to_kmsg); + if (r >= 0) + stream->forward_to_kmsg = r; + } + + if (forward_to_console) { + r = parse_boolean(forward_to_console); + if (r >= 0) + stream->forward_to_console = r; + } + + return 0; +} + +static int stdout_stream_restore(Server *s, const char *fname, int fd) { + StdoutStream *stream; + int r; + + assert(s); + assert(fname); + assert(fd >= 0); + + if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) { + log_warning("Too many stdout streams, refusing restoring of stream."); + return -ENOBUFS; + } + + r = stdout_stream_install(s, fd, &stream); + if (r < 0) + return r; + + stream->state = STDOUT_STREAM_RUNNING; + stream->fdstore = true; + + /* Ignore all parsing errors */ + (void) stdout_stream_load(stream, fname); + + return 0; +} + +int server_restore_streams(Server *s, FDSet *fds) { + _cleanup_closedir_ DIR *d = NULL; + struct dirent *de; + int r; + + d = opendir("/run/systemd/journal/streams"); + if (!d) { + if (errno == ENOENT) + return 0; + + return log_warning_errno(errno, "Failed to enumerate /run/systemd/journal/streams: %m"); + } + + FOREACH_DIRENT(de, d, goto fail) { + unsigned long st_dev, st_ino; + bool found = false; + Iterator i; + int fd; + + if (sscanf(de->d_name, "%lu:%lu", &st_dev, &st_ino) != 2) + continue; + + FDSET_FOREACH(fd, fds, i) { + struct stat st; + + if (fstat(fd, &st) < 0) + return log_error_errno(errno, "Failed to stat %s: %m", de->d_name); + + if (S_ISSOCK(st.st_mode) && st.st_dev == st_dev && st.st_ino == st_ino) { + found = true; + break; + } + } + + if (!found) { + /* No file descriptor? Then let's delete the state file */ + log_debug("Cannot restore stream file %s", de->d_name); + unlinkat(dirfd(d), de->d_name, 0); + continue; + } + + fdset_remove(fds, fd); + + r = stdout_stream_restore(s, de->d_name, fd); + if (r < 0) + safe_close(fd); + } + + return 0; + +fail: + return log_error_errno(errno, "Failed to read streams directory: %m"); +} + +int server_open_stdout_socket(Server *s) { + static const union sockaddr_union sa = { + .un.sun_family = AF_UNIX, + .un.sun_path = "/run/systemd/journal/stdout", + }; + int r; + + assert(s); + + if (s->stdout_fd < 0) { + s->stdout_fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); + if (s->stdout_fd < 0) + return log_error_errno(errno, "socket() failed: %m"); + + (void) unlink(sa.un.sun_path); + + r = bind(s->stdout_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); + if (r < 0) + return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path); + + (void) chmod(sa.un.sun_path, 0666); + + if (listen(s->stdout_fd, SOMAXCONN) < 0) + return log_error_errno(errno, "listen(%s) failed: %m", sa.un.sun_path); + } else + fd_nonblock(s->stdout_fd, 1); + + r = sd_event_add_io(s->event, &s->stdout_event_source, s->stdout_fd, EPOLLIN, stdout_stream_new, s); + if (r < 0) + return log_error_errno(r, "Failed to add stdout server fd to event source: %m"); + + r = sd_event_source_set_priority(s->stdout_event_source, SD_EVENT_PRIORITY_NORMAL+5); + if (r < 0) + return log_error_errno(r, "Failed to adjust priority of stdout server event source: %m"); + + return 0; +} + +void stdout_stream_send_notify(StdoutStream *s) { + struct iovec iovec = { + .iov_base = (char*) "FDSTORE=1", + .iov_len = strlen("FDSTORE=1"), + }; + struct msghdr msghdr = { + .msg_iov = &iovec, + .msg_iovlen = 1, + }; + struct cmsghdr *cmsg; + ssize_t l; + + assert(s); + assert(!s->fdstore); + assert(s->in_notify_queue); + assert(s->server); + assert(s->server->notify_fd >= 0); + + /* Store the connection fd in PID 1, so that we get it passed + * in again on next start */ + + msghdr.msg_controllen = CMSG_SPACE(sizeof(int)); + msghdr.msg_control = alloca0(msghdr.msg_controllen); + + cmsg = CMSG_FIRSTHDR(&msghdr); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + + memcpy(CMSG_DATA(cmsg), &s->fd, sizeof(int)); + + l = sendmsg(s->server->notify_fd, &msghdr, MSG_DONTWAIT|MSG_NOSIGNAL); + if (l < 0) { + if (errno == EAGAIN) + return; + + log_error_errno(errno, "Failed to send stream file descriptor to service manager: %m"); + } else { + log_debug("Successfully sent stream file descriptor to service manager."); + s->fdstore = 1; + } + + LIST_REMOVE(stdout_stream_notify_queue, s->server->stdout_streams_notify_queue, s); + s->in_notify_queue = false; + +} diff --git a/src/grp-journal/libjournal-core/src/journald-syslog.c b/src/grp-journal/libjournal-core/src/journald-syslog.c new file mode 100644 index 0000000000..054a44b39f --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-syslog.c @@ -0,0 +1,454 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include + +#include + +#include "journal-core/journald-console.h" +#include "journal-core/journald-kmsg.h" +#include "journal-core/journald-server.h" +#include "journal-core/journald-syslog.h" +#include "journal-core/journald-wall.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/formats-util.h" +#include "systemd-basic/io-util.h" +#include "systemd-basic/process-util.h" +#include "systemd-basic/selinux-util.h" +#include "systemd-basic/socket-util.h" +#include "systemd-basic/stdio-util.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/syslog-util.h" + +/* Warn once every 30s if we missed syslog message */ +#define WARN_FORWARD_SYSLOG_MISSED_USEC (30 * USEC_PER_SEC) + +static void forward_syslog_iovec(Server *s, const struct iovec *iovec, unsigned n_iovec, const struct ucred *ucred, const struct timeval *tv) { + + static const union sockaddr_union sa = { + .un.sun_family = AF_UNIX, + .un.sun_path = "/run/systemd/journal/syslog", + }; + struct msghdr msghdr = { + .msg_iov = (struct iovec *) iovec, + .msg_iovlen = n_iovec, + .msg_name = (struct sockaddr*) &sa.sa, + .msg_namelen = SOCKADDR_UN_LEN(sa.un), + }; + struct cmsghdr *cmsg; + union { + struct cmsghdr cmsghdr; + uint8_t buf[CMSG_SPACE(sizeof(struct ucred))]; + } control; + + assert(s); + assert(iovec); + assert(n_iovec > 0); + + if (ucred) { + zero(control); + msghdr.msg_control = &control; + msghdr.msg_controllen = sizeof(control); + + cmsg = CMSG_FIRSTHDR(&msghdr); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_CREDENTIALS; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); + memcpy(CMSG_DATA(cmsg), ucred, sizeof(struct ucred)); + msghdr.msg_controllen = cmsg->cmsg_len; + } + + /* Forward the syslog message we received via /dev/log to + * /run/systemd/syslog. Unfortunately we currently can't set + * the SO_TIMESTAMP auxiliary data, and hence we don't. */ + + if (sendmsg(s->syslog_fd, &msghdr, MSG_NOSIGNAL) >= 0) + return; + + /* The socket is full? I guess the syslog implementation is + * too slow, and we shouldn't wait for that... */ + if (errno == EAGAIN) { + s->n_forward_syslog_missed++; + return; + } + + if (ucred && (errno == ESRCH || errno == EPERM)) { + struct ucred u; + + /* Hmm, presumably the sender process vanished + * by now, or we don't have CAP_SYS_AMDIN, so + * let's fix it as good as we can, and retry */ + + u = *ucred; + u.pid = getpid(); + memcpy(CMSG_DATA(cmsg), &u, sizeof(struct ucred)); + + if (sendmsg(s->syslog_fd, &msghdr, MSG_NOSIGNAL) >= 0) + return; + + if (errno == EAGAIN) { + s->n_forward_syslog_missed++; + return; + } + } + + if (errno != ENOENT) + log_debug_errno(errno, "Failed to forward syslog message: %m"); +} + +static void forward_syslog_raw(Server *s, int priority, const char *buffer, const struct ucred *ucred, const struct timeval *tv) { + struct iovec iovec; + + assert(s); + assert(buffer); + + if (LOG_PRI(priority) > s->max_level_syslog) + return; + + IOVEC_SET_STRING(iovec, buffer); + forward_syslog_iovec(s, &iovec, 1, ucred, tv); +} + +void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv) { + struct iovec iovec[5]; + char header_priority[DECIMAL_STR_MAX(priority) + 3], header_time[64], + header_pid[sizeof("[]: ")-1 + DECIMAL_STR_MAX(pid_t) + 1]; + int n = 0; + time_t t; + struct tm *tm; + char *ident_buf = NULL; + + assert(s); + assert(priority >= 0); + assert(priority <= 999); + assert(message); + + if (LOG_PRI(priority) > s->max_level_syslog) + return; + + /* First: priority field */ + xsprintf(header_priority, "<%i>", priority); + IOVEC_SET_STRING(iovec[n++], header_priority); + + /* Second: timestamp */ + t = tv ? tv->tv_sec : ((time_t) (now(CLOCK_REALTIME) / USEC_PER_SEC)); + tm = localtime(&t); + if (!tm) + return; + if (strftime(header_time, sizeof(header_time), "%h %e %T ", tm) <= 0) + return; + IOVEC_SET_STRING(iovec[n++], header_time); + + /* Third: identifier and PID */ + if (ucred) { + if (!identifier) { + get_process_comm(ucred->pid, &ident_buf); + identifier = ident_buf; + } + + xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid); + + if (identifier) + IOVEC_SET_STRING(iovec[n++], identifier); + + IOVEC_SET_STRING(iovec[n++], header_pid); + } else if (identifier) { + IOVEC_SET_STRING(iovec[n++], identifier); + IOVEC_SET_STRING(iovec[n++], ": "); + } + + /* Fourth: message */ + IOVEC_SET_STRING(iovec[n++], message); + + forward_syslog_iovec(s, iovec, n, ucred, tv); + + free(ident_buf); +} + +int syslog_fixup_facility(int priority) { + + if ((priority & LOG_FACMASK) == 0) + return (priority & LOG_PRIMASK) | LOG_USER; + + return priority; +} + +size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) { + const char *p; + char *t; + size_t l, e; + + assert(buf); + assert(identifier); + assert(pid); + + p = *buf; + + p += strspn(p, WHITESPACE); + l = strcspn(p, WHITESPACE); + + if (l <= 0 || + p[l-1] != ':') + return 0; + + e = l; + l--; + + if (p[l-1] == ']') { + size_t k = l-1; + + for (;;) { + + if (p[k] == '[') { + t = strndup(p+k+1, l-k-2); + if (t) + *pid = t; + + l = k; + break; + } + + if (k == 0) + break; + + k--; + } + } + + t = strndup(p, l); + if (t) + *identifier = t; + + if (strchr(WHITESPACE, p[e])) + e++; + *buf = p + e; + return e; +} + +static void syslog_skip_date(char **buf) { + enum { + LETTER, + SPACE, + NUMBER, + SPACE_OR_NUMBER, + COLON + } sequence[] = { + LETTER, LETTER, LETTER, + SPACE, + SPACE_OR_NUMBER, NUMBER, + SPACE, + SPACE_OR_NUMBER, NUMBER, + COLON, + SPACE_OR_NUMBER, NUMBER, + COLON, + SPACE_OR_NUMBER, NUMBER, + SPACE + }; + + char *p; + unsigned i; + + assert(buf); + assert(*buf); + + p = *buf; + + for (i = 0; i < ELEMENTSOF(sequence); i++, p++) { + + if (!*p) + return; + + switch (sequence[i]) { + + case SPACE: + if (*p != ' ') + return; + break; + + case SPACE_OR_NUMBER: + if (*p == ' ') + break; + + /* fall through */ + + case NUMBER: + if (*p < '0' || *p > '9') + return; + + break; + + case LETTER: + if (!(*p >= 'A' && *p <= 'Z') && + !(*p >= 'a' && *p <= 'z')) + return; + + break; + + case COLON: + if (*p != ':') + return; + break; + + } + } + + *buf = p; +} + +void server_process_syslog_message( + Server *s, + const char *buf, + const struct ucred *ucred, + const struct timeval *tv, + const char *label, + size_t label_len) { + + char syslog_priority[sizeof("PRIORITY=") + DECIMAL_STR_MAX(int)], + syslog_facility[sizeof("SYSLOG_FACILITY=") + DECIMAL_STR_MAX(int)]; + const char *message = NULL, *syslog_identifier = NULL, *syslog_pid = NULL; + struct iovec iovec[N_IOVEC_META_FIELDS + 6]; + unsigned n = 0; + int priority = LOG_USER | LOG_INFO; + _cleanup_free_ char *identifier = NULL, *pid = NULL; + const char *orig; + + assert(s); + assert(buf); + + orig = buf; + syslog_parse_priority(&buf, &priority, true); + + if (s->forward_to_syslog) + forward_syslog_raw(s, priority, orig, ucred, tv); + + syslog_skip_date((char**) &buf); + syslog_parse_identifier(&buf, &identifier, &pid); + + if (s->forward_to_kmsg) + server_forward_kmsg(s, priority, identifier, buf, ucred); + + if (s->forward_to_console) + server_forward_console(s, priority, identifier, buf, ucred); + + if (s->forward_to_wall) + server_forward_wall(s, priority, identifier, buf, ucred); + + IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=syslog"); + + xsprintf(syslog_priority, "PRIORITY=%i", priority & LOG_PRIMASK); + IOVEC_SET_STRING(iovec[n++], syslog_priority); + + if (priority & LOG_FACMASK) { + xsprintf(syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority)); + IOVEC_SET_STRING(iovec[n++], syslog_facility); + } + + if (identifier) { + syslog_identifier = strjoina("SYSLOG_IDENTIFIER=", identifier); + IOVEC_SET_STRING(iovec[n++], syslog_identifier); + } + + if (pid) { + syslog_pid = strjoina("SYSLOG_PID=", pid); + IOVEC_SET_STRING(iovec[n++], syslog_pid); + } + + message = strjoina("MESSAGE=", buf); + if (message) + IOVEC_SET_STRING(iovec[n++], message); + + server_dispatch_message(s, iovec, n, ELEMENTSOF(iovec), ucred, tv, label, label_len, NULL, priority, 0); +} + +int server_open_syslog_socket(Server *s) { + + static const union sockaddr_union sa = { + .un.sun_family = AF_UNIX, + .un.sun_path = "/run/systemd/journal/dev-log", + }; + static const int one = 1; + int r; + + assert(s); + + if (s->syslog_fd < 0) { + s->syslog_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); + if (s->syslog_fd < 0) + return log_error_errno(errno, "socket() failed: %m"); + + (void) unlink(sa.un.sun_path); + + r = bind(s->syslog_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)); + if (r < 0) + return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path); + + (void) chmod(sa.un.sun_path, 0666); + } else + fd_nonblock(s->syslog_fd, 1); + + r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); + if (r < 0) + return log_error_errno(errno, "SO_PASSCRED failed: %m"); + +#ifdef HAVE_SELINUX + if (mac_selinux_have()) { + r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_PASSSEC, &one, sizeof(one)); + if (r < 0) + log_warning_errno(errno, "SO_PASSSEC failed: %m"); + } +#endif + + r = setsockopt(s->syslog_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)); + if (r < 0) + return log_error_errno(errno, "SO_TIMESTAMP failed: %m"); + + r = sd_event_add_io(s->event, &s->syslog_event_source, s->syslog_fd, EPOLLIN, server_process_datagram, s); + if (r < 0) + return log_error_errno(r, "Failed to add syslog server fd to event loop: %m"); + + r = sd_event_source_set_priority(s->syslog_event_source, SD_EVENT_PRIORITY_NORMAL+5); + if (r < 0) + return log_error_errno(r, "Failed to adjust syslog event source priority: %m"); + + return 0; +} + +void server_maybe_warn_forward_syslog_missed(Server *s) { + usec_t n; + + assert(s); + + if (s->n_forward_syslog_missed <= 0) + return; + + n = now(CLOCK_MONOTONIC); + if (s->last_warn_forward_syslog_missed + WARN_FORWARD_SYSLOG_MISSED_USEC > n) + return; + + server_driver_message(s, SD_MESSAGE_FORWARD_SYSLOG_MISSED, + LOG_MESSAGE("Forwarding to syslog missed %u messages.", + s->n_forward_syslog_missed), + NULL); + + s->n_forward_syslog_missed = 0; + s->last_warn_forward_syslog_missed = n; +} diff --git a/src/grp-journal/libjournal-core/src/journald-wall.c b/src/grp-journal/libjournal-core/src/journald-wall.c new file mode 100644 index 0000000000..242e69f6c3 --- /dev/null +++ b/src/grp-journal/libjournal-core/src/journald-wall.c @@ -0,0 +1,71 @@ +/*** + This file is part of systemd. + + Copyright 2014 Sebastian Thorarensen + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journal-core/journald-server.h" +#include "journal-core/journald-wall.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/formats-util.h" +#include "systemd-basic/process-util.h" +#include "systemd-basic/string-util.h" +#include "systemd-shared/utmp-wtmp.h" + +void server_forward_wall( + Server *s, + int priority, + const char *identifier, + const char *message, + const struct ucred *ucred) { + + _cleanup_free_ char *ident_buf = NULL, *l_buf = NULL; + const char *l; + int r; + + assert(s); + assert(message); + + if (LOG_PRI(priority) > s->max_level_wall) + return; + + if (ucred) { + if (!identifier) { + get_process_comm(ucred->pid, &ident_buf); + identifier = ident_buf; + } + + if (asprintf(&l_buf, "%s["PID_FMT"]: %s", strempty(identifier), ucred->pid, message) < 0) { + log_oom(); + return; + } + + l = l_buf; + + } else if (identifier) { + + l = l_buf = strjoin(identifier, ": ", message, NULL); + if (!l_buf) { + log_oom(); + return; + } + } else + l = message; + + r = utmp_wall(l, "systemd-journald", NULL, NULL, NULL); + if (r < 0) + log_debug_errno(r, "Failed to send wall message: %m"); +} diff --git a/src/grp-journal/libjournal-core/test-audit-type.c b/src/grp-journal/libjournal-core/test-audit-type.c deleted file mode 100644 index 812a3953ea..0000000000 --- a/src/grp-journal/libjournal-core/test-audit-type.c +++ /dev/null @@ -1,43 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2015 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include - -#include - -#include "sd-journal/audit-type.h" - -static void print_audit_label(int i) { - const char *name; - - name = audit_type_name_alloca(i); - /* This is a separate function only because of alloca */ - printf("%i → %s → %s\n", i, audit_type_to_string(i), name); -} - -static void test_audit_type(void) { - int i; - - for (i = 0; i <= AUDIT_KERNEL; i++) - print_audit_label(i); -} - -int main(int argc, char **argv) { - test_audit_type(); -} diff --git a/src/grp-journal/libjournal-core/test-catalog.c b/src/grp-journal/libjournal-core/test-catalog.c deleted file mode 100644 index 73ffb16104..0000000000 --- a/src/grp-journal/libjournal-core/test-catalog.c +++ /dev/null @@ -1,264 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2012 Lennart Poettering - Copyright 2013 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include -#include - -#include - -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/log.h" -#include "basic/macro.h" -#include "basic/string-util.h" -#include "basic/util.h" -#include "sd-journal/catalog.h" - -static const char *catalog_dirs[] = { - CATALOG_DIR, - NULL, -}; - -static const char *no_catalog_dirs[] = { - "/bin/hopefully/with/no/catalog", - NULL -}; - -static Hashmap * test_import(const char* contents, ssize_t size, int code) { - int r; - char name[] = "/tmp/test-catalog.XXXXXX"; - _cleanup_close_ int fd; - Hashmap *h; - - if (size < 0) - size = strlen(contents); - - assert_se(h = hashmap_new(&catalog_hash_ops)); - - fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC); - assert_se(fd >= 0); - assert_se(write(fd, contents, size) == size); - - r = catalog_import_file(h, name); - assert_se(r == code); - - unlink(name); - - return h; -} - -static void test_catalog_import_invalid(void) { - _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; - - h = test_import("xxx", -1, -EINVAL); - assert_se(hashmap_isempty(h)); -} - -static void test_catalog_import_badid(void) { - _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; - const char *input = -"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededede\n" \ -"Subject: message\n" \ -"\n" \ -"payload\n"; - h = test_import(input, -1, -EINVAL); -} - -static void test_catalog_import_one(void) { - _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; - char *payload; - Iterator j; - - const char *input = -"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ -"Subject: message\n" \ -"\n" \ -"payload\n"; - const char *expect = -"Subject: message\n" \ -"\n" \ -"payload\n"; - - h = test_import(input, -1, 0); - assert_se(hashmap_size(h) == 1); - - HASHMAP_FOREACH(payload, h, j) { - printf("expect: %s\n", expect); - printf("actual: %s\n", payload); - assert_se(streq(expect, payload)); - } -} - -static void test_catalog_import_merge(void) { - _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; - char *payload; - Iterator j; - - const char *input = -"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ -"Subject: message\n" \ -"Defined-By: me\n" \ -"\n" \ -"payload\n" \ -"\n" \ -"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ -"Subject: override subject\n" \ -"X-Header: hello\n" \ -"\n" \ -"override payload\n"; - - const char *combined = -"Subject: override subject\n" \ -"X-Header: hello\n" \ -"Subject: message\n" \ -"Defined-By: me\n" \ -"\n" \ -"override payload\n"; - - h = test_import(input, -1, 0); - assert_se(hashmap_size(h) == 1); - - HASHMAP_FOREACH(payload, h, j) { - assert_se(streq(combined, payload)); - } -} - -static void test_catalog_import_merge_no_body(void) { - _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; - char *payload; - Iterator j; - - const char *input = -"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ -"Subject: message\n" \ -"Defined-By: me\n" \ -"\n" \ -"payload\n" \ -"\n" \ -"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ -"Subject: override subject\n" \ -"X-Header: hello\n" \ -"\n"; - - const char *combined = -"Subject: override subject\n" \ -"X-Header: hello\n" \ -"Subject: message\n" \ -"Defined-By: me\n" \ -"\n" \ -"payload\n"; - - h = test_import(input, -1, 0); - assert_se(hashmap_size(h) == 1); - - HASHMAP_FOREACH(payload, h, j) { - assert_se(streq(combined, payload)); - } -} - -static const char* database = NULL; - -static void test_catalog_update(void) { - static char name[] = "/tmp/test-catalog.XXXXXX"; - int r; - - r = mkostemp_safe(name, O_RDWR|O_CLOEXEC); - assert_se(r >= 0); - - database = name; - - /* Test what happens if there are no files. */ - r = catalog_update(database, NULL, NULL); - assert_se(r >= 0); - - /* Test what happens if there are no files in the directory. */ - r = catalog_update(database, NULL, no_catalog_dirs); - assert_se(r >= 0); - - /* Make sure that we at least have some files loaded or the - catalog_list below will fail. */ - r = catalog_update(database, NULL, catalog_dirs); - assert_se(r >= 0); -} - -static void test_catalog_file_lang(void) { - _cleanup_free_ char *lang = NULL, *lang2 = NULL, *lang3 = NULL, *lang4 = NULL; - - assert_se(catalog_file_lang("systemd.de_DE.catalog", &lang) == 1); - assert_se(streq(lang, "de_DE")); - - assert_se(catalog_file_lang("systemd..catalog", &lang2) == 0); - assert_se(lang2 == NULL); - - assert_se(catalog_file_lang("systemd.fr.catalog", &lang2) == 1); - assert_se(streq(lang2, "fr")); - - assert_se(catalog_file_lang("systemd.fr.catalog.gz", &lang3) == 0); - assert_se(lang3 == NULL); - - assert_se(catalog_file_lang("systemd.01234567890123456789012345678901.catalog", &lang3) == 0); - assert_se(lang3 == NULL); - - assert_se(catalog_file_lang("systemd.0123456789012345678901234567890.catalog", &lang3) == 1); - assert_se(streq(lang3, "0123456789012345678901234567890")); - - assert_se(catalog_file_lang("/x/y/systemd.catalog", &lang4) == 0); - assert_se(lang4 == NULL); - - assert_se(catalog_file_lang("/x/y/systemd.ru_RU.catalog", &lang4) == 1); - assert_se(streq(lang4, "ru_RU")); -} - -int main(int argc, char *argv[]) { - _cleanup_free_ char *text = NULL; - int r; - - setlocale(LC_ALL, "de_DE.UTF-8"); - - log_parse_environment(); - log_open(); - - test_catalog_file_lang(); - - test_catalog_import_invalid(); - test_catalog_import_badid(); - test_catalog_import_one(); - test_catalog_import_merge(); - test_catalog_import_merge_no_body(); - - test_catalog_update(); - - r = catalog_list(stdout, database, true); - assert_se(r >= 0); - - r = catalog_list(stdout, database, false); - assert_se(r >= 0); - - assert_se(catalog_get(database, SD_MESSAGE_COREDUMP, &text) >= 0); - printf(">>>%s<<<\n", text); - - if (database) - unlink(database); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-compress-benchmark.c b/src/grp-journal/libjournal-core/test-compress-benchmark.c deleted file mode 100644 index 4292e4f8cb..0000000000 --- a/src/grp-journal/libjournal-core/test-compress-benchmark.c +++ /dev/null @@ -1,180 +0,0 @@ -/*** - This file is part of systemd - - Copyright 2014 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "basic/alloc-util.h" -#include "basic/macro.h" -#include "basic/parse-util.h" -#include "basic/random-util.h" -#include "basic/string-util.h" -#include "basic/util.h" -#include "sd-journal/compress.h" - -typedef int (compress_t)(const void *src, uint64_t src_size, void *dst, - size_t dst_alloc_size, size_t *dst_size); -typedef int (decompress_t)(const void *src, uint64_t src_size, - void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max); - -static usec_t arg_duration = 2 * USEC_PER_SEC; -static size_t arg_start; - -#define MAX_SIZE (1024*1024LU) -#define PRIME 1048571 /* A prime close enough to one megabyte that mod 4 == 3 */ - -static size_t _permute(size_t x) { - size_t residue; - - if (x >= PRIME) - return x; - - residue = x*x % PRIME; - if (x <= PRIME / 2) - return residue; - else - return PRIME - residue; -} - -static size_t permute(size_t x) { - return _permute((_permute(x) + arg_start) % MAX_SIZE ^ 0xFF345); -} - -static char* make_buf(size_t count, const char *type) { - char *buf; - size_t i; - - buf = malloc(count); - assert_se(buf); - - if (streq(type, "zeros")) - memzero(buf, count); - else if (streq(type, "simple")) - for (i = 0; i < count; i++) - buf[i] = 'a' + i % ('z' - 'a' + 1); - else if (streq(type, "random")) { - size_t step = count / 10; - - random_bytes(buf, step); - memzero(buf + 1*step, step); - random_bytes(buf + 2*step, step); - memzero(buf + 3*step, step); - random_bytes(buf + 4*step, step); - memzero(buf + 5*step, step); - random_bytes(buf + 6*step, step); - memzero(buf + 7*step, step); - random_bytes(buf + 8*step, step); - memzero(buf + 9*step, step); - } else - assert_not_reached("here"); - - return buf; -} - -static void test_compress_decompress(const char* label, const char* type, - compress_t compress, decompress_t decompress) { - usec_t n, n2 = 0; - float dt; - - _cleanup_free_ char *text, *buf; - _cleanup_free_ void *buf2 = NULL; - size_t buf2_allocated = 0; - size_t skipped = 0, compressed = 0, total = 0; - - text = make_buf(MAX_SIZE, type); - buf = calloc(MAX_SIZE + 1, 1); - assert_se(text && buf); - - n = now(CLOCK_MONOTONIC); - - for (size_t i = 0; i <= MAX_SIZE; i++) { - size_t j = 0, k = 0, size; - int r; - - size = permute(i); - if (size == 0) - continue; - - log_debug("%s %zu %zu", type, i, size); - - memzero(buf, MIN(size + 1000, MAX_SIZE)); - - r = compress(text, size, buf, size, &j); - /* assume compression must be successful except for small or random inputs */ - assert_se(r == 0 || (size < 2048 && r == -ENOBUFS) || streq(type, "random")); - - /* check for overwrites */ - assert_se(buf[size] == 0); - if (r != 0) { - skipped += size; - continue; - } - - assert_se(j > 0); - if (j >= size) - log_error("%s \"compressed\" %zu -> %zu", label, size, j); - - r = decompress(buf, j, &buf2, &buf2_allocated, &k, 0); - assert_se(r == 0); - assert_se(buf2_allocated >= k); - assert_se(k == size); - - assert_se(memcmp(text, buf2, size) == 0); - - total += size; - compressed += j; - - n2 = now(CLOCK_MONOTONIC); - if (n2 - n > arg_duration) - break; - } - - dt = (n2-n) / 1e6; - - log_info("%s/%s: compressed & decompressed %zu bytes in %.2fs (%.2fMiB/s), " - "mean compresion %.2f%%, skipped %zu bytes", - label, type, total, dt, - total / 1024. / 1024 / dt, - 100 - compressed * 100. / total, - skipped); -} - -int main(int argc, char *argv[]) { - const char *i; - - log_set_max_level(LOG_INFO); - - if (argc >= 2) { - unsigned x; - - assert_se(safe_atou(argv[1], &x) >= 0); - arg_duration = x * USEC_PER_SEC; - } - if (argc == 3) - (void) safe_atozu(argv[2], &arg_start); - else - arg_start = getpid(); - - NULSTR_FOREACH(i, "zeros\0simple\0random\0") { -#ifdef HAVE_XZ - test_compress_decompress("XZ", i, compress_blob_xz, decompress_blob_xz); -#endif -#ifdef HAVE_LZ4 - test_compress_decompress("LZ4", i, compress_blob_lz4, decompress_blob_lz4); -#endif - } - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-compress.c b/src/grp-journal/libjournal-core/test-compress.c deleted file mode 100644 index 5682c28e8c..0000000000 --- a/src/grp-journal/libjournal-core/test-compress.c +++ /dev/null @@ -1,308 +0,0 @@ -/*** - This file is part of systemd - - Copyright 2014 Ronny Chevalier - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#ifdef HAVE_LZ4 -#include -#endif - -#include "basic/alloc-util.h" -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/macro.h" -#include "basic/random-util.h" -#include "basic/util.h" -#include "sd-journal/compress.h" - -#ifdef HAVE_XZ -# define XZ_OK 0 -#else -# define XZ_OK -EPROTONOSUPPORT -#endif - -#ifdef HAVE_LZ4 -# define LZ4_OK 0 -#else -# define LZ4_OK -EPROTONOSUPPORT -#endif - -typedef int (compress_blob_t)(const void *src, uint64_t src_size, - void *dst, size_t dst_alloc_size, size_t *dst_size); -typedef int (decompress_blob_t)(const void *src, uint64_t src_size, - void **dst, size_t *dst_alloc_size, - size_t* dst_size, size_t dst_max); -typedef int (decompress_sw_t)(const void *src, uint64_t src_size, - void **buffer, size_t *buffer_size, - const void *prefix, size_t prefix_len, - uint8_t extra); - -typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes); -typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size); - -static void test_compress_decompress(int compression, - compress_blob_t compress, - decompress_blob_t decompress, - const char *data, - size_t data_len, - bool may_fail) { - char compressed[512]; - size_t csize, usize = 0; - _cleanup_free_ char *decompressed = NULL; - int r; - - log_info("/* testing %s %s blob compression/decompression */", - object_compressed_to_string(compression), data); - - r = compress(data, data_len, compressed, sizeof(compressed), &csize); - if (r == -ENOBUFS) { - log_info_errno(r, "compression failed: %m"); - assert_se(may_fail); - } else { - assert_se(r == 0); - r = decompress(compressed, csize, - (void **) &decompressed, &usize, &csize, 0); - assert_se(r == 0); - assert_se(decompressed); - assert_se(memcmp(decompressed, data, data_len) == 0); - } - - r = decompress("garbage", 7, - (void **) &decompressed, &usize, &csize, 0); - assert_se(r < 0); - - /* make sure to have the minimal lz4 compressed size */ - r = decompress("00000000\1g", 9, - (void **) &decompressed, &usize, &csize, 0); - assert_se(r < 0); - - r = decompress("\100000000g", 9, - (void **) &decompressed, &usize, &csize, 0); - assert_se(r < 0); - - memzero(decompressed, usize); -} - -static void test_decompress_startswith(int compression, - compress_blob_t compress, - decompress_sw_t decompress_sw, - const char *data, - size_t data_len, - bool may_fail) { - - char *compressed; - _cleanup_free_ char *compressed1 = NULL, *compressed2 = NULL, *decompressed = NULL; - size_t csize, usize = 0, len; - int r; - - log_info("/* testing decompress_startswith with %s on %.20s text*/", - object_compressed_to_string(compression), data); - -#define BUFSIZE_1 512 -#define BUFSIZE_2 20000 - - compressed = compressed1 = malloc(BUFSIZE_1); - assert_se(compressed1); - r = compress(data, data_len, compressed, BUFSIZE_1, &csize); - if (r == -ENOBUFS) { - log_info_errno(r, "compression failed: %m"); - assert_se(may_fail); - - compressed = compressed2 = malloc(BUFSIZE_2); - assert_se(compressed2); - r = compress(data, data_len, compressed, BUFSIZE_2, &csize); - assert(r == 0); - } - assert_se(r == 0); - - len = strlen(data); - - r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len, '\0'); - assert_se(r > 0); - r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len, 'w'); - assert_se(r == 0); - r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, "barbarbar", 9, ' '); - assert_se(r == 0); - r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len - 1, data[len-1]); - assert_se(r > 0); - r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len - 1, 'w'); - assert_se(r == 0); - r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len, '\0'); - assert_se(r > 0); -} - -static void test_compress_stream(int compression, - const char* cat, - compress_stream_t compress, - decompress_stream_t decompress, - const char *srcfile) { - - _cleanup_close_ int src = -1, dst = -1, dst2 = -1; - char pattern[] = "/tmp/systemd-test.compressed.XXXXXX", - pattern2[] = "/tmp/systemd-test.compressed.XXXXXX"; - int r; - _cleanup_free_ char *cmd = NULL, *cmd2; - struct stat st = {}; - - log_debug("/* testing %s compression */", - object_compressed_to_string(compression)); - - log_debug("/* create source from %s */", srcfile); - - assert_se((src = open(srcfile, O_RDONLY|O_CLOEXEC)) >= 0); - - log_debug("/* test compression */"); - - assert_se((dst = mkostemp_safe(pattern, O_RDWR|O_CLOEXEC)) >= 0); - - assert_se(compress(src, dst, -1) == 0); - - if (cat) { - assert_se(asprintf(&cmd, "%s %s | diff %s -", cat, pattern, srcfile) > 0); - assert_se(system(cmd) == 0); - } - - log_debug("/* test decompression */"); - - assert_se((dst2 = mkostemp_safe(pattern2, O_RDWR|O_CLOEXEC)) >= 0); - - assert_se(stat(srcfile, &st) == 0); - - assert_se(lseek(dst, 0, SEEK_SET) == 0); - r = decompress(dst, dst2, st.st_size); - assert_se(r == 0); - - assert_se(asprintf(&cmd2, "diff %s %s", srcfile, pattern2) > 0); - assert_se(system(cmd2) == 0); - - log_debug("/* test faulty decompression */"); - - assert_se(lseek(dst, 1, SEEK_SET) == 1); - r = decompress(dst, dst2, st.st_size); - assert_se(r == -EBADMSG || r == 0); - - assert_se(lseek(dst, 0, SEEK_SET) == 0); - assert_se(lseek(dst2, 0, SEEK_SET) == 0); - r = decompress(dst, dst2, st.st_size - 1); - assert_se(r == -EFBIG); - - assert_se(unlink(pattern) == 0); - assert_se(unlink(pattern2) == 0); -} - -#ifdef HAVE_LZ4 -static void test_lz4_decompress_partial(void) { - char buf[20000]; - size_t buf_size = sizeof(buf), compressed; - int r; - _cleanup_free_ char *huge = NULL; - -#define HUGE_SIZE (4096*1024) - huge = malloc(HUGE_SIZE); - memset(huge, 'x', HUGE_SIZE); - memcpy(huge, "HUGE=", 5); - - r = LZ4_compress_limitedOutput(huge, buf, HUGE_SIZE, buf_size); - assert_se(r >= 0); - compressed = r; - log_info("Compressed %i → %zu", HUGE_SIZE, compressed); - - r = LZ4_decompress_safe(buf, huge, r, HUGE_SIZE); - assert_se(r >= 0); - log_info("Decompressed → %i", r); - - r = LZ4_decompress_safe_partial(buf, huge, - compressed, - 12, HUGE_SIZE); - assert_se(r >= 0); - log_info("Decompressed partial %i/%i → %i", 12, HUGE_SIZE, r); - - /* We expect this to fail, because that's how current lz4 works. If this - * call succeeds, then lz4 has been fixed, and we need to change our code. - */ - r = LZ4_decompress_safe_partial(buf, huge, - compressed, - 12, HUGE_SIZE-1); - assert_se(r < 0); - log_info("Decompressed partial %i/%i → %i", 12, HUGE_SIZE-1, r); -} -#endif - -int main(int argc, char *argv[]) { - const char text[] = - "text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF" - "foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"; - - char data[512] = "random\0"; - - char huge[4096*1024]; - memset(huge, 'x', sizeof(huge)); - memcpy(huge, "HUGE=", 5); - char_array_0(huge); - - log_set_max_level(LOG_DEBUG); - - random_bytes(data + 7, sizeof(data) - 7); - -#ifdef HAVE_XZ - test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz, - text, sizeof(text), false); - test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz, - data, sizeof(data), true); - - test_decompress_startswith(OBJECT_COMPRESSED_XZ, - compress_blob_xz, decompress_startswith_xz, - text, sizeof(text), false); - test_decompress_startswith(OBJECT_COMPRESSED_XZ, - compress_blob_xz, decompress_startswith_xz, - data, sizeof(data), true); - test_decompress_startswith(OBJECT_COMPRESSED_XZ, - compress_blob_xz, decompress_startswith_xz, - huge, sizeof(huge), true); - - test_compress_stream(OBJECT_COMPRESSED_XZ, "xzcat", - compress_stream_xz, decompress_stream_xz, argv[0]); -#else - log_info("/* XZ test skipped */"); -#endif - -#ifdef HAVE_LZ4 - test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4, - text, sizeof(text), false); - test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4, - data, sizeof(data), true); - - test_decompress_startswith(OBJECT_COMPRESSED_LZ4, - compress_blob_lz4, decompress_startswith_lz4, - text, sizeof(text), false); - test_decompress_startswith(OBJECT_COMPRESSED_LZ4, - compress_blob_lz4, decompress_startswith_lz4, - data, sizeof(data), true); - test_decompress_startswith(OBJECT_COMPRESSED_LZ4, - compress_blob_lz4, decompress_startswith_lz4, - huge, sizeof(huge), true); - - test_compress_stream(OBJECT_COMPRESSED_LZ4, "lz4cat", - compress_stream_lz4, decompress_stream_lz4, argv[0]); - - test_lz4_decompress_partial(); -#else - log_info("/* LZ4 test skipped */"); -#endif - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-enum.c b/src/grp-journal/libjournal-core/test-journal-enum.c deleted file mode 100644 index 588e12c800..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-enum.c +++ /dev/null @@ -1,53 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2012 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include - -#include - -#include "basic/log.h" -#include "basic/macro.h" -#include "sd-journal/journal-internal.h" - -int main(int argc, char *argv[]) { - unsigned n = 0; - _cleanup_(sd_journal_closep) sd_journal*j = NULL; - - log_set_max_level(LOG_DEBUG); - - assert_se(sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY) >= 0); - - assert_se(sd_journal_add_match(j, "_TRANSPORT=syslog", 0) >= 0); - assert_se(sd_journal_add_match(j, "_UID=0", 0) >= 0); - - SD_JOURNAL_FOREACH_BACKWARDS(j) { - const void *d; - size_t l; - - assert_se(sd_journal_get_data(j, "MESSAGE", &d, &l) >= 0); - - printf("%.*s\n", (int) l, (char*) d); - - n++; - if (n >= 10) - break; - } - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-flush.c b/src/grp-journal/libjournal-core/test-journal-flush.c deleted file mode 100644 index 66ae8f83c4..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-flush.c +++ /dev/null @@ -1,75 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2013 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include - -#include - -#include "basic/alloc-util.h" -#include "basic/macro.h" -#include "basic/string-util.h" -#include "sd-journal/journal-file.h" -#include "sd-journal/journal-internal.h" - -int main(int argc, char *argv[]) { - _cleanup_free_ char *fn = NULL; - char dn[] = "/var/tmp/test-journal-flush.XXXXXX"; - JournalFile *new_journal = NULL; - sd_journal *j = NULL; - unsigned n = 0; - int r; - - assert_se(mkdtemp(dn)); - fn = strappend(dn, "/test.journal"); - - r = journal_file_open(-1, fn, O_CREAT|O_RDWR, 0644, false, false, NULL, NULL, NULL, NULL, &new_journal); - assert_se(r >= 0); - - r = sd_journal_open(&j, 0); - assert_se(r >= 0); - - sd_journal_set_data_threshold(j, 0); - - SD_JOURNAL_FOREACH(j) { - Object *o; - JournalFile *f; - - f = j->current_file; - assert_se(f && f->current_offset > 0); - - r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o); - assert_se(r >= 0); - - r = journal_file_copy_entry(f, new_journal, o, f->current_offset, NULL, NULL, NULL); - assert_se(r >= 0); - - n++; - if (n > 10000) - break; - } - - sd_journal_close(j); - - (void) journal_file_close(new_journal); - - unlink(fn); - assert_se(rmdir(dn) == 0); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-init.c b/src/grp-journal/libjournal-core/test-journal-init.c deleted file mode 100644 index c5f1d345e9..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-init.c +++ /dev/null @@ -1,64 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2013 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include - -#include "basic/log.h" -#include "basic/parse-util.h" -#include "basic/rm-rf.h" -#include "basic/util.h" - -int main(int argc, char *argv[]) { - sd_journal *j; - int r, i, I = 100; - char t[] = "/tmp/journal-stream-XXXXXX"; - - log_set_max_level(LOG_DEBUG); - - if (argc >= 2) { - r = safe_atoi(argv[1], &I); - if (r < 0) - log_info("Could not parse loop count argument. Using default."); - } - - log_info("Running %d loops", I); - - assert_se(mkdtemp(t)); - - for (i = 0; i < I; i++) { - r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); - assert_se(r == 0); - - sd_journal_close(j); - - r = sd_journal_open_directory(&j, t, 0); - assert_se(r == 0); - - sd_journal_close(j); - - j = NULL; - r = sd_journal_open_directory(&j, t, SD_JOURNAL_LOCAL_ONLY); - assert_se(r == -EINVAL); - assert_se(j == NULL); - } - - assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-interleaving.c b/src/grp-journal/libjournal-core/test-journal-interleaving.c deleted file mode 100644 index 004394d18a..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-interleaving.c +++ /dev/null @@ -1,307 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2013 Marius Vollmer - Copyright 2013 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#include - -#include "basic/alloc-util.h" -#include "basic/log.h" -#include "basic/parse-util.h" -#include "basic/rm-rf.h" -#include "basic/util.h" -#include "sd-journal/journal-file.h" -#include "sd-journal/journal-vacuum.h" - -/* This program tests skipping around in a multi-file journal. - */ - -static bool arg_keep = false; - -noreturn static void log_assert_errno(const char *text, int eno, const char *file, int line, const char *func) { - log_internal(LOG_CRIT, 0, file, line, func, - "'%s' failed at %s:%u (%s): %s.", - text, file, line, func, strerror(eno)); - abort(); -} - -#define assert_ret(expr) \ - do { \ - int _r_ = (expr); \ - if (_unlikely_(_r_ < 0)) \ - log_assert_errno(#expr, -_r_, __FILE__, __LINE__, __PRETTY_FUNCTION__); \ - } while (false) - -static JournalFile *test_open(const char *name) { - JournalFile *f; - assert_ret(journal_file_open(-1, name, O_RDWR|O_CREAT, 0644, true, false, NULL, NULL, NULL, NULL, &f)); - return f; -} - -static void test_close(JournalFile *f) { - (void) journal_file_close (f); -} - -static void append_number(JournalFile *f, int n, uint64_t *seqnum) { - char *p; - dual_timestamp ts; - static dual_timestamp previous_ts = {}; - struct iovec iovec[1]; - - dual_timestamp_get(&ts); - - if (ts.monotonic <= previous_ts.monotonic) - ts.monotonic = previous_ts.monotonic + 1; - - if (ts.realtime <= previous_ts.realtime) - ts.realtime = previous_ts.realtime + 1; - - previous_ts = ts; - - assert_se(asprintf(&p, "NUMBER=%d", n) >= 0); - iovec[0].iov_base = p; - iovec[0].iov_len = strlen(p); - assert_ret(journal_file_append_entry(f, &ts, iovec, 1, seqnum, NULL, NULL)); - free(p); -} - -static void test_check_number (sd_journal *j, int n) { - const void *d; - _cleanup_free_ char *k; - size_t l; - int x; - - assert_ret(sd_journal_get_data(j, "NUMBER", &d, &l)); - assert_se(k = strndup(d, l)); - printf("%s\n", k); - - assert_se(safe_atoi(k + 7, &x) >= 0); - assert_se(n == x); -} - -static void test_check_numbers_down (sd_journal *j, int count) { - int i; - - for (i = 1; i <= count; i++) { - int r; - test_check_number(j, i); - assert_ret(r = sd_journal_next(j)); - if (i == count) - assert_se(r == 0); - else - assert_se(r == 1); - } - -} - -static void test_check_numbers_up (sd_journal *j, int count) { - for (int i = count; i >= 1; i--) { - int r; - test_check_number(j, i); - assert_ret(r = sd_journal_previous(j)); - if (i == 1) - assert_se(r == 0); - else - assert_se(r == 1); - } - -} - -static void setup_sequential(void) { - JournalFile *one, *two; - one = test_open("one.journal"); - two = test_open("two.journal"); - append_number(one, 1, NULL); - append_number(one, 2, NULL); - append_number(two, 3, NULL); - append_number(two, 4, NULL); - test_close(one); - test_close(two); -} - -static void setup_interleaved(void) { - JournalFile *one, *two; - one = test_open("one.journal"); - two = test_open("two.journal"); - append_number(one, 1, NULL); - append_number(two, 2, NULL); - append_number(one, 3, NULL); - append_number(two, 4, NULL); - test_close(one); - test_close(two); -} - -static void test_skip(void (*setup)(void)) { - char t[] = "/tmp/journal-skip-XXXXXX"; - sd_journal *j; - int r; - - assert_se(mkdtemp(t)); - assert_se(chdir(t) >= 0); - - setup(); - - /* Seek to head, iterate down. - */ - assert_ret(sd_journal_open_directory(&j, t, 0)); - assert_ret(sd_journal_seek_head(j)); - assert_ret(sd_journal_next(j)); - test_check_numbers_down(j, 4); - sd_journal_close(j); - - /* Seek to tail, iterate up. - */ - assert_ret(sd_journal_open_directory(&j, t, 0)); - assert_ret(sd_journal_seek_tail(j)); - assert_ret(sd_journal_previous(j)); - test_check_numbers_up(j, 4); - sd_journal_close(j); - - /* Seek to tail, skip to head, iterate down. - */ - assert_ret(sd_journal_open_directory(&j, t, 0)); - assert_ret(sd_journal_seek_tail(j)); - assert_ret(r = sd_journal_previous_skip(j, 4)); - assert_se(r == 4); - test_check_numbers_down(j, 4); - sd_journal_close(j); - - /* Seek to head, skip to tail, iterate up. - */ - assert_ret(sd_journal_open_directory(&j, t, 0)); - assert_ret(sd_journal_seek_head(j)); - assert_ret(r = sd_journal_next_skip(j, 4)); - assert_se(r == 4); - test_check_numbers_up(j, 4); - sd_journal_close(j); - - log_info("Done..."); - - if (arg_keep) - log_info("Not removing %s", t); - else { - journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); - - assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); - } - - puts("------------------------------------------------------------"); -} - -static void test_sequence_numbers(void) { - - char t[] = "/tmp/journal-seq-XXXXXX"; - JournalFile *one, *two; - uint64_t seqnum = 0; - sd_id128_t seqnum_id; - - assert_se(mkdtemp(t)); - assert_se(chdir(t) >= 0); - - assert_se(journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, 0644, - true, false, NULL, NULL, NULL, NULL, &one) == 0); - - append_number(one, 1, &seqnum); - printf("seqnum=%"PRIu64"\n", seqnum); - assert_se(seqnum == 1); - append_number(one, 2, &seqnum); - printf("seqnum=%"PRIu64"\n", seqnum); - assert_se(seqnum == 2); - - assert_se(one->header->state == STATE_ONLINE); - assert_se(!sd_id128_equal(one->header->file_id, one->header->machine_id)); - assert_se(!sd_id128_equal(one->header->file_id, one->header->boot_id)); - assert_se(sd_id128_equal(one->header->file_id, one->header->seqnum_id)); - - memcpy(&seqnum_id, &one->header->seqnum_id, sizeof(sd_id128_t)); - - assert_se(journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, 0644, - true, false, NULL, NULL, NULL, one, &two) == 0); - - assert_se(two->header->state == STATE_ONLINE); - assert_se(!sd_id128_equal(two->header->file_id, one->header->file_id)); - assert_se(sd_id128_equal(one->header->machine_id, one->header->machine_id)); - assert_se(sd_id128_equal(one->header->boot_id, one->header->boot_id)); - assert_se(sd_id128_equal(one->header->seqnum_id, one->header->seqnum_id)); - - append_number(two, 3, &seqnum); - printf("seqnum=%"PRIu64"\n", seqnum); - assert_se(seqnum == 3); - append_number(two, 4, &seqnum); - printf("seqnum=%"PRIu64"\n", seqnum); - assert_se(seqnum == 4); - - test_close(two); - - append_number(one, 5, &seqnum); - printf("seqnum=%"PRIu64"\n", seqnum); - assert_se(seqnum == 5); - - append_number(one, 6, &seqnum); - printf("seqnum=%"PRIu64"\n", seqnum); - assert_se(seqnum == 6); - - test_close(one); - - /* restart server */ - seqnum = 0; - - assert_se(journal_file_open(-1, "two.journal", O_RDWR, 0, - true, false, NULL, NULL, NULL, NULL, &two) == 0); - - assert_se(sd_id128_equal(two->header->seqnum_id, seqnum_id)); - - append_number(two, 7, &seqnum); - printf("seqnum=%"PRIu64"\n", seqnum); - assert_se(seqnum == 5); - - /* So..., here we have the same seqnum in two files with the - * same seqnum_id. */ - - test_close(two); - - log_info("Done..."); - - if (arg_keep) - log_info("Not removing %s", t); - else { - journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); - - assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); - } -} - -int main(int argc, char *argv[]) { - log_set_max_level(LOG_DEBUG); - - /* journal_file_open requires a valid machine id */ - if (access("/etc/machine-id", F_OK) != 0) - return EXIT_TEST_SKIP; - - arg_keep = argc > 1; - - test_skip(setup_sequential); - test_skip(setup_interleaved); - - test_sequence_numbers(); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-match.c b/src/grp-journal/libjournal-core/test-journal-match.c deleted file mode 100644 index 967e30c46a..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-match.c +++ /dev/null @@ -1,76 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2012 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include - -#include - -#include "basic/alloc-util.h" -#include "basic/log.h" -#include "basic/string-util.h" -#include "basic/util.h" -#include "sd-journal/journal-internal.h" - -int main(int argc, char *argv[]) { - _cleanup_(sd_journal_closep) sd_journal*j = NULL; - _cleanup_free_ char *t; - - log_set_max_level(LOG_DEBUG); - - assert_se(sd_journal_open(&j, 0) >= 0); - - assert_se(sd_journal_add_match(j, "foobar", 0) < 0); - assert_se(sd_journal_add_match(j, "foobar=waldo", 0) < 0); - assert_se(sd_journal_add_match(j, "", 0) < 0); - assert_se(sd_journal_add_match(j, "=", 0) < 0); - assert_se(sd_journal_add_match(j, "=xxxxx", 0) < 0); - assert_se(sd_journal_add_match(j, "HALLO=WALDO", 0) >= 0); - assert_se(sd_journal_add_match(j, "QUUX=mmmm", 0) >= 0); - assert_se(sd_journal_add_match(j, "QUUX=xxxxx", 0) >= 0); - assert_se(sd_journal_add_match(j, "HALLO=", 0) >= 0); - assert_se(sd_journal_add_match(j, "QUUX=xxxxx", 0) >= 0); - assert_se(sd_journal_add_match(j, "QUUX=yyyyy", 0) >= 0); - assert_se(sd_journal_add_match(j, "PIFF=paff", 0) >= 0); - - assert_se(sd_journal_add_disjunction(j) >= 0); - - assert_se(sd_journal_add_match(j, "ONE=one", 0) >= 0); - assert_se(sd_journal_add_match(j, "ONE=two", 0) >= 0); - assert_se(sd_journal_add_match(j, "TWO=two", 0) >= 0); - - assert_se(sd_journal_add_conjunction(j) >= 0); - - assert_se(sd_journal_add_match(j, "L4_1=yes", 0) >= 0); - assert_se(sd_journal_add_match(j, "L4_1=ok", 0) >= 0); - assert_se(sd_journal_add_match(j, "L4_2=yes", 0) >= 0); - assert_se(sd_journal_add_match(j, "L4_2=ok", 0) >= 0); - - assert_se(sd_journal_add_disjunction(j) >= 0); - - assert_se(sd_journal_add_match(j, "L3=yes", 0) >= 0); - assert_se(sd_journal_add_match(j, "L3=ok", 0) >= 0); - - assert_se(t = journal_make_match_string(j)); - - printf("resulting match expression is: %s\n", t); - - assert_se(streq(t, "(((L3=ok OR L3=yes) OR ((L4_2=ok OR L4_2=yes) AND (L4_1=ok OR L4_1=yes))) AND ((TWO=two AND (ONE=two OR ONE=one)) OR (PIFF=paff AND (QUUX=yyyyy OR QUUX=xxxxx OR QUUX=mmmm) AND (HALLO= OR HALLO=WALDO))))")); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-send.c b/src/grp-journal/libjournal-core/test-journal-send.c deleted file mode 100644 index 192e12c887..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-send.c +++ /dev/null @@ -1,102 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include - -#include - -#include "basic/macro.h" - -int main(int argc, char *argv[]) { - char huge[4096*1024]; - - /* utf-8 and non-utf-8, message-less and message-ful iovecs */ - struct iovec graph1[] = { - {(char*) "GRAPH=graph", strlen("GRAPH=graph")} - }; - struct iovec graph2[] = { - {(char*) "GRAPH=graph\n", strlen("GRAPH=graph\n")} - }; - struct iovec message1[] = { - {(char*) "MESSAGE=graph", strlen("MESSAGE=graph")} - }; - struct iovec message2[] = { - {(char*) "MESSAGE=graph\n", strlen("MESSAGE=graph\n")} - }; - - assert_se(sd_journal_print(LOG_INFO, "piepapo") == 0); - - assert_se(sd_journal_send("MESSAGE=foobar", - "VALUE=%i", 7, - NULL) == 0); - - errno = ENOENT; - assert_se(sd_journal_perror("Foobar") == 0); - - assert_se(sd_journal_perror("") == 0); - - memset(huge, 'x', sizeof(huge)); - memcpy(huge, "HUGE=", 5); - char_array_0(huge); - - assert_se(sd_journal_send("MESSAGE=Huge field attached", - huge, - NULL) == 0); - - assert_se(sd_journal_send("MESSAGE=uiui", - "VALUE=A", - "VALUE=B", - "VALUE=C", - "SINGLETON=1", - "OTHERVALUE=X", - "OTHERVALUE=Y", - "WITH_BINARY=this is a binary value \a", - NULL) == 0); - - syslog(LOG_NOTICE, "Hello World!"); - - assert_se(sd_journal_print(LOG_NOTICE, "Hello World") == 0); - - assert_se(sd_journal_send("MESSAGE=Hello World!", - "MESSAGE_ID=52fb62f99e2c49d89cfbf9d6de5e3555", - "PRIORITY=5", - "HOME=%s", getenv("HOME"), - "TERM=%s", getenv("TERM"), - "PAGE_SIZE=%li", sysconf(_SC_PAGESIZE), - "N_CPUS=%li", sysconf(_SC_NPROCESSORS_ONLN), - NULL) == 0); - - assert_se(sd_journal_sendv(graph1, 1) == 0); - assert_se(sd_journal_sendv(graph2, 1) == 0); - assert_se(sd_journal_sendv(message1, 1) == 0); - assert_se(sd_journal_sendv(message2, 1) == 0); - - /* test without location fields */ -#undef sd_journal_sendv - assert_se(sd_journal_sendv(graph1, 1) == 0); - assert_se(sd_journal_sendv(graph2, 1) == 0); - assert_se(sd_journal_sendv(message1, 1) == 0); - assert_se(sd_journal_sendv(message2, 1) == 0); - - sleep(1); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-stream.c b/src/grp-journal/libjournal-core/test-journal-stream.c deleted file mode 100644 index b71c44ef56..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-stream.c +++ /dev/null @@ -1,196 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2012 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#include - -#include "basic/alloc-util.h" -#include "basic/log.h" -#include "basic/macro.h" -#include "basic/parse-util.h" -#include "basic/rm-rf.h" -#include "basic/util.h" -#include "sd-journal/journal-file.h" -#include "sd-journal/journal-internal.h" - -#define N_ENTRIES 200 - -static void verify_contents(sd_journal *j, unsigned skip) { - unsigned i; - - assert_se(j); - - i = 0; - SD_JOURNAL_FOREACH(j) { - const void *d; - char *k, *c; - size_t l; - unsigned u = 0; - - assert_se(sd_journal_get_cursor(j, &k) >= 0); - printf("cursor: %s\n", k); - free(k); - - assert_se(sd_journal_get_data(j, "MAGIC", &d, &l) >= 0); - printf("\t%.*s\n", (int) l, (const char*) d); - - assert_se(sd_journal_get_data(j, "NUMBER", &d, &l) >= 0); - assert_se(k = strndup(d, l)); - printf("\t%s\n", k); - - if (skip > 0) { - assert_se(safe_atou(k + 7, &u) >= 0); - assert_se(i == u); - i += skip; - } - - free(k); - - assert_se(sd_journal_get_cursor(j, &c) >= 0); - assert_se(sd_journal_test_cursor(j, c) > 0); - free(c); - } - - if (skip > 0) - assert_se(i == N_ENTRIES); -} - -int main(int argc, char *argv[]) { - JournalFile *one, *two, *three; - char t[] = "/tmp/journal-stream-XXXXXX"; - unsigned i; - _cleanup_(sd_journal_closep) sd_journal *j = NULL; - char *z; - const void *data; - size_t l; - dual_timestamp previous_ts = DUAL_TIMESTAMP_NULL; - - /* journal_file_open requires a valid machine id */ - if (access("/etc/machine-id", F_OK) != 0) - return EXIT_TEST_SKIP; - - log_set_max_level(LOG_DEBUG); - - assert_se(mkdtemp(t)); - assert_se(chdir(t) >= 0); - - assert_se(journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &one) == 0); - assert_se(journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &two) == 0); - assert_se(journal_file_open(-1, "three.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &three) == 0); - - for (i = 0; i < N_ENTRIES; i++) { - char *p, *q; - dual_timestamp ts; - struct iovec iovec[2]; - - dual_timestamp_get(&ts); - - if (ts.monotonic <= previous_ts.monotonic) - ts.monotonic = previous_ts.monotonic + 1; - - if (ts.realtime <= previous_ts.realtime) - ts.realtime = previous_ts.realtime + 1; - - previous_ts = ts; - - assert_se(asprintf(&p, "NUMBER=%u", i) >= 0); - iovec[0].iov_base = p; - iovec[0].iov_len = strlen(p); - - assert_se(asprintf(&q, "MAGIC=%s", i % 5 == 0 ? "quux" : "waldo") >= 0); - - iovec[1].iov_base = q; - iovec[1].iov_len = strlen(q); - - if (i % 10 == 0) - assert_se(journal_file_append_entry(three, &ts, iovec, 2, NULL, NULL, NULL) == 0); - else { - if (i % 3 == 0) - assert_se(journal_file_append_entry(two, &ts, iovec, 2, NULL, NULL, NULL) == 0); - - assert_se(journal_file_append_entry(one, &ts, iovec, 2, NULL, NULL, NULL) == 0); - } - - free(p); - free(q); - } - - (void) journal_file_close(one); - (void) journal_file_close(two); - (void) journal_file_close(three); - - assert_se(sd_journal_open_directory(&j, t, 0) >= 0); - - assert_se(sd_journal_add_match(j, "MAGIC=quux", 0) >= 0); - SD_JOURNAL_FOREACH_BACKWARDS(j) { - _cleanup_free_ char *c; - - assert_se(sd_journal_get_data(j, "NUMBER", &data, &l) >= 0); - printf("\t%.*s\n", (int) l, (const char*) data); - - assert_se(sd_journal_get_cursor(j, &c) >= 0); - assert_se(sd_journal_test_cursor(j, c) > 0); - } - - SD_JOURNAL_FOREACH(j) { - _cleanup_free_ char *c; - - assert_se(sd_journal_get_data(j, "NUMBER", &data, &l) >= 0); - printf("\t%.*s\n", (int) l, (const char*) data); - - assert_se(sd_journal_get_cursor(j, &c) >= 0); - assert_se(sd_journal_test_cursor(j, c) > 0); - } - - sd_journal_flush_matches(j); - - verify_contents(j, 1); - - printf("NEXT TEST\n"); - assert_se(sd_journal_add_match(j, "MAGIC=quux", 0) >= 0); - - assert_se(z = journal_make_match_string(j)); - printf("resulting match expression is: %s\n", z); - free(z); - - verify_contents(j, 5); - - printf("NEXT TEST\n"); - sd_journal_flush_matches(j); - assert_se(sd_journal_add_match(j, "MAGIC=waldo", 0) >= 0); - assert_se(sd_journal_add_match(j, "NUMBER=10", 0) >= 0); - assert_se(sd_journal_add_match(j, "NUMBER=11", 0) >= 0); - assert_se(sd_journal_add_match(j, "NUMBER=12", 0) >= 0); - - assert_se(z = journal_make_match_string(j)); - printf("resulting match expression is: %s\n", z); - free(z); - - verify_contents(j, 0); - - assert_se(sd_journal_query_unique(j, "NUMBER") >= 0); - SD_JOURNAL_FOREACH_UNIQUE(j, data, l) - printf("%.*s\n", (int) l, (const char*) data); - - assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-syslog.c b/src/grp-journal/libjournal-core/test-journal-syslog.c deleted file mode 100644 index 4756126478..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-syslog.c +++ /dev/null @@ -1,45 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "basic/alloc-util.h" -#include "basic/macro.h" -#include "basic/string-util.h" - -#include "journald-syslog.h" - -static void test_syslog_parse_identifier(const char* str, - const char *ident, const char*pid, int ret) { - const char *buf = str; - _cleanup_free_ char *ident2 = NULL, *pid2 = NULL; - int ret2; - - ret2 = syslog_parse_identifier(&buf, &ident2, &pid2); - - assert_se(ret == ret2); - assert_se(ident == ident2 || streq_ptr(ident, ident2)); - assert_se(pid == pid2 || streq_ptr(pid, pid2)); -} - -int main(void) { - test_syslog_parse_identifier("pidu[111]: xxx", "pidu", "111", 11); - test_syslog_parse_identifier("pidu: xxx", "pidu", NULL, 6); - test_syslog_parse_identifier("pidu xxx", NULL, NULL, 0); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal-verify.c b/src/grp-journal/libjournal-core/test-journal-verify.c deleted file mode 100644 index 485315c118..0000000000 --- a/src/grp-journal/libjournal-core/test-journal-verify.c +++ /dev/null @@ -1,150 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2012 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include - -#include "basic/fd-util.h" -#include "basic/log.h" -#include "basic/rm-rf.h" -#include "basic/terminal-util.h" -#include "basic/util.h" -#include "sd-journal/journal-file.h" -#include "sd-journal/journal-verify.h" - -#define N_ENTRIES 6000 -#define RANDOM_RANGE 77 - -static void bit_toggle(const char *fn, uint64_t p) { - uint8_t b; - ssize_t r; - int fd; - - fd = open(fn, O_RDWR|O_CLOEXEC); - assert_se(fd >= 0); - - r = pread(fd, &b, 1, p/8); - assert_se(r == 1); - - b ^= 1 << (p % 8); - - r = pwrite(fd, &b, 1, p/8); - assert_se(r == 1); - - safe_close(fd); -} - -static int raw_verify(const char *fn, const char *verification_key) { - JournalFile *f; - int r; - - r = journal_file_open(-1, fn, O_RDONLY, 0666, true, !!verification_key, NULL, NULL, NULL, NULL, &f); - if (r < 0) - return r; - - r = journal_file_verify(f, verification_key, NULL, NULL, NULL, false); - (void) journal_file_close(f); - - return r; -} - -int main(int argc, char *argv[]) { - char t[] = "/tmp/journal-XXXXXX"; - unsigned n; - JournalFile *f; - const char *verification_key = argv[1]; - usec_t from = 0, to = 0, total = 0; - char a[FORMAT_TIMESTAMP_MAX]; - char b[FORMAT_TIMESTAMP_MAX]; - char c[FORMAT_TIMESPAN_MAX]; - struct stat st; - uint64_t p; - - /* journal_file_open requires a valid machine id */ - if (access("/etc/machine-id", F_OK) != 0) - return EXIT_TEST_SKIP; - - log_set_max_level(LOG_DEBUG); - - assert_se(mkdtemp(t)); - assert_se(chdir(t) >= 0); - - log_info("Generating..."); - - assert_se(journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, true, !!verification_key, NULL, NULL, NULL, NULL, &f) == 0); - - for (n = 0; n < N_ENTRIES; n++) { - struct iovec iovec; - struct dual_timestamp ts; - char *test; - - dual_timestamp_get(&ts); - - assert_se(asprintf(&test, "RANDOM=%lu", random() % RANDOM_RANGE)); - - iovec.iov_base = (void*) test; - iovec.iov_len = strlen(test); - - assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); - - free(test); - } - - (void) journal_file_close(f); - - log_info("Verifying..."); - - assert_se(journal_file_open(-1, "test.journal", O_RDONLY, 0666, true, !!verification_key, NULL, NULL, NULL, NULL, &f) == 0); - /* journal_file_print_header(f); */ - journal_file_dump(f); - - assert_se(journal_file_verify(f, verification_key, &from, &to, &total, true) >= 0); - - if (verification_key && JOURNAL_HEADER_SEALED(f->header)) - log_info("=> Validated from %s to %s, %s missing", - format_timestamp(a, sizeof(a), from), - format_timestamp(b, sizeof(b), to), - format_timespan(c, sizeof(c), total > to ? total - to : 0, 0)); - - (void) journal_file_close(f); - - if (verification_key) { - log_info("Toggling bits..."); - - assert_se(stat("test.journal", &st) >= 0); - - for (p = 38448*8+0; p < ((uint64_t) st.st_size * 8); p ++) { - bit_toggle("test.journal", p); - - log_info("[ %"PRIu64"+%"PRIu64"]", p / 8, p % 8); - - if (raw_verify("test.journal", verification_key) >= 0) - log_notice(ANSI_HIGHLIGHT_RED ">>>> %"PRIu64" (bit %"PRIu64") can be toggled without detection." ANSI_NORMAL, p / 8, p % 8); - - bit_toggle("test.journal", p); - } - } - - log_info("Exiting..."); - - assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-journal.c b/src/grp-journal/libjournal-core/test-journal.c deleted file mode 100644 index 05de15f0c0..0000000000 --- a/src/grp-journal/libjournal-core/test-journal.c +++ /dev/null @@ -1,178 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#include "basic/log.h" -#include "basic/rm-rf.h" -#include "sd-journal/journal-authenticate.h" -#include "sd-journal/journal-file.h" -#include "sd-journal/journal-vacuum.h" - -static bool arg_keep = false; - -static void test_non_empty(void) { - dual_timestamp ts; - JournalFile *f; - struct iovec iovec; - static const char test[] = "TEST1=1", test2[] = "TEST2=2"; - Object *o; - uint64_t p; - char t[] = "/tmp/journal-XXXXXX"; - - log_set_max_level(LOG_DEBUG); - - assert_se(mkdtemp(t)); - assert_se(chdir(t) >= 0); - - assert_se(journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, true, true, NULL, NULL, NULL, NULL, &f) == 0); - - dual_timestamp_get(&ts); - - iovec.iov_base = (void*) test; - iovec.iov_len = strlen(test); - assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); - - iovec.iov_base = (void*) test2; - iovec.iov_len = strlen(test2); - assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); - - iovec.iov_base = (void*) test; - iovec.iov_len = strlen(test); - assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); - -#ifdef HAVE_GCRYPT - journal_file_append_tag(f); -#endif - journal_file_dump(f); - - assert_se(journal_file_next_entry(f, 0, DIRECTION_DOWN, &o, &p) == 1); - assert_se(le64toh(o->entry.seqnum) == 1); - - assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 1); - assert_se(le64toh(o->entry.seqnum) == 2); - - assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 1); - assert_se(le64toh(o->entry.seqnum) == 3); - - assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 0); - - assert_se(journal_file_next_entry(f, 0, DIRECTION_DOWN, &o, &p) == 1); - assert_se(le64toh(o->entry.seqnum) == 1); - - assert_se(journal_file_find_data_object(f, test, strlen(test), NULL, &p) == 1); - assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1); - assert_se(le64toh(o->entry.seqnum) == 1); - - assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1); - assert_se(le64toh(o->entry.seqnum) == 3); - - assert_se(journal_file_find_data_object(f, test2, strlen(test2), NULL, &p) == 1); - assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1); - assert_se(le64toh(o->entry.seqnum) == 2); - - assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1); - assert_se(le64toh(o->entry.seqnum) == 2); - - assert_se(journal_file_find_data_object(f, "quux", 4, NULL, &p) == 0); - - assert_se(journal_file_move_to_entry_by_seqnum(f, 1, DIRECTION_DOWN, &o, NULL) == 1); - assert_se(le64toh(o->entry.seqnum) == 1); - - assert_se(journal_file_move_to_entry_by_seqnum(f, 3, DIRECTION_DOWN, &o, NULL) == 1); - assert_se(le64toh(o->entry.seqnum) == 3); - - assert_se(journal_file_move_to_entry_by_seqnum(f, 2, DIRECTION_DOWN, &o, NULL) == 1); - assert_se(le64toh(o->entry.seqnum) == 2); - - assert_se(journal_file_move_to_entry_by_seqnum(f, 10, DIRECTION_DOWN, &o, NULL) == 0); - - journal_file_rotate(&f, true, true, NULL); - journal_file_rotate(&f, true, true, NULL); - - (void) journal_file_close(f); - - log_info("Done..."); - - if (arg_keep) - log_info("Not removing %s", t); - else { - journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); - - assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); - } - - puts("------------------------------------------------------------"); -} - -static void test_empty(void) { - JournalFile *f1, *f2, *f3, *f4; - char t[] = "/tmp/journal-XXXXXX"; - - log_set_max_level(LOG_DEBUG); - - assert_se(mkdtemp(t)); - assert_se(chdir(t) >= 0); - - assert_se(journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, false, false, NULL, NULL, NULL, NULL, &f1) == 0); - - assert_se(journal_file_open(-1, "test-compress.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &f2) == 0); - - assert_se(journal_file_open(-1, "test-seal.journal", O_RDWR|O_CREAT, 0666, false, true, NULL, NULL, NULL, NULL, &f3) == 0); - - assert_se(journal_file_open(-1, "test-seal-compress.journal", O_RDWR|O_CREAT, 0666, true, true, NULL, NULL, NULL, NULL, &f4) == 0); - - journal_file_print_header(f1); - puts(""); - journal_file_print_header(f2); - puts(""); - journal_file_print_header(f3); - puts(""); - journal_file_print_header(f4); - puts(""); - - log_info("Done..."); - - if (arg_keep) - log_info("Not removing %s", t); - else { - journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); - - assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); - } - - (void) journal_file_close(f1); - (void) journal_file_close(f2); - (void) journal_file_close(f3); - (void) journal_file_close(f4); -} - -int main(int argc, char *argv[]) { - arg_keep = argc > 1; - - /* journal_file_open requires a valid machine id */ - if (access("/etc/machine-id", F_OK) != 0) - return EXIT_TEST_SKIP; - - test_non_empty(); - test_empty(); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test-mmap-cache.c b/src/grp-journal/libjournal-core/test-mmap-cache.c deleted file mode 100644 index 3eb5444480..0000000000 --- a/src/grp-journal/libjournal-core/test-mmap-cache.c +++ /dev/null @@ -1,79 +0,0 @@ -/*** - This file is part of systemd. - - Copyright 2012 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include -#include - -#include "basic/fd-util.h" -#include "basic/fileio.h" -#include "basic/macro.h" -#include "basic/util.h" -#include "sd-journal/mmap-cache.h" - -int main(int argc, char *argv[]) { - int x, y, z, r; - char px[] = "/tmp/testmmapXXXXXXX", py[] = "/tmp/testmmapYXXXXXX", pz[] = "/tmp/testmmapZXXXXXX"; - MMapCache *m; - void *p, *q; - - assert_se(m = mmap_cache_new()); - - x = mkostemp_safe(px, O_RDWR|O_CLOEXEC); - assert_se(x >= 0); - unlink(px); - - y = mkostemp_safe(py, O_RDWR|O_CLOEXEC); - assert_se(y >= 0); - unlink(py); - - z = mkostemp_safe(pz, O_RDWR|O_CLOEXEC); - assert_se(z >= 0); - unlink(pz); - - r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p); - assert_se(r >= 0); - - r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q); - assert_se(r >= 0); - - assert_se((uint8_t*) p + 1 == (uint8_t*) q); - - r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q); - assert_se(r >= 0); - - assert_se((uint8_t*) p + 2 == (uint8_t*) q); - - r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p); - assert_se(r >= 0); - - r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q); - assert_se(r >= 0); - - assert_se((uint8_t*) p + 1 == (uint8_t*) q); - - mmap_cache_unref(m); - - safe_close(x); - safe_close(y); - safe_close(z); - - return 0; -} diff --git a/src/grp-journal/libjournal-core/test/test-audit-type.c b/src/grp-journal/libjournal-core/test/test-audit-type.c new file mode 100644 index 0000000000..812a3953ea --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-audit-type.c @@ -0,0 +1,43 @@ +/*** + This file is part of systemd. + + Copyright 2015 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +#include + +#include "sd-journal/audit-type.h" + +static void print_audit_label(int i) { + const char *name; + + name = audit_type_name_alloca(i); + /* This is a separate function only because of alloca */ + printf("%i → %s → %s\n", i, audit_type_to_string(i), name); +} + +static void test_audit_type(void) { + int i; + + for (i = 0; i <= AUDIT_KERNEL; i++) + print_audit_label(i); +} + +int main(int argc, char **argv) { + test_audit_type(); +} diff --git a/src/grp-journal/libjournal-core/test/test-catalog.c b/src/grp-journal/libjournal-core/test/test-catalog.c new file mode 100644 index 0000000000..8adc3832a6 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-catalog.c @@ -0,0 +1,264 @@ +/*** + This file is part of systemd. + + Copyright 2012 Lennart Poettering + Copyright 2013 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include +#include + +#include + +#include "sd-journal/catalog.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/log.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/util.h" + +static const char *catalog_dirs[] = { + CATALOG_DIR, + NULL, +}; + +static const char *no_catalog_dirs[] = { + "/bin/hopefully/with/no/catalog", + NULL +}; + +static Hashmap * test_import(const char* contents, ssize_t size, int code) { + int r; + char name[] = "/tmp/test-catalog.XXXXXX"; + _cleanup_close_ int fd; + Hashmap *h; + + if (size < 0) + size = strlen(contents); + + assert_se(h = hashmap_new(&catalog_hash_ops)); + + fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC); + assert_se(fd >= 0); + assert_se(write(fd, contents, size) == size); + + r = catalog_import_file(h, name); + assert_se(r == code); + + unlink(name); + + return h; +} + +static void test_catalog_import_invalid(void) { + _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; + + h = test_import("xxx", -1, -EINVAL); + assert_se(hashmap_isempty(h)); +} + +static void test_catalog_import_badid(void) { + _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; + const char *input = +"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededede\n" \ +"Subject: message\n" \ +"\n" \ +"payload\n"; + h = test_import(input, -1, -EINVAL); +} + +static void test_catalog_import_one(void) { + _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; + char *payload; + Iterator j; + + const char *input = +"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ +"Subject: message\n" \ +"\n" \ +"payload\n"; + const char *expect = +"Subject: message\n" \ +"\n" \ +"payload\n"; + + h = test_import(input, -1, 0); + assert_se(hashmap_size(h) == 1); + + HASHMAP_FOREACH(payload, h, j) { + printf("expect: %s\n", expect); + printf("actual: %s\n", payload); + assert_se(streq(expect, payload)); + } +} + +static void test_catalog_import_merge(void) { + _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; + char *payload; + Iterator j; + + const char *input = +"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ +"Subject: message\n" \ +"Defined-By: me\n" \ +"\n" \ +"payload\n" \ +"\n" \ +"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ +"Subject: override subject\n" \ +"X-Header: hello\n" \ +"\n" \ +"override payload\n"; + + const char *combined = +"Subject: override subject\n" \ +"X-Header: hello\n" \ +"Subject: message\n" \ +"Defined-By: me\n" \ +"\n" \ +"override payload\n"; + + h = test_import(input, -1, 0); + assert_se(hashmap_size(h) == 1); + + HASHMAP_FOREACH(payload, h, j) { + assert_se(streq(combined, payload)); + } +} + +static void test_catalog_import_merge_no_body(void) { + _cleanup_hashmap_free_free_free_ Hashmap *h = NULL; + char *payload; + Iterator j; + + const char *input = +"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ +"Subject: message\n" \ +"Defined-By: me\n" \ +"\n" \ +"payload\n" \ +"\n" \ +"-- 0027229ca0644181a76c4e92458afaff dededededededededededededededed\n" \ +"Subject: override subject\n" \ +"X-Header: hello\n" \ +"\n"; + + const char *combined = +"Subject: override subject\n" \ +"X-Header: hello\n" \ +"Subject: message\n" \ +"Defined-By: me\n" \ +"\n" \ +"payload\n"; + + h = test_import(input, -1, 0); + assert_se(hashmap_size(h) == 1); + + HASHMAP_FOREACH(payload, h, j) { + assert_se(streq(combined, payload)); + } +} + +static const char* database = NULL; + +static void test_catalog_update(void) { + static char name[] = "/tmp/test-catalog.XXXXXX"; + int r; + + r = mkostemp_safe(name, O_RDWR|O_CLOEXEC); + assert_se(r >= 0); + + database = name; + + /* Test what happens if there are no files. */ + r = catalog_update(database, NULL, NULL); + assert_se(r >= 0); + + /* Test what happens if there are no files in the directory. */ + r = catalog_update(database, NULL, no_catalog_dirs); + assert_se(r >= 0); + + /* Make sure that we at least have some files loaded or the + catalog_list below will fail. */ + r = catalog_update(database, NULL, catalog_dirs); + assert_se(r >= 0); +} + +static void test_catalog_file_lang(void) { + _cleanup_free_ char *lang = NULL, *lang2 = NULL, *lang3 = NULL, *lang4 = NULL; + + assert_se(catalog_file_lang("systemd.de_DE.catalog", &lang) == 1); + assert_se(streq(lang, "de_DE")); + + assert_se(catalog_file_lang("systemd..catalog", &lang2) == 0); + assert_se(lang2 == NULL); + + assert_se(catalog_file_lang("systemd.fr.catalog", &lang2) == 1); + assert_se(streq(lang2, "fr")); + + assert_se(catalog_file_lang("systemd.fr.catalog.gz", &lang3) == 0); + assert_se(lang3 == NULL); + + assert_se(catalog_file_lang("systemd.01234567890123456789012345678901.catalog", &lang3) == 0); + assert_se(lang3 == NULL); + + assert_se(catalog_file_lang("systemd.0123456789012345678901234567890.catalog", &lang3) == 1); + assert_se(streq(lang3, "0123456789012345678901234567890")); + + assert_se(catalog_file_lang("/x/y/systemd.catalog", &lang4) == 0); + assert_se(lang4 == NULL); + + assert_se(catalog_file_lang("/x/y/systemd.ru_RU.catalog", &lang4) == 1); + assert_se(streq(lang4, "ru_RU")); +} + +int main(int argc, char *argv[]) { + _cleanup_free_ char *text = NULL; + int r; + + setlocale(LC_ALL, "de_DE.UTF-8"); + + log_parse_environment(); + log_open(); + + test_catalog_file_lang(); + + test_catalog_import_invalid(); + test_catalog_import_badid(); + test_catalog_import_one(); + test_catalog_import_merge(); + test_catalog_import_merge_no_body(); + + test_catalog_update(); + + r = catalog_list(stdout, database, true); + assert_se(r >= 0); + + r = catalog_list(stdout, database, false); + assert_se(r >= 0); + + assert_se(catalog_get(database, SD_MESSAGE_COREDUMP, &text) >= 0); + printf(">>>%s<<<\n", text); + + if (database) + unlink(database); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-compress-benchmark.c b/src/grp-journal/libjournal-core/test/test-compress-benchmark.c new file mode 100644 index 0000000000..e3f45a5d67 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-compress-benchmark.c @@ -0,0 +1,180 @@ +/*** + This file is part of systemd + + Copyright 2014 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "sd-journal/compress.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/random-util.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/util.h" + +typedef int (compress_t)(const void *src, uint64_t src_size, void *dst, + size_t dst_alloc_size, size_t *dst_size); +typedef int (decompress_t)(const void *src, uint64_t src_size, + void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max); + +static usec_t arg_duration = 2 * USEC_PER_SEC; +static size_t arg_start; + +#define MAX_SIZE (1024*1024LU) +#define PRIME 1048571 /* A prime close enough to one megabyte that mod 4 == 3 */ + +static size_t _permute(size_t x) { + size_t residue; + + if (x >= PRIME) + return x; + + residue = x*x % PRIME; + if (x <= PRIME / 2) + return residue; + else + return PRIME - residue; +} + +static size_t permute(size_t x) { + return _permute((_permute(x) + arg_start) % MAX_SIZE ^ 0xFF345); +} + +static char* make_buf(size_t count, const char *type) { + char *buf; + size_t i; + + buf = malloc(count); + assert_se(buf); + + if (streq(type, "zeros")) + memzero(buf, count); + else if (streq(type, "simple")) + for (i = 0; i < count; i++) + buf[i] = 'a' + i % ('z' - 'a' + 1); + else if (streq(type, "random")) { + size_t step = count / 10; + + random_bytes(buf, step); + memzero(buf + 1*step, step); + random_bytes(buf + 2*step, step); + memzero(buf + 3*step, step); + random_bytes(buf + 4*step, step); + memzero(buf + 5*step, step); + random_bytes(buf + 6*step, step); + memzero(buf + 7*step, step); + random_bytes(buf + 8*step, step); + memzero(buf + 9*step, step); + } else + assert_not_reached("here"); + + return buf; +} + +static void test_compress_decompress(const char* label, const char* type, + compress_t compress, decompress_t decompress) { + usec_t n, n2 = 0; + float dt; + + _cleanup_free_ char *text, *buf; + _cleanup_free_ void *buf2 = NULL; + size_t buf2_allocated = 0; + size_t skipped = 0, compressed = 0, total = 0; + + text = make_buf(MAX_SIZE, type); + buf = calloc(MAX_SIZE + 1, 1); + assert_se(text && buf); + + n = now(CLOCK_MONOTONIC); + + for (size_t i = 0; i <= MAX_SIZE; i++) { + size_t j = 0, k = 0, size; + int r; + + size = permute(i); + if (size == 0) + continue; + + log_debug("%s %zu %zu", type, i, size); + + memzero(buf, MIN(size + 1000, MAX_SIZE)); + + r = compress(text, size, buf, size, &j); + /* assume compression must be successful except for small or random inputs */ + assert_se(r == 0 || (size < 2048 && r == -ENOBUFS) || streq(type, "random")); + + /* check for overwrites */ + assert_se(buf[size] == 0); + if (r != 0) { + skipped += size; + continue; + } + + assert_se(j > 0); + if (j >= size) + log_error("%s \"compressed\" %zu -> %zu", label, size, j); + + r = decompress(buf, j, &buf2, &buf2_allocated, &k, 0); + assert_se(r == 0); + assert_se(buf2_allocated >= k); + assert_se(k == size); + + assert_se(memcmp(text, buf2, size) == 0); + + total += size; + compressed += j; + + n2 = now(CLOCK_MONOTONIC); + if (n2 - n > arg_duration) + break; + } + + dt = (n2-n) / 1e6; + + log_info("%s/%s: compressed & decompressed %zu bytes in %.2fs (%.2fMiB/s), " + "mean compresion %.2f%%, skipped %zu bytes", + label, type, total, dt, + total / 1024. / 1024 / dt, + 100 - compressed * 100. / total, + skipped); +} + +int main(int argc, char *argv[]) { + const char *i; + + log_set_max_level(LOG_INFO); + + if (argc >= 2) { + unsigned x; + + assert_se(safe_atou(argv[1], &x) >= 0); + arg_duration = x * USEC_PER_SEC; + } + if (argc == 3) + (void) safe_atozu(argv[2], &arg_start); + else + arg_start = getpid(); + + NULSTR_FOREACH(i, "zeros\0simple\0random\0") { +#ifdef HAVE_XZ + test_compress_decompress("XZ", i, compress_blob_xz, decompress_blob_xz); +#endif +#ifdef HAVE_LZ4 + test_compress_decompress("LZ4", i, compress_blob_lz4, decompress_blob_lz4); +#endif + } + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-compress.c b/src/grp-journal/libjournal-core/test/test-compress.c new file mode 100644 index 0000000000..ad9ca34796 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-compress.c @@ -0,0 +1,308 @@ +/*** + This file is part of systemd + + Copyright 2014 Ronny Chevalier + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#ifdef HAVE_LZ4 +#include +#endif + +#include "sd-journal/compress.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/random-util.h" +#include "systemd-basic/util.h" + +#ifdef HAVE_XZ +# define XZ_OK 0 +#else +# define XZ_OK -EPROTONOSUPPORT +#endif + +#ifdef HAVE_LZ4 +# define LZ4_OK 0 +#else +# define LZ4_OK -EPROTONOSUPPORT +#endif + +typedef int (compress_blob_t)(const void *src, uint64_t src_size, + void *dst, size_t dst_alloc_size, size_t *dst_size); +typedef int (decompress_blob_t)(const void *src, uint64_t src_size, + void **dst, size_t *dst_alloc_size, + size_t* dst_size, size_t dst_max); +typedef int (decompress_sw_t)(const void *src, uint64_t src_size, + void **buffer, size_t *buffer_size, + const void *prefix, size_t prefix_len, + uint8_t extra); + +typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes); +typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size); + +static void test_compress_decompress(int compression, + compress_blob_t compress, + decompress_blob_t decompress, + const char *data, + size_t data_len, + bool may_fail) { + char compressed[512]; + size_t csize, usize = 0; + _cleanup_free_ char *decompressed = NULL; + int r; + + log_info("/* testing %s %s blob compression/decompression */", + object_compressed_to_string(compression), data); + + r = compress(data, data_len, compressed, sizeof(compressed), &csize); + if (r == -ENOBUFS) { + log_info_errno(r, "compression failed: %m"); + assert_se(may_fail); + } else { + assert_se(r == 0); + r = decompress(compressed, csize, + (void **) &decompressed, &usize, &csize, 0); + assert_se(r == 0); + assert_se(decompressed); + assert_se(memcmp(decompressed, data, data_len) == 0); + } + + r = decompress("garbage", 7, + (void **) &decompressed, &usize, &csize, 0); + assert_se(r < 0); + + /* make sure to have the minimal lz4 compressed size */ + r = decompress("00000000\1g", 9, + (void **) &decompressed, &usize, &csize, 0); + assert_se(r < 0); + + r = decompress("\100000000g", 9, + (void **) &decompressed, &usize, &csize, 0); + assert_se(r < 0); + + memzero(decompressed, usize); +} + +static void test_decompress_startswith(int compression, + compress_blob_t compress, + decompress_sw_t decompress_sw, + const char *data, + size_t data_len, + bool may_fail) { + + char *compressed; + _cleanup_free_ char *compressed1 = NULL, *compressed2 = NULL, *decompressed = NULL; + size_t csize, usize = 0, len; + int r; + + log_info("/* testing decompress_startswith with %s on %.20s text*/", + object_compressed_to_string(compression), data); + +#define BUFSIZE_1 512 +#define BUFSIZE_2 20000 + + compressed = compressed1 = malloc(BUFSIZE_1); + assert_se(compressed1); + r = compress(data, data_len, compressed, BUFSIZE_1, &csize); + if (r == -ENOBUFS) { + log_info_errno(r, "compression failed: %m"); + assert_se(may_fail); + + compressed = compressed2 = malloc(BUFSIZE_2); + assert_se(compressed2); + r = compress(data, data_len, compressed, BUFSIZE_2, &csize); + assert(r == 0); + } + assert_se(r == 0); + + len = strlen(data); + + r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len, '\0'); + assert_se(r > 0); + r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len, 'w'); + assert_se(r == 0); + r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, "barbarbar", 9, ' '); + assert_se(r == 0); + r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len - 1, data[len-1]); + assert_se(r > 0); + r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len - 1, 'w'); + assert_se(r == 0); + r = decompress_sw(compressed, csize, (void **) &decompressed, &usize, data, len, '\0'); + assert_se(r > 0); +} + +static void test_compress_stream(int compression, + const char* cat, + compress_stream_t compress, + decompress_stream_t decompress, + const char *srcfile) { + + _cleanup_close_ int src = -1, dst = -1, dst2 = -1; + char pattern[] = "/tmp/systemd-test.compressed.XXXXXX", + pattern2[] = "/tmp/systemd-test.compressed.XXXXXX"; + int r; + _cleanup_free_ char *cmd = NULL, *cmd2; + struct stat st = {}; + + log_debug("/* testing %s compression */", + object_compressed_to_string(compression)); + + log_debug("/* create source from %s */", srcfile); + + assert_se((src = open(srcfile, O_RDONLY|O_CLOEXEC)) >= 0); + + log_debug("/* test compression */"); + + assert_se((dst = mkostemp_safe(pattern, O_RDWR|O_CLOEXEC)) >= 0); + + assert_se(compress(src, dst, -1) == 0); + + if (cat) { + assert_se(asprintf(&cmd, "%s %s | diff %s -", cat, pattern, srcfile) > 0); + assert_se(system(cmd) == 0); + } + + log_debug("/* test decompression */"); + + assert_se((dst2 = mkostemp_safe(pattern2, O_RDWR|O_CLOEXEC)) >= 0); + + assert_se(stat(srcfile, &st) == 0); + + assert_se(lseek(dst, 0, SEEK_SET) == 0); + r = decompress(dst, dst2, st.st_size); + assert_se(r == 0); + + assert_se(asprintf(&cmd2, "diff %s %s", srcfile, pattern2) > 0); + assert_se(system(cmd2) == 0); + + log_debug("/* test faulty decompression */"); + + assert_se(lseek(dst, 1, SEEK_SET) == 1); + r = decompress(dst, dst2, st.st_size); + assert_se(r == -EBADMSG || r == 0); + + assert_se(lseek(dst, 0, SEEK_SET) == 0); + assert_se(lseek(dst2, 0, SEEK_SET) == 0); + r = decompress(dst, dst2, st.st_size - 1); + assert_se(r == -EFBIG); + + assert_se(unlink(pattern) == 0); + assert_se(unlink(pattern2) == 0); +} + +#ifdef HAVE_LZ4 +static void test_lz4_decompress_partial(void) { + char buf[20000]; + size_t buf_size = sizeof(buf), compressed; + int r; + _cleanup_free_ char *huge = NULL; + +#define HUGE_SIZE (4096*1024) + huge = malloc(HUGE_SIZE); + memset(huge, 'x', HUGE_SIZE); + memcpy(huge, "HUGE=", 5); + + r = LZ4_compress_limitedOutput(huge, buf, HUGE_SIZE, buf_size); + assert_se(r >= 0); + compressed = r; + log_info("Compressed %i → %zu", HUGE_SIZE, compressed); + + r = LZ4_decompress_safe(buf, huge, r, HUGE_SIZE); + assert_se(r >= 0); + log_info("Decompressed → %i", r); + + r = LZ4_decompress_safe_partial(buf, huge, + compressed, + 12, HUGE_SIZE); + assert_se(r >= 0); + log_info("Decompressed partial %i/%i → %i", 12, HUGE_SIZE, r); + + /* We expect this to fail, because that's how current lz4 works. If this + * call succeeds, then lz4 has been fixed, and we need to change our code. + */ + r = LZ4_decompress_safe_partial(buf, huge, + compressed, + 12, HUGE_SIZE-1); + assert_se(r < 0); + log_info("Decompressed partial %i/%i → %i", 12, HUGE_SIZE-1, r); +} +#endif + +int main(int argc, char *argv[]) { + const char text[] = + "text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF" + "foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"; + + char data[512] = "random\0"; + + char huge[4096*1024]; + memset(huge, 'x', sizeof(huge)); + memcpy(huge, "HUGE=", 5); + char_array_0(huge); + + log_set_max_level(LOG_DEBUG); + + random_bytes(data + 7, sizeof(data) - 7); + +#ifdef HAVE_XZ + test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz, + text, sizeof(text), false); + test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz, + data, sizeof(data), true); + + test_decompress_startswith(OBJECT_COMPRESSED_XZ, + compress_blob_xz, decompress_startswith_xz, + text, sizeof(text), false); + test_decompress_startswith(OBJECT_COMPRESSED_XZ, + compress_blob_xz, decompress_startswith_xz, + data, sizeof(data), true); + test_decompress_startswith(OBJECT_COMPRESSED_XZ, + compress_blob_xz, decompress_startswith_xz, + huge, sizeof(huge), true); + + test_compress_stream(OBJECT_COMPRESSED_XZ, "xzcat", + compress_stream_xz, decompress_stream_xz, argv[0]); +#else + log_info("/* XZ test skipped */"); +#endif + +#ifdef HAVE_LZ4 + test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4, + text, sizeof(text), false); + test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4, + data, sizeof(data), true); + + test_decompress_startswith(OBJECT_COMPRESSED_LZ4, + compress_blob_lz4, decompress_startswith_lz4, + text, sizeof(text), false); + test_decompress_startswith(OBJECT_COMPRESSED_LZ4, + compress_blob_lz4, decompress_startswith_lz4, + data, sizeof(data), true); + test_decompress_startswith(OBJECT_COMPRESSED_LZ4, + compress_blob_lz4, decompress_startswith_lz4, + huge, sizeof(huge), true); + + test_compress_stream(OBJECT_COMPRESSED_LZ4, "lz4cat", + compress_stream_lz4, decompress_stream_lz4, argv[0]); + + test_lz4_decompress_partial(); +#else + log_info("/* LZ4 test skipped */"); +#endif + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-enum.c b/src/grp-journal/libjournal-core/test/test-journal-enum.c new file mode 100644 index 0000000000..2c529f0544 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-enum.c @@ -0,0 +1,53 @@ +/*** + This file is part of systemd. + + Copyright 2012 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +#include + +#include "sd-journal/journal-internal.h" +#include "systemd-basic/log.h" +#include "systemd-basic/macro.h" + +int main(int argc, char *argv[]) { + unsigned n = 0; + _cleanup_(sd_journal_closep) sd_journal*j = NULL; + + log_set_max_level(LOG_DEBUG); + + assert_se(sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY) >= 0); + + assert_se(sd_journal_add_match(j, "_TRANSPORT=syslog", 0) >= 0); + assert_se(sd_journal_add_match(j, "_UID=0", 0) >= 0); + + SD_JOURNAL_FOREACH_BACKWARDS(j) { + const void *d; + size_t l; + + assert_se(sd_journal_get_data(j, "MESSAGE", &d, &l) >= 0); + + printf("%.*s\n", (int) l, (char*) d); + + n++; + if (n >= 10) + break; + } + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-flush.c b/src/grp-journal/libjournal-core/test/test-journal-flush.c new file mode 100644 index 0000000000..0ebec91563 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-flush.c @@ -0,0 +1,75 @@ +/*** + This file is part of systemd. + + Copyright 2013 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +#include + +#include "sd-journal/journal-file.h" +#include "sd-journal/journal-internal.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/string-util.h" + +int main(int argc, char *argv[]) { + _cleanup_free_ char *fn = NULL; + char dn[] = "/var/tmp/test-journal-flush.XXXXXX"; + JournalFile *new_journal = NULL; + sd_journal *j = NULL; + unsigned n = 0; + int r; + + assert_se(mkdtemp(dn)); + fn = strappend(dn, "/test.journal"); + + r = journal_file_open(-1, fn, O_CREAT|O_RDWR, 0644, false, false, NULL, NULL, NULL, NULL, &new_journal); + assert_se(r >= 0); + + r = sd_journal_open(&j, 0); + assert_se(r >= 0); + + sd_journal_set_data_threshold(j, 0); + + SD_JOURNAL_FOREACH(j) { + Object *o; + JournalFile *f; + + f = j->current_file; + assert_se(f && f->current_offset > 0); + + r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o); + assert_se(r >= 0); + + r = journal_file_copy_entry(f, new_journal, o, f->current_offset, NULL, NULL, NULL); + assert_se(r >= 0); + + n++; + if (n > 10000) + break; + } + + sd_journal_close(j); + + (void) journal_file_close(new_journal); + + unlink(fn); + assert_se(rmdir(dn) == 0); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-init.c b/src/grp-journal/libjournal-core/test/test-journal-init.c new file mode 100644 index 0000000000..719b99ab77 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-init.c @@ -0,0 +1,64 @@ +/*** + This file is part of systemd. + + Copyright 2013 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +#include "systemd-basic/log.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/rm-rf.h" +#include "systemd-basic/util.h" + +int main(int argc, char *argv[]) { + sd_journal *j; + int r, i, I = 100; + char t[] = "/tmp/journal-stream-XXXXXX"; + + log_set_max_level(LOG_DEBUG); + + if (argc >= 2) { + r = safe_atoi(argv[1], &I); + if (r < 0) + log_info("Could not parse loop count argument. Using default."); + } + + log_info("Running %d loops", I); + + assert_se(mkdtemp(t)); + + for (i = 0; i < I; i++) { + r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); + assert_se(r == 0); + + sd_journal_close(j); + + r = sd_journal_open_directory(&j, t, 0); + assert_se(r == 0); + + sd_journal_close(j); + + j = NULL; + r = sd_journal_open_directory(&j, t, SD_JOURNAL_LOCAL_ONLY); + assert_se(r == -EINVAL); + assert_se(j == NULL); + } + + assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-interleaving.c b/src/grp-journal/libjournal-core/test/test-journal-interleaving.c new file mode 100644 index 0000000000..4bf541d2b3 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-interleaving.c @@ -0,0 +1,307 @@ +/*** + This file is part of systemd. + + Copyright 2013 Marius Vollmer + Copyright 2013 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#include + +#include "sd-journal/journal-file.h" +#include "sd-journal/journal-vacuum.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/rm-rf.h" +#include "systemd-basic/util.h" + +/* This program tests skipping around in a multi-file journal. + */ + +static bool arg_keep = false; + +noreturn static void log_assert_errno(const char *text, int eno, const char *file, int line, const char *func) { + log_internal(LOG_CRIT, 0, file, line, func, + "'%s' failed at %s:%u (%s): %s.", + text, file, line, func, strerror(eno)); + abort(); +} + +#define assert_ret(expr) \ + do { \ + int _r_ = (expr); \ + if (_unlikely_(_r_ < 0)) \ + log_assert_errno(#expr, -_r_, __FILE__, __LINE__, __PRETTY_FUNCTION__); \ + } while (false) + +static JournalFile *test_open(const char *name) { + JournalFile *f; + assert_ret(journal_file_open(-1, name, O_RDWR|O_CREAT, 0644, true, false, NULL, NULL, NULL, NULL, &f)); + return f; +} + +static void test_close(JournalFile *f) { + (void) journal_file_close (f); +} + +static void append_number(JournalFile *f, int n, uint64_t *seqnum) { + char *p; + dual_timestamp ts; + static dual_timestamp previous_ts = {}; + struct iovec iovec[1]; + + dual_timestamp_get(&ts); + + if (ts.monotonic <= previous_ts.monotonic) + ts.monotonic = previous_ts.monotonic + 1; + + if (ts.realtime <= previous_ts.realtime) + ts.realtime = previous_ts.realtime + 1; + + previous_ts = ts; + + assert_se(asprintf(&p, "NUMBER=%d", n) >= 0); + iovec[0].iov_base = p; + iovec[0].iov_len = strlen(p); + assert_ret(journal_file_append_entry(f, &ts, iovec, 1, seqnum, NULL, NULL)); + free(p); +} + +static void test_check_number (sd_journal *j, int n) { + const void *d; + _cleanup_free_ char *k; + size_t l; + int x; + + assert_ret(sd_journal_get_data(j, "NUMBER", &d, &l)); + assert_se(k = strndup(d, l)); + printf("%s\n", k); + + assert_se(safe_atoi(k + 7, &x) >= 0); + assert_se(n == x); +} + +static void test_check_numbers_down (sd_journal *j, int count) { + int i; + + for (i = 1; i <= count; i++) { + int r; + test_check_number(j, i); + assert_ret(r = sd_journal_next(j)); + if (i == count) + assert_se(r == 0); + else + assert_se(r == 1); + } + +} + +static void test_check_numbers_up (sd_journal *j, int count) { + for (int i = count; i >= 1; i--) { + int r; + test_check_number(j, i); + assert_ret(r = sd_journal_previous(j)); + if (i == 1) + assert_se(r == 0); + else + assert_se(r == 1); + } + +} + +static void setup_sequential(void) { + JournalFile *one, *two; + one = test_open("one.journal"); + two = test_open("two.journal"); + append_number(one, 1, NULL); + append_number(one, 2, NULL); + append_number(two, 3, NULL); + append_number(two, 4, NULL); + test_close(one); + test_close(two); +} + +static void setup_interleaved(void) { + JournalFile *one, *two; + one = test_open("one.journal"); + two = test_open("two.journal"); + append_number(one, 1, NULL); + append_number(two, 2, NULL); + append_number(one, 3, NULL); + append_number(two, 4, NULL); + test_close(one); + test_close(two); +} + +static void test_skip(void (*setup)(void)) { + char t[] = "/tmp/journal-skip-XXXXXX"; + sd_journal *j; + int r; + + assert_se(mkdtemp(t)); + assert_se(chdir(t) >= 0); + + setup(); + + /* Seek to head, iterate down. + */ + assert_ret(sd_journal_open_directory(&j, t, 0)); + assert_ret(sd_journal_seek_head(j)); + assert_ret(sd_journal_next(j)); + test_check_numbers_down(j, 4); + sd_journal_close(j); + + /* Seek to tail, iterate up. + */ + assert_ret(sd_journal_open_directory(&j, t, 0)); + assert_ret(sd_journal_seek_tail(j)); + assert_ret(sd_journal_previous(j)); + test_check_numbers_up(j, 4); + sd_journal_close(j); + + /* Seek to tail, skip to head, iterate down. + */ + assert_ret(sd_journal_open_directory(&j, t, 0)); + assert_ret(sd_journal_seek_tail(j)); + assert_ret(r = sd_journal_previous_skip(j, 4)); + assert_se(r == 4); + test_check_numbers_down(j, 4); + sd_journal_close(j); + + /* Seek to head, skip to tail, iterate up. + */ + assert_ret(sd_journal_open_directory(&j, t, 0)); + assert_ret(sd_journal_seek_head(j)); + assert_ret(r = sd_journal_next_skip(j, 4)); + assert_se(r == 4); + test_check_numbers_up(j, 4); + sd_journal_close(j); + + log_info("Done..."); + + if (arg_keep) + log_info("Not removing %s", t); + else { + journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); + + assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); + } + + puts("------------------------------------------------------------"); +} + +static void test_sequence_numbers(void) { + + char t[] = "/tmp/journal-seq-XXXXXX"; + JournalFile *one, *two; + uint64_t seqnum = 0; + sd_id128_t seqnum_id; + + assert_se(mkdtemp(t)); + assert_se(chdir(t) >= 0); + + assert_se(journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, 0644, + true, false, NULL, NULL, NULL, NULL, &one) == 0); + + append_number(one, 1, &seqnum); + printf("seqnum=%"PRIu64"\n", seqnum); + assert_se(seqnum == 1); + append_number(one, 2, &seqnum); + printf("seqnum=%"PRIu64"\n", seqnum); + assert_se(seqnum == 2); + + assert_se(one->header->state == STATE_ONLINE); + assert_se(!sd_id128_equal(one->header->file_id, one->header->machine_id)); + assert_se(!sd_id128_equal(one->header->file_id, one->header->boot_id)); + assert_se(sd_id128_equal(one->header->file_id, one->header->seqnum_id)); + + memcpy(&seqnum_id, &one->header->seqnum_id, sizeof(sd_id128_t)); + + assert_se(journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, 0644, + true, false, NULL, NULL, NULL, one, &two) == 0); + + assert_se(two->header->state == STATE_ONLINE); + assert_se(!sd_id128_equal(two->header->file_id, one->header->file_id)); + assert_se(sd_id128_equal(one->header->machine_id, one->header->machine_id)); + assert_se(sd_id128_equal(one->header->boot_id, one->header->boot_id)); + assert_se(sd_id128_equal(one->header->seqnum_id, one->header->seqnum_id)); + + append_number(two, 3, &seqnum); + printf("seqnum=%"PRIu64"\n", seqnum); + assert_se(seqnum == 3); + append_number(two, 4, &seqnum); + printf("seqnum=%"PRIu64"\n", seqnum); + assert_se(seqnum == 4); + + test_close(two); + + append_number(one, 5, &seqnum); + printf("seqnum=%"PRIu64"\n", seqnum); + assert_se(seqnum == 5); + + append_number(one, 6, &seqnum); + printf("seqnum=%"PRIu64"\n", seqnum); + assert_se(seqnum == 6); + + test_close(one); + + /* restart server */ + seqnum = 0; + + assert_se(journal_file_open(-1, "two.journal", O_RDWR, 0, + true, false, NULL, NULL, NULL, NULL, &two) == 0); + + assert_se(sd_id128_equal(two->header->seqnum_id, seqnum_id)); + + append_number(two, 7, &seqnum); + printf("seqnum=%"PRIu64"\n", seqnum); + assert_se(seqnum == 5); + + /* So..., here we have the same seqnum in two files with the + * same seqnum_id. */ + + test_close(two); + + log_info("Done..."); + + if (arg_keep) + log_info("Not removing %s", t); + else { + journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); + + assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); + } +} + +int main(int argc, char *argv[]) { + log_set_max_level(LOG_DEBUG); + + /* journal_file_open requires a valid machine id */ + if (access("/etc/machine-id", F_OK) != 0) + return EXIT_TEST_SKIP; + + arg_keep = argc > 1; + + test_skip(setup_sequential); + test_skip(setup_interleaved); + + test_sequence_numbers(); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-match.c b/src/grp-journal/libjournal-core/test/test-journal-match.c new file mode 100644 index 0000000000..4d3731b3be --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-match.c @@ -0,0 +1,76 @@ +/*** + This file is part of systemd. + + Copyright 2012 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +#include + +#include "sd-journal/journal-internal.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/util.h" + +int main(int argc, char *argv[]) { + _cleanup_(sd_journal_closep) sd_journal*j = NULL; + _cleanup_free_ char *t; + + log_set_max_level(LOG_DEBUG); + + assert_se(sd_journal_open(&j, 0) >= 0); + + assert_se(sd_journal_add_match(j, "foobar", 0) < 0); + assert_se(sd_journal_add_match(j, "foobar=waldo", 0) < 0); + assert_se(sd_journal_add_match(j, "", 0) < 0); + assert_se(sd_journal_add_match(j, "=", 0) < 0); + assert_se(sd_journal_add_match(j, "=xxxxx", 0) < 0); + assert_se(sd_journal_add_match(j, "HALLO=WALDO", 0) >= 0); + assert_se(sd_journal_add_match(j, "QUUX=mmmm", 0) >= 0); + assert_se(sd_journal_add_match(j, "QUUX=xxxxx", 0) >= 0); + assert_se(sd_journal_add_match(j, "HALLO=", 0) >= 0); + assert_se(sd_journal_add_match(j, "QUUX=xxxxx", 0) >= 0); + assert_se(sd_journal_add_match(j, "QUUX=yyyyy", 0) >= 0); + assert_se(sd_journal_add_match(j, "PIFF=paff", 0) >= 0); + + assert_se(sd_journal_add_disjunction(j) >= 0); + + assert_se(sd_journal_add_match(j, "ONE=one", 0) >= 0); + assert_se(sd_journal_add_match(j, "ONE=two", 0) >= 0); + assert_se(sd_journal_add_match(j, "TWO=two", 0) >= 0); + + assert_se(sd_journal_add_conjunction(j) >= 0); + + assert_se(sd_journal_add_match(j, "L4_1=yes", 0) >= 0); + assert_se(sd_journal_add_match(j, "L4_1=ok", 0) >= 0); + assert_se(sd_journal_add_match(j, "L4_2=yes", 0) >= 0); + assert_se(sd_journal_add_match(j, "L4_2=ok", 0) >= 0); + + assert_se(sd_journal_add_disjunction(j) >= 0); + + assert_se(sd_journal_add_match(j, "L3=yes", 0) >= 0); + assert_se(sd_journal_add_match(j, "L3=ok", 0) >= 0); + + assert_se(t = journal_make_match_string(j)); + + printf("resulting match expression is: %s\n", t); + + assert_se(streq(t, "(((L3=ok OR L3=yes) OR ((L4_2=ok OR L4_2=yes) AND (L4_1=ok OR L4_1=yes))) AND ((TWO=two AND (ONE=two OR ONE=one)) OR (PIFF=paff AND (QUUX=yyyyy OR QUUX=xxxxx OR QUUX=mmmm) AND (HALLO= OR HALLO=WALDO))))")); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-send.c b/src/grp-journal/libjournal-core/test/test-journal-send.c new file mode 100644 index 0000000000..bca76fc4df --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-send.c @@ -0,0 +1,102 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include + +#include + +#include "systemd-basic/macro.h" + +int main(int argc, char *argv[]) { + char huge[4096*1024]; + + /* utf-8 and non-utf-8, message-less and message-ful iovecs */ + struct iovec graph1[] = { + {(char*) "GRAPH=graph", strlen("GRAPH=graph")} + }; + struct iovec graph2[] = { + {(char*) "GRAPH=graph\n", strlen("GRAPH=graph\n")} + }; + struct iovec message1[] = { + {(char*) "MESSAGE=graph", strlen("MESSAGE=graph")} + }; + struct iovec message2[] = { + {(char*) "MESSAGE=graph\n", strlen("MESSAGE=graph\n")} + }; + + assert_se(sd_journal_print(LOG_INFO, "piepapo") == 0); + + assert_se(sd_journal_send("MESSAGE=foobar", + "VALUE=%i", 7, + NULL) == 0); + + errno = ENOENT; + assert_se(sd_journal_perror("Foobar") == 0); + + assert_se(sd_journal_perror("") == 0); + + memset(huge, 'x', sizeof(huge)); + memcpy(huge, "HUGE=", 5); + char_array_0(huge); + + assert_se(sd_journal_send("MESSAGE=Huge field attached", + huge, + NULL) == 0); + + assert_se(sd_journal_send("MESSAGE=uiui", + "VALUE=A", + "VALUE=B", + "VALUE=C", + "SINGLETON=1", + "OTHERVALUE=X", + "OTHERVALUE=Y", + "WITH_BINARY=this is a binary value \a", + NULL) == 0); + + syslog(LOG_NOTICE, "Hello World!"); + + assert_se(sd_journal_print(LOG_NOTICE, "Hello World") == 0); + + assert_se(sd_journal_send("MESSAGE=Hello World!", + "MESSAGE_ID=52fb62f99e2c49d89cfbf9d6de5e3555", + "PRIORITY=5", + "HOME=%s", getenv("HOME"), + "TERM=%s", getenv("TERM"), + "PAGE_SIZE=%li", sysconf(_SC_PAGESIZE), + "N_CPUS=%li", sysconf(_SC_NPROCESSORS_ONLN), + NULL) == 0); + + assert_se(sd_journal_sendv(graph1, 1) == 0); + assert_se(sd_journal_sendv(graph2, 1) == 0); + assert_se(sd_journal_sendv(message1, 1) == 0); + assert_se(sd_journal_sendv(message2, 1) == 0); + + /* test without location fields */ +#undef sd_journal_sendv + assert_se(sd_journal_sendv(graph1, 1) == 0); + assert_se(sd_journal_sendv(graph2, 1) == 0); + assert_se(sd_journal_sendv(message1, 1) == 0); + assert_se(sd_journal_sendv(message2, 1) == 0); + + sleep(1); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-stream.c b/src/grp-journal/libjournal-core/test/test-journal-stream.c new file mode 100644 index 0000000000..84db1eeeb4 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-stream.c @@ -0,0 +1,196 @@ +/*** + This file is part of systemd. + + Copyright 2012 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#include + +#include "sd-journal/journal-file.h" +#include "sd-journal/journal-internal.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/rm-rf.h" +#include "systemd-basic/util.h" + +#define N_ENTRIES 200 + +static void verify_contents(sd_journal *j, unsigned skip) { + unsigned i; + + assert_se(j); + + i = 0; + SD_JOURNAL_FOREACH(j) { + const void *d; + char *k, *c; + size_t l; + unsigned u = 0; + + assert_se(sd_journal_get_cursor(j, &k) >= 0); + printf("cursor: %s\n", k); + free(k); + + assert_se(sd_journal_get_data(j, "MAGIC", &d, &l) >= 0); + printf("\t%.*s\n", (int) l, (const char*) d); + + assert_se(sd_journal_get_data(j, "NUMBER", &d, &l) >= 0); + assert_se(k = strndup(d, l)); + printf("\t%s\n", k); + + if (skip > 0) { + assert_se(safe_atou(k + 7, &u) >= 0); + assert_se(i == u); + i += skip; + } + + free(k); + + assert_se(sd_journal_get_cursor(j, &c) >= 0); + assert_se(sd_journal_test_cursor(j, c) > 0); + free(c); + } + + if (skip > 0) + assert_se(i == N_ENTRIES); +} + +int main(int argc, char *argv[]) { + JournalFile *one, *two, *three; + char t[] = "/tmp/journal-stream-XXXXXX"; + unsigned i; + _cleanup_(sd_journal_closep) sd_journal *j = NULL; + char *z; + const void *data; + size_t l; + dual_timestamp previous_ts = DUAL_TIMESTAMP_NULL; + + /* journal_file_open requires a valid machine id */ + if (access("/etc/machine-id", F_OK) != 0) + return EXIT_TEST_SKIP; + + log_set_max_level(LOG_DEBUG); + + assert_se(mkdtemp(t)); + assert_se(chdir(t) >= 0); + + assert_se(journal_file_open(-1, "one.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &one) == 0); + assert_se(journal_file_open(-1, "two.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &two) == 0); + assert_se(journal_file_open(-1, "three.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &three) == 0); + + for (i = 0; i < N_ENTRIES; i++) { + char *p, *q; + dual_timestamp ts; + struct iovec iovec[2]; + + dual_timestamp_get(&ts); + + if (ts.monotonic <= previous_ts.monotonic) + ts.monotonic = previous_ts.monotonic + 1; + + if (ts.realtime <= previous_ts.realtime) + ts.realtime = previous_ts.realtime + 1; + + previous_ts = ts; + + assert_se(asprintf(&p, "NUMBER=%u", i) >= 0); + iovec[0].iov_base = p; + iovec[0].iov_len = strlen(p); + + assert_se(asprintf(&q, "MAGIC=%s", i % 5 == 0 ? "quux" : "waldo") >= 0); + + iovec[1].iov_base = q; + iovec[1].iov_len = strlen(q); + + if (i % 10 == 0) + assert_se(journal_file_append_entry(three, &ts, iovec, 2, NULL, NULL, NULL) == 0); + else { + if (i % 3 == 0) + assert_se(journal_file_append_entry(two, &ts, iovec, 2, NULL, NULL, NULL) == 0); + + assert_se(journal_file_append_entry(one, &ts, iovec, 2, NULL, NULL, NULL) == 0); + } + + free(p); + free(q); + } + + (void) journal_file_close(one); + (void) journal_file_close(two); + (void) journal_file_close(three); + + assert_se(sd_journal_open_directory(&j, t, 0) >= 0); + + assert_se(sd_journal_add_match(j, "MAGIC=quux", 0) >= 0); + SD_JOURNAL_FOREACH_BACKWARDS(j) { + _cleanup_free_ char *c; + + assert_se(sd_journal_get_data(j, "NUMBER", &data, &l) >= 0); + printf("\t%.*s\n", (int) l, (const char*) data); + + assert_se(sd_journal_get_cursor(j, &c) >= 0); + assert_se(sd_journal_test_cursor(j, c) > 0); + } + + SD_JOURNAL_FOREACH(j) { + _cleanup_free_ char *c; + + assert_se(sd_journal_get_data(j, "NUMBER", &data, &l) >= 0); + printf("\t%.*s\n", (int) l, (const char*) data); + + assert_se(sd_journal_get_cursor(j, &c) >= 0); + assert_se(sd_journal_test_cursor(j, c) > 0); + } + + sd_journal_flush_matches(j); + + verify_contents(j, 1); + + printf("NEXT TEST\n"); + assert_se(sd_journal_add_match(j, "MAGIC=quux", 0) >= 0); + + assert_se(z = journal_make_match_string(j)); + printf("resulting match expression is: %s\n", z); + free(z); + + verify_contents(j, 5); + + printf("NEXT TEST\n"); + sd_journal_flush_matches(j); + assert_se(sd_journal_add_match(j, "MAGIC=waldo", 0) >= 0); + assert_se(sd_journal_add_match(j, "NUMBER=10", 0) >= 0); + assert_se(sd_journal_add_match(j, "NUMBER=11", 0) >= 0); + assert_se(sd_journal_add_match(j, "NUMBER=12", 0) >= 0); + + assert_se(z = journal_make_match_string(j)); + printf("resulting match expression is: %s\n", z); + free(z); + + verify_contents(j, 0); + + assert_se(sd_journal_query_unique(j, "NUMBER") >= 0); + SD_JOURNAL_FOREACH_UNIQUE(j, data, l) + printf("%.*s\n", (int) l, (const char*) data); + + assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-syslog.c b/src/grp-journal/libjournal-core/test/test-journal-syslog.c new file mode 100644 index 0000000000..f86cfb2677 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-syslog.c @@ -0,0 +1,44 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "journal-core/journald-syslog.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/string-util.h" + +static void test_syslog_parse_identifier(const char* str, + const char *ident, const char*pid, int ret) { + const char *buf = str; + _cleanup_free_ char *ident2 = NULL, *pid2 = NULL; + int ret2; + + ret2 = syslog_parse_identifier(&buf, &ident2, &pid2); + + assert_se(ret == ret2); + assert_se(ident == ident2 || streq_ptr(ident, ident2)); + assert_se(pid == pid2 || streq_ptr(pid, pid2)); +} + +int main(void) { + test_syslog_parse_identifier("pidu[111]: xxx", "pidu", "111", 11); + test_syslog_parse_identifier("pidu: xxx", "pidu", NULL, 6); + test_syslog_parse_identifier("pidu xxx", NULL, NULL, 0); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal-verify.c b/src/grp-journal/libjournal-core/test/test-journal-verify.c new file mode 100644 index 0000000000..8a1aa45901 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal-verify.c @@ -0,0 +1,150 @@ +/*** + This file is part of systemd. + + Copyright 2012 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include + +#include "sd-journal/journal-file.h" +#include "sd-journal/journal-verify.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/rm-rf.h" +#include "systemd-basic/terminal-util.h" +#include "systemd-basic/util.h" + +#define N_ENTRIES 6000 +#define RANDOM_RANGE 77 + +static void bit_toggle(const char *fn, uint64_t p) { + uint8_t b; + ssize_t r; + int fd; + + fd = open(fn, O_RDWR|O_CLOEXEC); + assert_se(fd >= 0); + + r = pread(fd, &b, 1, p/8); + assert_se(r == 1); + + b ^= 1 << (p % 8); + + r = pwrite(fd, &b, 1, p/8); + assert_se(r == 1); + + safe_close(fd); +} + +static int raw_verify(const char *fn, const char *verification_key) { + JournalFile *f; + int r; + + r = journal_file_open(-1, fn, O_RDONLY, 0666, true, !!verification_key, NULL, NULL, NULL, NULL, &f); + if (r < 0) + return r; + + r = journal_file_verify(f, verification_key, NULL, NULL, NULL, false); + (void) journal_file_close(f); + + return r; +} + +int main(int argc, char *argv[]) { + char t[] = "/tmp/journal-XXXXXX"; + unsigned n; + JournalFile *f; + const char *verification_key = argv[1]; + usec_t from = 0, to = 0, total = 0; + char a[FORMAT_TIMESTAMP_MAX]; + char b[FORMAT_TIMESTAMP_MAX]; + char c[FORMAT_TIMESPAN_MAX]; + struct stat st; + uint64_t p; + + /* journal_file_open requires a valid machine id */ + if (access("/etc/machine-id", F_OK) != 0) + return EXIT_TEST_SKIP; + + log_set_max_level(LOG_DEBUG); + + assert_se(mkdtemp(t)); + assert_se(chdir(t) >= 0); + + log_info("Generating..."); + + assert_se(journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, true, !!verification_key, NULL, NULL, NULL, NULL, &f) == 0); + + for (n = 0; n < N_ENTRIES; n++) { + struct iovec iovec; + struct dual_timestamp ts; + char *test; + + dual_timestamp_get(&ts); + + assert_se(asprintf(&test, "RANDOM=%lu", random() % RANDOM_RANGE)); + + iovec.iov_base = (void*) test; + iovec.iov_len = strlen(test); + + assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); + + free(test); + } + + (void) journal_file_close(f); + + log_info("Verifying..."); + + assert_se(journal_file_open(-1, "test.journal", O_RDONLY, 0666, true, !!verification_key, NULL, NULL, NULL, NULL, &f) == 0); + /* journal_file_print_header(f); */ + journal_file_dump(f); + + assert_se(journal_file_verify(f, verification_key, &from, &to, &total, true) >= 0); + + if (verification_key && JOURNAL_HEADER_SEALED(f->header)) + log_info("=> Validated from %s to %s, %s missing", + format_timestamp(a, sizeof(a), from), + format_timestamp(b, sizeof(b), to), + format_timespan(c, sizeof(c), total > to ? total - to : 0, 0)); + + (void) journal_file_close(f); + + if (verification_key) { + log_info("Toggling bits..."); + + assert_se(stat("test.journal", &st) >= 0); + + for (p = 38448*8+0; p < ((uint64_t) st.st_size * 8); p ++) { + bit_toggle("test.journal", p); + + log_info("[ %"PRIu64"+%"PRIu64"]", p / 8, p % 8); + + if (raw_verify("test.journal", verification_key) >= 0) + log_notice(ANSI_HIGHLIGHT_RED ">>>> %"PRIu64" (bit %"PRIu64") can be toggled without detection." ANSI_NORMAL, p / 8, p % 8); + + bit_toggle("test.journal", p); + } + } + + log_info("Exiting..."); + + assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-journal.c b/src/grp-journal/libjournal-core/test/test-journal.c new file mode 100644 index 0000000000..0792750a61 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-journal.c @@ -0,0 +1,178 @@ +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#include "sd-journal/journal-authenticate.h" +#include "sd-journal/journal-file.h" +#include "sd-journal/journal-vacuum.h" +#include "systemd-basic/log.h" +#include "systemd-basic/rm-rf.h" + +static bool arg_keep = false; + +static void test_non_empty(void) { + dual_timestamp ts; + JournalFile *f; + struct iovec iovec; + static const char test[] = "TEST1=1", test2[] = "TEST2=2"; + Object *o; + uint64_t p; + char t[] = "/tmp/journal-XXXXXX"; + + log_set_max_level(LOG_DEBUG); + + assert_se(mkdtemp(t)); + assert_se(chdir(t) >= 0); + + assert_se(journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, true, true, NULL, NULL, NULL, NULL, &f) == 0); + + dual_timestamp_get(&ts); + + iovec.iov_base = (void*) test; + iovec.iov_len = strlen(test); + assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); + + iovec.iov_base = (void*) test2; + iovec.iov_len = strlen(test2); + assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); + + iovec.iov_base = (void*) test; + iovec.iov_len = strlen(test); + assert_se(journal_file_append_entry(f, &ts, &iovec, 1, NULL, NULL, NULL) == 0); + +#ifdef HAVE_GCRYPT + journal_file_append_tag(f); +#endif + journal_file_dump(f); + + assert_se(journal_file_next_entry(f, 0, DIRECTION_DOWN, &o, &p) == 1); + assert_se(le64toh(o->entry.seqnum) == 1); + + assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 1); + assert_se(le64toh(o->entry.seqnum) == 2); + + assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 1); + assert_se(le64toh(o->entry.seqnum) == 3); + + assert_se(journal_file_next_entry(f, p, DIRECTION_DOWN, &o, &p) == 0); + + assert_se(journal_file_next_entry(f, 0, DIRECTION_DOWN, &o, &p) == 1); + assert_se(le64toh(o->entry.seqnum) == 1); + + assert_se(journal_file_find_data_object(f, test, strlen(test), NULL, &p) == 1); + assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1); + assert_se(le64toh(o->entry.seqnum) == 1); + + assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1); + assert_se(le64toh(o->entry.seqnum) == 3); + + assert_se(journal_file_find_data_object(f, test2, strlen(test2), NULL, &p) == 1); + assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1); + assert_se(le64toh(o->entry.seqnum) == 2); + + assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1); + assert_se(le64toh(o->entry.seqnum) == 2); + + assert_se(journal_file_find_data_object(f, "quux", 4, NULL, &p) == 0); + + assert_se(journal_file_move_to_entry_by_seqnum(f, 1, DIRECTION_DOWN, &o, NULL) == 1); + assert_se(le64toh(o->entry.seqnum) == 1); + + assert_se(journal_file_move_to_entry_by_seqnum(f, 3, DIRECTION_DOWN, &o, NULL) == 1); + assert_se(le64toh(o->entry.seqnum) == 3); + + assert_se(journal_file_move_to_entry_by_seqnum(f, 2, DIRECTION_DOWN, &o, NULL) == 1); + assert_se(le64toh(o->entry.seqnum) == 2); + + assert_se(journal_file_move_to_entry_by_seqnum(f, 10, DIRECTION_DOWN, &o, NULL) == 0); + + journal_file_rotate(&f, true, true, NULL); + journal_file_rotate(&f, true, true, NULL); + + (void) journal_file_close(f); + + log_info("Done..."); + + if (arg_keep) + log_info("Not removing %s", t); + else { + journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); + + assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); + } + + puts("------------------------------------------------------------"); +} + +static void test_empty(void) { + JournalFile *f1, *f2, *f3, *f4; + char t[] = "/tmp/journal-XXXXXX"; + + log_set_max_level(LOG_DEBUG); + + assert_se(mkdtemp(t)); + assert_se(chdir(t) >= 0); + + assert_se(journal_file_open(-1, "test.journal", O_RDWR|O_CREAT, 0666, false, false, NULL, NULL, NULL, NULL, &f1) == 0); + + assert_se(journal_file_open(-1, "test-compress.journal", O_RDWR|O_CREAT, 0666, true, false, NULL, NULL, NULL, NULL, &f2) == 0); + + assert_se(journal_file_open(-1, "test-seal.journal", O_RDWR|O_CREAT, 0666, false, true, NULL, NULL, NULL, NULL, &f3) == 0); + + assert_se(journal_file_open(-1, "test-seal-compress.journal", O_RDWR|O_CREAT, 0666, true, true, NULL, NULL, NULL, NULL, &f4) == 0); + + journal_file_print_header(f1); + puts(""); + journal_file_print_header(f2); + puts(""); + journal_file_print_header(f3); + puts(""); + journal_file_print_header(f4); + puts(""); + + log_info("Done..."); + + if (arg_keep) + log_info("Not removing %s", t); + else { + journal_directory_vacuum(".", 3000000, 0, 0, NULL, true); + + assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0); + } + + (void) journal_file_close(f1); + (void) journal_file_close(f2); + (void) journal_file_close(f3); + (void) journal_file_close(f4); +} + +int main(int argc, char *argv[]) { + arg_keep = argc > 1; + + /* journal_file_open requires a valid machine id */ + if (access("/etc/machine-id", F_OK) != 0) + return EXIT_TEST_SKIP; + + test_non_empty(); + test_empty(); + + return 0; +} diff --git a/src/grp-journal/libjournal-core/test/test-mmap-cache.c b/src/grp-journal/libjournal-core/test/test-mmap-cache.c new file mode 100644 index 0000000000..636be8c2e3 --- /dev/null +++ b/src/grp-journal/libjournal-core/test/test-mmap-cache.c @@ -0,0 +1,79 @@ +/*** + This file is part of systemd. + + Copyright 2012 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include +#include + +#include "sd-journal/mmap-cache.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/fileio.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/util.h" + +int main(int argc, char *argv[]) { + int x, y, z, r; + char px[] = "/tmp/testmmapXXXXXXX", py[] = "/tmp/testmmapYXXXXXX", pz[] = "/tmp/testmmapZXXXXXX"; + MMapCache *m; + void *p, *q; + + assert_se(m = mmap_cache_new()); + + x = mkostemp_safe(px, O_RDWR|O_CLOEXEC); + assert_se(x >= 0); + unlink(px); + + y = mkostemp_safe(py, O_RDWR|O_CLOEXEC); + assert_se(y >= 0); + unlink(py); + + z = mkostemp_safe(pz, O_RDWR|O_CLOEXEC); + assert_se(z >= 0); + unlink(pz); + + r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p); + assert_se(r >= 0); + + r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q); + assert_se(r >= 0); + + assert_se((uint8_t*) p + 1 == (uint8_t*) q); + + r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q); + assert_se(r >= 0); + + assert_se((uint8_t*) p + 2 == (uint8_t*) q); + + r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p); + assert_se(r >= 0); + + r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q); + assert_se(r >= 0); + + assert_se((uint8_t*) p + 1 == (uint8_t*) q); + + mmap_cache_unref(m); + + safe_close(x); + safe_close(y); + safe_close(z); + + return 0; +} diff --git a/src/grp-journal/systemd-cat/cat.c b/src/grp-journal/systemd-cat/cat.c index 8ab4febd53..105d42591e 100644 --- a/src/grp-journal/systemd-cat/cat.c +++ b/src/grp-journal/systemd-cat/cat.c @@ -26,11 +26,11 @@ #include -#include "basic/fd-util.h" -#include "basic/parse-util.h" -#include "basic/string-util.h" -#include "basic/syslog-util.h" -#include "basic/util.h" +#include "systemd-basic/fd-util.h" +#include "systemd-basic/parse-util.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/syslog-util.h" +#include "systemd-basic/util.h" static const char *arg_identifier = NULL; static int arg_priority = LOG_INFO; diff --git a/src/grp-journal/systemd-journald/.gitignore b/src/grp-journal/systemd-journald/.gitignore new file mode 100644 index 0000000000..ff695342e3 --- /dev/null +++ b/src/grp-journal/systemd-journald/.gitignore @@ -0,0 +1 @@ +*.catalog diff --git a/src/grp-journal/systemd-journald/Makefile b/src/grp-journal/systemd-journald/Makefile index 4f05218d88..b75a248ea1 100644 --- a/src/grp-journal/systemd-journald/Makefile +++ b/src/grp-journal/systemd-journald/Makefile @@ -60,6 +60,7 @@ nodist_catalog_DATA = \ EXTRA_DIST += \ $(nodist_catalog_DATA:.catalog=.catalog.in) +EXTRA_DIST := $(EXTRA_DIST) # Note that we don't use @@ for replacement markers here, but %%. This is # because the catalog uses @@ already for its runtime replacement handling and diff --git a/src/grp-journal/systemd-journald/journald.c b/src/grp-journal/systemd-journald/journald.c index cd887feed8..7306b5f43d 100644 --- a/src/grp-journal/systemd-journald/journald.c +++ b/src/grp-journal/systemd-journald/journald.c @@ -22,12 +22,12 @@ #include #include -#include "basic/formats-util.h" -#include "basic/sigbus.h" -#include "journald-kmsg.h" -#include "journald-server.h" -#include "journald-syslog.h" +#include "journal-core/journald-kmsg.h" +#include "journal-core/journald-server.h" +#include "journal-core/journald-syslog.h" #include "sd-journal/journal-authenticate.h" +#include "systemd-basic/formats-util.h" +#include "systemd-basic/sigbus.h" int main(int argc, char *argv[]) { Server server; diff --git a/src/grp-journal/systemd-journald/systemd.be.catalog.in b/src/grp-journal/systemd-journald/systemd.be.catalog.in new file mode 100644 index 0000000000..5b237f0558 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.be.catalog.in @@ -0,0 +1,313 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2015, 2016 Viktar Vaŭčkievič +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Belarusian translation + +# Фармат каталога апісаны на старонцы +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: Сэрвіс журналявання запусціўся +Defined-By: systemd +Support: %SUPPORT_URL% + +Працэс сістэмнага журналявання запусціўся, адкрыў файлы для +запісу і гатовы апрацоўваць запыты. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Сэрвіс журналявання спыніўся +Defined-By: systemd +Support: %SUPPORT_URL% + +Працэс сістэмнага журналявання спыніўся і закрыў усе файлы. + +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: Дыскавае месца, занятае часопісам +Defined-By: systemd +Support: %SUPPORT_URL% + +@JOURNAL_NAME@ (@JOURNAL_PATH@) цяпер займае @CURRENT_USE_PRETTY@. +Максімальна дазволены памер складае @MAX_USE_PRETTY@. +Пакідаем вольнымі не меньш за @DISK_KEEP_FREE_PRETTY@ (даступна на дыску +@DISK_AVAILABLE_PRETTY@). +Такім чынам, ліміт складае @LIMIT_PRETTY@, з якіх @AVAILABLE_PRETTY@ +даступна. + +Ліміты на памер наладжваецца з дапамогай SystemMaxUse=, SystemKeepFree=, +SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= у +файле /etc/systemd/journald.conf. Глядзіце journald.conf(5) для дэталей. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Паведамленні з сэрвісу адкінуты +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Сэрвіс адправіў занадта штат паведамленняў за кароткі прамежак часу. +Частка паведамленняў была адкінута. + +Майце на ўвазе, што былі адкінуты паведамлення толькі гэтага сэрвісу. +Паведамленні іншых сэрвісаў засталіся. + +Мяжа, пасля якой паведамленні будуць адкінуты, наладжваецца з дапамогай +RateLimitIntervalSec= і RateLimitBurst= у файле /etc/systemd/journald.conf. +Глядзіце journald.conf(5) для дэталей. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Паведамленні страчаны +Defined-By: systemd +Support: %SUPPORT_URL% + +Паведамленні ядра былі страчаны, так як сістэма журналявання не паспела +іх апрацаваць. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Працэс @COREDUMP_PID@ (@COREDUMP_COMM@) скінуў дамп памяці +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Працэс @COREDUMP_PID@ (@COREDUMP_COMM@) разбіўся і скінуў дамп памяці. + +Звычайна гэта сведчыць аб памылцы ў праграмным кодзе. +Рэкамендуецца паведаміць аб гэтым распрацоўнікам. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Новая сесія № @SESSION_ID@ створана для карыстальніка @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Новая сесія з № @SESSION_ID@ створана для карыстальніка @USER_ID@. + +Лідар гэтай сесіі пад № @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Сесія № @SESSION_ID@ спынена +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Сесія № @SESSION_ID@ спынена. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Даступна новае працоўнае месца № @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Новае працоўнае месца № @SEAT_ID@ наладжана і даступна для выкарыстання. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Працоўнае месца № @SEAT_ID@ выдалена +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Працоўнае месца № @SEAT_ID@ выдалена і больш не даступна. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Час зменены +Defined-By: systemd +Support: %SUPPORT_URL% + +Сістэмны гадзіннік зменены на @REALTIME@ мікрасекунд ад 1 студзеня 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Часавы пояс зменены на @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Сістэмны часавы пояс зменены на @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Запуск сістэмы завяршыўся +Defined-By: systemd +Support: %SUPPORT_URL% + +Усе сістэмныя сэрвісы, неабходныя для загрузкі сістэмы, паспяхова +запусціліся. Майце на ўвазе, што гэта не значыць, што машына нічога не +робіць. Магчыма, некаторыя сэрвісы яшчэ ініцыялізіруюцца. + +На запуск ядра спатрэбілася @KERNEL_USEC@ мікрасекунд. + +На запуск пачатковага RAM-дыска спатрэбілася @INITRD_USEC@ мікрасекунд. + +На запуск сістэмных сэрвісаў спатрэбілася @USERSPACE_USEC@ мікрасекунд. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Сістэма перайшла ў стан сну @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Цяпер сістэма перайшла у стан сну @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Сістэма выйшла са стана сну @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Цяпер сістэма выйшла са стана сну @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Сістэма завяршае работу +Defined-By: systemd +Support: %SUPPORT_URL% + +Пачаўся працэс выключэння сістэмы. +Спыняюцца ўсе сістэмныя сэрвісы і дэмантуюцца файлавыя сістэмы. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Юніт @UNIT@ запускаецца +Defined-By: systemd +Support: %SUPPORT_URL% + +Пачаўся працэс запуску юніта @UNIT@. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Юніт @UNIT@ запусціўся +Defined-By: systemd +Support: %SUPPORT_URL% + +Працэс запуску юніта @UNIT@ завершаны. + +Вынік: @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Юніт @UNIT@ спыняецца +Defined-By: systemd +Support: %SUPPORT_URL% + +Пачаўся працэс спынення юніта @UNIT@. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Юніт @UNIT@ спынены +Defined-By: systemd +Support: %SUPPORT_URL% + +Працэс спынення юніта @UNIT@ завершаны. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Збой юніта @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Збой юніта @UNIT@. + +Вынік: @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Юніт @UNIT@ перачытвае сваю канфігурацыю +Defined-By: systemd +Support: %SUPPORT_URL% + +Юніт @UNIT@ пачаў перачытваць сваю канфігурацыю. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Юніт @UNIT@ перачытаў сваю канфігурацыю +Defined-By: systemd +Support: %SUPPORT_URL% + +Юніт @UNIT@ перачытаў сваю канфігурацыю. + +Вынік: @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Працэс @EXECUTABLE@ не можа быць выкананы +Defined-By: systemd +Support: %SUPPORT_URL% + +Працэс @EXECUTABLE@ не можа быць выкананы ў выніку збою. + +Ён вярнуў памылку нумар @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Sibject: Адно ці больш паведамленняў не былі накіраваны ў syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Адно ці больш паведамленняў не былі накіраваны ў syslog сэрвіс, які +выконваецца паралельна з journald. Звычайна гэта значыць, што +рэалізацыя syslog не паспявае апрацаваць паведамленні з неабходнай +хуткасцю. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Кропка мантавання не пустая +Defined-By: systemd +Support: %SUPPORT_URL% + +Каталог @WHERE@ указаны як кропка мантавання (другое поле ў /etc/fstab ці +Where= поле ў файле юніта systemd) і не пусты. Гэта не перашкаджае +мантаванню, але існуючыя ў ім файлы будуць недаступны. Для доступу да іх, +калі ласка, змантуйце гэтую файлавую сістэму ў іншае месца. + +-- 24d8d4452573402496068381a6312df2 +Subject: Віртуальная машына або кантэйнер запусціўся +Defined-By: systemd +Support: %SUPPORT_URL% + +Віртуальная машына @NAME@ з лідарам № @LEADER@ запусцілася і +гатова для выкарыстання. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Віртуальная машына або кантэйнер спынены +Defined-By: systemd +Support: %SUPPORT_URL% + +Віртуальная машына @NAME@ з лідарам № @LEADER@ спынена. + +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: Механізм DNSSEC адключаны, бо сервер не падтымлівае яго +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +Сэрвіс вызначэння імён (systemd-resolved.service) вызначыў, што DNS-сервер +не падтрымлівае механізм DNSSEC. У выніку праверка DNSSEC была адключана. + +Гэтая падзея ўзнікае калі наладжаны DNSSEC=allow-downgrade +у файле resolved.conf і DNS-сервер не падтрымлівае механізм DNSSEC. +Звярніце ўвагу, што рэжым allow-downgrade дазваляе правесці атаку +«DNSSEC downgrade», у ходзе якой зламыснік можа адключыць праверку DNSSEC +шляхам падстаноўкі падробленых DNSSEC-адказаў у камунікацыйны канал. + +Гэта падзея можа быць прыкметай таго, што DNS-сервер сапраўды несумяшчальны +з DNSSEC або што зламысніку паспяхова атрымалася правесці атаку па +адключэнню DNSSEC. + +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: Збой пры праверцы DNSSEC +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +DNS-запыт або рэсурсны запіс не прайшоў праверку DNSSEC. +Як правіла, гэта паказвае на знешняе ўздзеянне на канал сувязі. + +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: Давераны ключ DNSSEC быў ануляваны +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Давераны ключ DNSSEC быў ануляваны. Неабходна наладзіць новы давераны ключ +або абнавіць аперацыйную сістэму, каб атрымаць абноўлены давераны ключ +DNSSEC. diff --git a/src/grp-journal/systemd-journald/systemd.be@latin.catalog.in b/src/grp-journal/systemd-journald/systemd.be@latin.catalog.in new file mode 100644 index 0000000000..fc9f7cad16 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.be@latin.catalog.in @@ -0,0 +1,318 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2015, 2016 Viktar Vaŭčkievič +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Belarusian Latin translation + +# Farmat kataloha apisany na staroncy +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: Servis žurnaliavannia zapusciŭsia +Defined-By: systemd +Support: %SUPPORT_URL% + +Praces sistemnaha žurnaliavannia zapusciŭsia, adkryŭ fajly dlia +zapisu i hatovy apracoŭvać zapyty. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Servis žurnaliavannia spyniŭsia +Defined-By: systemd +Support: %SUPPORT_URL% + +Praces sistemnaha žurnaliavannia spyniŭsia i zakryŭ usie fajly. + +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: dyskavaje miesca, zaniataje časopisam +Defined-By: systemd +Support: %SUPPORT_URL% + +@JOURNAL_NAME@ (@JOURNAL_PATH@) ciapier zajmaje @CURRENT_USE_PRETTY@. +Maksimaĺna dazvolieny pamier skladaje @MAX_USE_PRETTY@. +Pakidajem voĺnymi nie mieńš za @DISK_KEEP_FREE_PRETTY@ (dastupna na dysku +@DISK_AVAILABLE_PRETTY@). +Takim čynam, limit skladaje @LIMIT_PRETTY@, z jakich @AVAILABLE_PRETTY@ +dastupna. + +Limity na pamier naladžvaiecca z dapamohaj SystemMaxUse=, SystemKeepFree=, +SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= u +fajlie /etc/systemd/journald.conf. Hliadzicie journald.conf(5) dlia +detaliej. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Paviedamlienni z servisu adkinuty +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Servis adpraviŭ zanadta štat paviedamlienniaŭ za karotki pramiežak času. +Častka paviedamlienniaŭ byla adkinuta. + +Majcie na ŭvazie, što byli adkinuty paviedamliennia toĺki hetaha servisu. +Paviedamlienni inšych servisaŭ zastalisia. + +Miaža, paslia jakoj paviedamlienni buduć adkinuty, naladžvajecca z dapamohaj +RateLimitIntervalSec= i RateLimitBurst= u fajlie /etc/systemd/journald.conf. +Hliadzicie journald.conf(5) dlia detaliej. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Paviedamlienni stračany +Defined-By: systemd +Support: %SUPPORT_URL% + +Paviedamlienni jadra byli stračany, tak jak sistema žurnaliavannia nie +paspiela ich apracavać. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Praces @COREDUMP_PID@ (@COREDUMP_COMM@) skinuŭ damp pamiaci +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Praces @COREDUMP_PID@ (@COREDUMP_COMM@) razbiŭsia i skinuŭ damp pamiaci. + +Zvyčajna heta sviedčyć ab pamylcy ŭ prahramnym kodzie. +Rekamiendujecca paviedamić ab hetym raspracoŭnikam. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Novaja siesija № @SESSION_ID@ stvorana dlia karystaĺnika @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Novaja siesija z № @SESSION_ID@ stvorana dlia karystaĺnika @USER_ID@. + +Lidar hetaj siesii pad № @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Siesija № @SESSION_ID@ spyniena +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Siesija № @SESSION_ID@ spyniena. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Dastupna novaje pracoŭnaje miesca № @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Novaje pracoŭnaje miesca № @SEAT_ID@ naladžana i dastupna dlia +vykarystannia. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Pracoŭnaje miesca № @SEAT_ID@ vydaliena +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Pracoŭnaje miesca № @SEAT_ID@ vydaliena i boĺš nie dastupna. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Čas zmienieny +Defined-By: systemd +Support: %SUPPORT_URL% + +Sistemny hadzinnik zmienieny na @REALTIME@ mikrasiekund ad 1 studzienia +1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Časavy pojas zmienieny na @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Sistemny časavy pojas zmienieny na @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Zapusk sistemy zaviaršyŭsia +Defined-By: systemd +Support: %SUPPORT_URL% + +Usie sistemnyja servisy, nieabchodnyja dlia zahruzki sistemy, paspiachova +zapuscilisia. Majcie na ŭvazie, što heta nie značyć, što mašyna ničoha nie +robić. Mahčyma, niekatoryja servisy jašče inicyjalizirujucca. + +Na zapusk jadra spatrebilasia @KERNEL_USEC@ mikrasiekund. + +Na zapusk pačatkovaha RAM-dyska spatrebilasia @INITRD_USEC@ mikrasiekund. + +Na zapusk sistemnych servisaŭ spatrebilasia @USERSPACE_USEC@ mikrasiekund. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Sistema pierajšla ŭ stan snu @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Ciapier sistema pierajšla u stan snu @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Sistema vyjšla sa stana snu @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Ciapier sistema vyjšla sa stana snu @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Sistema zaviaršaje rabotu +Defined-By: systemd +Support: %SUPPORT_URL% + +Pačaŭsia praces vykliučennia sistemy. +Spyniajucca ŭsie sistemnyja servisy i demantujucca fajlavyja sistemy. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Junit @UNIT@ zapuskajecca +Defined-By: systemd +Support: %SUPPORT_URL% + +Pačaŭsia praces zapusku junita @UNIT@. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Junit @UNIT@ zapusciŭsia +Defined-By: systemd +Support: %SUPPORT_URL% + +Praces zapusku junita @UNIT@ zavieršany. + +Vynik: @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Junit @UNIT@ spyniajecca +Defined-By: systemd +Support: %SUPPORT_URL% + +Pačaŭsia praces spyniennia junita @UNIT@. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Junit @UNIT@ spynieny +Defined-By: systemd +Support: %SUPPORT_URL% + +Praces spyniennia junita @UNIT@ zavieršany. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Zboj junita @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Zboj junita @UNIT@. + +Vynik: @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Junit @UNIT@ pieračytvaje svaju kanfihuracyju +Defined-By: systemd +Support: %SUPPORT_URL% + +Junit @UNIT@ pačaŭ pieračytvać svaju kanfihuracyju. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Junit @UNIT@ pieračytaŭ svaju kanfihuracyju +Defined-By: systemd +Support: %SUPPORT_URL% + +Junit @UNIT@ pieračytaŭ svaju kanfihuracyju. + +Vynik: @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Praces @EXECUTABLE@ nie moža być vykanany +Defined-By: systemd +Support: %SUPPORT_URL% + +Praces @EXECUTABLE@ nie moža być vykanany ŭ vyniku zboju. + +Jon viarnuŭ pamylku numar @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Sibject: Adno ci boĺš paviedamlienniaŭ nie byli nakiravany ŭ syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Adno ci boĺš paviedamlienniaŭ nie byli nakiravany ŭ syslog servis, jaki +vykonvajecca paralieĺna z journald. Zvyčajna heta značyć, što +realizacyja syslog nie paspiavaje apracavać paviedamlienni z nieabchodnaj +chutkasciu. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Kropka mantavannia nie pustaja +Defined-By: systemd +Support: %SUPPORT_URL% + +Kataloh @WHERE@ ukazany jak kropka mantavannia (druhoje polie ŭ /etc/fstab +ci Where= polie ŭ fajlie junita systemd) i nie pusty. Heta nie pieraškadžaje +mantavanniu, alie isnujučyja ŭ im fajly buduć niedastupny. Dlia dostupu da +ich, kali laska, zmantujcie hetuju fajlavuju sistemu ŭ inšaje miesca. + +-- 24d8d4452573402496068381a6312df2 +Subject: Virtuaĺnaja mašyna abo kantejnier zapusciŭsia +Defined-By: systemd +Support: %SUPPORT_URL% + +Virtuaĺnaja mašyna @NAME@ z lidaram № @LEADER@ zapuscilasia i +hatova dlia vykarystannia. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Virtuaĺnaja mašyna abo kantejnier spynieny +Defined-By: systemd +Support: %SUPPORT_URL% + +Virtuaĺnaja mašyna @NAME@ z lidaram № @LEADER@ spyniena. + +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: Miechanizm DNSSEC adkliučany, bo siervier nie padtrymlivaje jaho +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +Servis vyznačennia imion (systemd-resolved.service) vyznačyŭ, što +DNS-siervier nie padtrymlivaje miechanizm DNSSEC. U vyniku pravierka DNSSEC +byla adkliučana. + +Hetaja padzieja ŭznikaje kali naladžany DNSSEC=allow-downgrade +u fajlie resolved.conf i DNS-siervier nie padtrymlivaje miechanizm DNSSEC. +Zviarnicie ŭvahu, što režym allow-downgrade dazvaliaje praviesci ataku +«DNSSEC downgrade», u chodzie jakoj zlamysnik moža adkliučyć pravierku +DNSSEC šliacham padstanoŭki padroblienych DNSSEC-adkazaŭ u kamunikacyjny +kanal. + +Heta padzieja moža być prykmietaj taho, što DNS-siervier sapraŭdy +niesumiaščaĺny z DNSSEC abo što zlamysniku paspiachova atrymalasia praviesci +ataku pa adkliučenniu DNSSEC. + +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: Zboj pry praviercy DNSSEC +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +DNS-zapyt abo resursny zapis nie prajšoŭ pravierku DNSSEC. +Jak pravila, heta pakazvaje na zniešniaje ŭzdziejannie na kanal suviazi. + +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: Davierany kliuč DNSSEC byŭ anuliavany +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Davierany kliuč DNSSEC byŭ anuliavany. Nieabchodna naladzić novy davierany +kliuč abo abnavić apieracyjnuju sistemu, kab atrymać abnoŭlieny davierany +kliuč DNSSEC. diff --git a/src/grp-journal/systemd-journald/systemd.bg.catalog.in b/src/grp-journal/systemd-journald/systemd.bg.catalog.in new file mode 100644 index 0000000000..76b0ce8f17 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.bg.catalog.in @@ -0,0 +1,324 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2016 Alexander Shopov +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages + +# The catalog format is documented on +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: Журналният процес е пуснат +Defined-By: systemd +Support: %SUPPORT_URL% + +Журналният процес на системата е стартирал, отворил е журналните файлове +за запис и може да приема заявки. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Журналният процес е спрян +Defined-By: systemd +Support: %SUPPORT_URL% + +Журналният процес на системата е спрян, затворени са всички отворени +журнални файлове. + +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: Пространството върху диска заето от журналните файлове +Defined-By: systemd +Support: %SUPPORT_URL% + +@JOURNAL_NAME@ (@JOURNAL_PATH@) в момента заема @CURRENT_USE_PRETTY@. +Максималният зададен размер е @MAX_USE_PRETTY@. +Свободни се оставят поне @DISK_KEEP_FREE_PRETTY@ (от текущо наличните @DISK_AVAILABLE_PRETTY@). +Максималният наложен размер е @LIMIT_PRETTY@, от който @AVAILABLE_PRETTY@ са свободни. + +Настройките за максималния размер на журнала върху диска се +управляват чрез директивите „SystemMaxUse=“, „SystemKeepFree=“, +„SystemMaxFileSize=“, „RuntimeMaxUse=“, „RuntimeKeepFree=“ и +„RuntimeMaxFileSize=“ във файла „/etc/systemd/journald.conf“. +За повече информация прегледайте „journald.conf(5)“ от ръководството. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Съобщенията от някоя услуга не са допуснати +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Някоя услуга генерира прекалено много съобщения за кратък период. +Част само от нейните съобщения са отхвърляни. + +Съобщенията от другите услуги не са засегнати. + +Настройките за максималния брой съобщения, които ще се обработят, се +управляват чрез директивите „RateLimitInterval=“ и „RateLimitBurst=“ във +файла „/etc/systemd/journald.conf“. За повече информация прегледайте +„journald.conf(5)“ от ръководството. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Пропуснати журнални съобщения +Defined-By: systemd +Support: %SUPPORT_URL% + +Някои от съобщенията на ядрото може и да са пропуснати, защото системата не +смогваше да ги обработи достатъчно бързо. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Процес № @COREDUMP_PID@ (@COREDUMP_COMM@) запази освободената памет +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Процес № @COREDUMP_PID@ (@COREDUMP_COMM@) заби, представянето му в паметта +бе запазено. + +Най-често това се дължи на грешка в забилата програма и следва да я +докладвате на създателите на програмата. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Създадена е нова сесия № @SESSION_ID@ за потребителя „@USER_ID@“ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +За потребителя „@USER_ID@“ е създадена нова сесия № @SESSION_ID@. + +Водещият процес на сесията е: @LEADER@ + +-- 3354939424b4456d9802ca8333ed424a +Subject: Сесия № @SESSION_ID@ приключи +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Сесия № @SESSION_ID@ приключи работа. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Налично е ново работно място № @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Новото работно място № @SEAT_ID@ е настроено и готово за работа. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Работното място № @SEAT_ID@ е премахнато +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Работното място № @SEAT_ID@ вече не е налично. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Смяна на системното време +Defined-By: systemd +Support: %SUPPORT_URL% + +Часовникът на системата е сверен да сочи @REALTIME@ микросекунди след +1 януари 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Смяна на часовия пояс да е „@TIMEZONE@“ +Defined-By: systemd +Support: %SUPPORT_URL% + +Часовият пояс на системата е сменен на „@TIMEZONE@“. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Стартирането на системата завърши +Defined-By: systemd +Support: %SUPPORT_URL% + +Успешно са стартирали всички услуги, които са посочени за задействане при +стартиране на системата. Това не означава, че системата бездейства, защото +някои от услугите може да извършват специфични действия при стартиране. + +Стартирането на ядрото отне @KERNEL_USEC@ микросекунди. + +Стартирането на RAM диска за първоначално зареждане отне @INITRD_USEC@ +микросекунди. + +Стартирането на потребителските програми отне @USERSPACE_USEC@ микросекунди. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Системата е приспана на ниво „@SLEEP@“ +Defined-By: systemd +Support: %SUPPORT_URL% + +Системата премина в състояние на приспиване „@SLEEP@“. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Системата се събуди след приспиване на ниво„@SLEEP@“ +Defined-By: systemd +Support: %SUPPORT_URL% + +Системата се събуди от състояние на приспиване „@SLEEP@“. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Започна процедура на спиране на системата +Defined-By: systemd +Support: %SUPPORT_URL% + +Започна процедурата на Systemd за спиране на системата. Всички процеси и +услуги се спират, всички файлови системи се демонтират. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Модул „@UNIT@“ се стартира +Defined-By: systemd +Support: %SUPPORT_URL% + +Модулът „@UNIT@“ се стартира в момента + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Модул „@UNIT@“ вече е стартиран +Defined-By: systemd +Support: %SUPPORT_URL% + +Стартирането на модул „@UNIT@“ завърши. + +Резултатът е: @RESULT@ + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Модул „@UNIT@“ се спира +Defined-By: systemd +Support: %SUPPORT_URL% + +Модулът „@UNIT@“ се спира в момента. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Модул „@UNIT@“ вече е спрян +Defined-By: systemd +Support: %SUPPORT_URL% + +Спирането на модул „@UNIT@“ завърши. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Модулът „@UNIT@“ не успя да стартира +Defined-By: systemd +Support: %SUPPORT_URL% + +Модулът „@UNIT@“ не успя да стартира. + +Резултатът е: @RESULT@ + +-- d34d037fff1847e6ae669a370e694725 +Subject: Модулът „@UNIT@“ започна презареждане на настройките си +Defined-By: systemd +Support: %SUPPORT_URL% + +Модулът „@UNIT@“ започна презареждане на настройките си. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Модулът „@UNIT@“ завърши презареждането на настройките си +Defined-By: systemd +Support: %SUPPORT_URL% + +Модулът „@UNIT@“ завърши презареждането на настройките си. + +Резултатът e: @RESULT@ + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Програмата „@EXECUTABLE@“ не успя да се стартира +Defined-By: systemd +Support: %SUPPORT_URL% + +Програмата „@EXECUTABLE@“ не успя да се стартира. + +Върнатият номер на грешка е: @ERRNO@ + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Поне едно съобщение не бе препратено към syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Поне едно съобщение не бе препратено към журналната услуга syslog, която +работи успоредно с journald. + +Най-често това указва, че тази реализация на syslog не може да поеме текущия +обем съобщения. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Точката за монтиране не е празна +Defined-By: systemd +Support: %SUPPORT_URL% + +Директорията „@WHERE@“ не е празна. + +Тя е указана като точка за монтиране — или като второ поле във файла +„/etc/fstab“, или чрез директивата „Where=“ в някой от файловете за +модул на Systemd. + +Това не пречи на самото монтиране, но вече съществуващите там файлове и +директории няма да се виждат повече, освен ако ръчно не монтирате тази +непразна директория някъде другаде. + +-- 24d8d4452573402496068381a6312df2 +Subject: Стартирана е виртуална машина или контейнер +Defined-By: systemd +Support: %SUPPORT_URL% + +Виртуалната машина „@NAME@“ с идентификатор на водещия процес @LEADER@ +е стартирана и готова за работа. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Спряна е виртуална машина или контейнер +Defined-By: systemd +Support: %SUPPORT_URL% + +Виртуалната машина „@NAME@“ с идентификатор на водещия процес @LEADER@ +е спряна. + +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: Режимът DNSSEC е изключен, защото сървърът не го поддържа +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +Локалната услуга за имена (systemd-resolved.service) установи, че +настроения сървър за DNS не поддържа DNSSEC, затова този режим е изключен. + +Това се случва, когато директивата „DNSSEC=allow-downgrade“ е включена във +файла „resolved.conf“ и зададеният сървър за DNS не е съвместим с DNSSEC. + +Внимавайте, защото това може да позволи атака, при която трета страна ви +връща отговори, които да предизвикат понижаването на сигурността от DNSSEC +до DNS. + +Такова събитие означава, че или сървърът за DNS не е съвместим с DNSSEC, +или някой успешно ви е атакувал за понижаване на сигурността на имената. + +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: Неуспешна проверка на DNSSEC +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Заявка или запис в DNS не издържа проверка с DNSSEC. + +Това обикновено показва вмешателство на трета страна в канала ви за връзка. + +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: Анулирана доверена котва в DNSSEC +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Анулирана е доверена котва за DNSSEC и трябва да настроите нова. + +Понякога новата идва с обновяване на системата. diff --git a/src/grp-journal/systemd-journald/systemd.catalog.in b/src/grp-journal/systemd-journald/systemd.catalog.in new file mode 100644 index 0000000000..8de8597fe9 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.catalog.in @@ -0,0 +1,334 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages + +# The catalog format is documented on +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: The journal has been started +Defined-By: systemd +Support: %SUPPORT_URL% + +The system journal process has started up, opened the journal +files for writing and is now ready to process requests. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: The journal has been stopped +Defined-By: systemd +Support: %SUPPORT_URL% + +The system journal process has shut down and closed all currently +active journal files. + +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: Disk space used by the journal +Defined-By: systemd +Support: %SUPPORT_URL% + +@JOURNAL_NAME@ (@JOURNAL_PATH@) is currently using @CURRENT_USE_PRETTY@. +Maximum allowed usage is set to @MAX_USE_PRETTY@. +Leaving at least @DISK_KEEP_FREE_PRETTY@ free (of currently available @DISK_AVAILABLE_PRETTY@ of disk space). +Enforced usage limit is thus @LIMIT_PRETTY@, of which @AVAILABLE_PRETTY@ are still available. + +The limits controlling how much disk space is used by the journal may +be configured with SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, +RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= settings in +/etc/systemd/journald.conf. See journald.conf(5) for details. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Messages from a service have been suppressed +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +A service has logged too many messages within a time period. Messages +from the service have been dropped. + +Note that only messages from the service in question have been +dropped, other services' messages are unaffected. + +The limits controlling when messages are dropped may be configured +with RateLimitIntervalSec= and RateLimitBurst= in +/etc/systemd/journald.conf. See journald.conf(5) for details. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Journal messages have been missed +Defined-By: systemd +Support: %SUPPORT_URL% + +Kernel messages have been lost as the journal system has been unable +to process them quickly enough. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Process @COREDUMP_PID@ (@COREDUMP_COMM@) dumped core +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Process @COREDUMP_PID@ (@COREDUMP_COMM@) crashed and dumped core. + +This usually indicates a programming error in the crashing program and +should be reported to its vendor as a bug. + +-- fc2e22bc6ee647b6b90729ab34a250b1 de +Subject: Speicherabbild für Prozess @COREDUMP_PID@ (@COREDUMP_COMM) generiert +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Prozess @COREDUMP_PID@ (@COREDUMP_COMM@) ist abgebrochen worden und +ein Speicherabbild wurde generiert. + +Üblicherweise ist dies ein Hinweis auf einen Programmfehler und sollte +als Fehler dem jeweiligen Hersteller gemeldet werden. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: A new session @SESSION_ID@ has been created for user @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +A new session with the ID @SESSION_ID@ has been created for the user @USER_ID@. + +The leading process of the session is @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Session @SESSION_ID@ has been terminated +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +A session with the ID @SESSION_ID@ has been terminated. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: A new seat @SEAT_ID@ is now available +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +A new seat @SEAT_ID@ has been configured and is now available. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Seat @SEAT_ID@ has now been removed +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +A seat @SEAT_ID@ has been removed and is no longer available. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Time change +Defined-By: systemd +Support: %SUPPORT_URL% + +The system clock has been changed to @REALTIME@ microseconds after January 1st, 1970. + +-- c7a787079b354eaaa9e77b371893cd27 de +Subject: Zeitänderung +Defined-By: systemd +Support: %SUPPORT_URL% + +Die System-Zeit wurde geändert auf @REALTIME@ Mikrosekunden nach dem 1. Januar 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Time zone change to @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +The system timezone has been changed to @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: System start-up is now complete +Defined-By: systemd +Support: %SUPPORT_URL% + +All system services necessary queued for starting at boot have been +successfully started. Note that this does not mean that the machine is +now idle as services might still be busy with completing start-up. + +Kernel start-up required @KERNEL_USEC@ microseconds. + +Initial RAM disk start-up required @INITRD_USEC@ microseconds. + +Userspace start-up required @USERSPACE_USEC@ microseconds. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: System sleep state @SLEEP@ entered +Defined-By: systemd +Support: %SUPPORT_URL% + +The system has now entered the @SLEEP@ sleep state. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: System sleep state @SLEEP@ left +Defined-By: systemd +Support: %SUPPORT_URL% + +The system has now left the @SLEEP@ sleep state. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: System shutdown initiated +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemd shutdown has been initiated. The shutdown has now begun and +all system services are terminated and all file systems unmounted. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Unit @UNIT@ has begun start-up +Defined-By: systemd +Support: %SUPPORT_URL% + +Unit @UNIT@ has begun starting up. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Unit @UNIT@ has finished start-up +Defined-By: systemd +Support: %SUPPORT_URL% + +Unit @UNIT@ has finished starting up. + +The start-up result is @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Unit @UNIT@ has begun shutting down +Defined-By: systemd +Support: %SUPPORT_URL% + +Unit @UNIT@ has begun shutting down. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Unit @UNIT@ has finished shutting down +Defined-By: systemd +Support: %SUPPORT_URL% + +Unit @UNIT@ has finished shutting down. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Unit @UNIT@ has failed +Defined-By: systemd +Support: %SUPPORT_URL% + +Unit @UNIT@ has failed. + +The result is @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Unit @UNIT@ has begun reloading its configuration +Defined-By: systemd +Support: %SUPPORT_URL% + +Unit @UNIT@ has begun reloading its configuration + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Unit @UNIT@ has finished reloading its configuration +Defined-By: systemd +Support: %SUPPORT_URL% + +Unit @UNIT@ has finished reloading its configuration + +The result is @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Process @EXECUTABLE@ could not be executed +Defined-By: systemd +Support: %SUPPORT_URL% + +The process @EXECUTABLE@ could not be executed and failed. + +The error number returned by this process is @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: One or more messages could not be forwarded to syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +One or more messages could not be forwarded to the syslog service +running side-by-side with journald. This usually indicates that the +syslog implementation has not been able to keep up with the speed of +messages queued. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Mount point is not empty +Defined-By: systemd +Support: %SUPPORT_URL% + +The directory @WHERE@ is specified as the mount point (second field in +/etc/fstab or Where= field in systemd unit file) and is not empty. +This does not interfere with mounting, but the pre-exisiting files in +this directory become inaccessible. To see those over-mounted files, +please manually mount the underlying file system to a secondary +location. + +-- 24d8d4452573402496068381a6312df2 +Subject: A virtual machine or container has been started +Defined-By: systemd +Support: %SUPPORT_URL% + +The virtual machine @NAME@ with its leader PID @LEADER@ has been +started is now ready to use. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: A virtual machine or container has been terminated +Defined-By: systemd +Support: %SUPPORT_URL% + +The virtual machine @NAME@ with its leader PID @LEADER@ has been +shut down. + +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: DNSSEC mode has been turned off, as server doesn't support it +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +The resolver service (systemd-resolved.service) has detected that the +configured DNS server does not support DNSSEC, and DNSSEC validation has been +turned off as result. + +This event will take place if DNSSEC=allow-downgrade is configured in +resolved.conf and the configured DNS server is incompatible with DNSSEC. Note +that using this mode permits DNSSEC downgrade attacks, as an attacker might be +able turn off DNSSEC validation on the system by inserting DNS replies in the +communication channel that result in a downgrade like this. + +This event might be indication that the DNS server is indeed incompatible with +DNSSEC or that an attacker has successfully managed to stage such a downgrade +attack. + +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: DNSSEC validation failed +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +A DNS query or resource record set failed DNSSEC validation. This is usually +indication that the communication channel used was tampered with. + +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: A DNSSEC trust anchor has been revoked +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +A DNSSEC trust anchor has been revoked. A new trust anchor has to be +configured, or the operating system needs to be updated, to provide an updated +DNSSEC trust anchor. diff --git a/src/grp-journal/systemd-journald/systemd.da.catalog.in b/src/grp-journal/systemd-journald/systemd.da.catalog.in new file mode 100644 index 0000000000..bc7d94476f --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.da.catalog.in @@ -0,0 +1,261 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Danish translation + +# The catalog format is documented on +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: Journalen er blevet startet +Defined-By: systemd +Support: %SUPPORT_URL% + +System-journal processen har startet op, åbnet journal filerne for +tilskrivning og er nu klar til at modtage anmodninger. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Journalen er blevet stoppet +Defined-By: systemd +Support: %SUPPORT_URL% + +System-journal processen er stoppet og har lukket alle aktive journal +filer. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Beskeder fra en service er blevet undertrykt +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +En service har logget for mange beskeder inden for en given tidsperiode. +Beskeder fra omtalte service er blevet smidt væk. + +Kun beskeder fra omtalte service er smidt væk. Beskeder fra andre +services er ikke påvirket. + +Grænsen for hvornår beskeder bliver smidt væk kan konfigureres +med RateLimitIntervalSec= og RateLimitBurst= i +/etc/systemd/journald.conf. Se journald.conf(5) for detaljer herom. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Journal beskeder er gået tabt +Defined-By: systemd +Support: %SUPPORT_URL% + +Kernel beskeder er gået tabt da journal systemet ikke har været i stand +til at håndtere dem hurtigt nok. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Fejl-fil genereret for process @COREDUMP_PID@ (@COREDUMP_COMM@) +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Process @COREDUMP_PID@ (@COREDUMP_COMM@) har lukket ned og genereret en +fejl-fil. + +Dette indikerer som regel en programmeringsfejl i det nedlukkede program +og burde blive reporteret som en bug til folkene bag + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: En ny session @SESSION_ID@ er blevet lavet for bruger @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +En ny session med ID @SESSION_ID@ er blevet lavet for brugeren @USER_ID@. + +Den ledende process for sessionen er @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Session @SESSION_ID@ er blevet lukket ned +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +En session med ID @SESSION_ID@ er blevet lukket ned. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: En ny arbejdsstation $SEAT_ID@ er nu tilgængelig +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +En ny arbejdsstation @SEAT_ID@ er blevet konfigureret og er nu tilgængelig. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Arbejdsstation @SEAT_ID@ er nu blevet fjernet +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +En arbejdsstation @SEAT_ID@ er blevet fjernet og er ikke længere tilgængelig. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Tidsændring +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemtiden er blevet ændret til @REALTIME@ mikrosekunder efter d. 1. Januar 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Tidszoneændring til @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Tidszonen for systemet er blevet ændret til @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Opstart af systemet er nu fuldført +Defined-By: systemd +Support: %SUPPORT_URL% + +Alle system services i kø til at køre ved opstart, er blevet startet +med success. Bemærk at dette ikke betyder at maskinen er i dvale, da +services stadig kan være i gang med at færdiggøre deres opstart. + +Opstart af kernel tog @KERNEL_USEC@ mikrosekunder. + +Opstart af initrd tog @INITRD_USEC@ mikrosekunder. + +Opstart af userspace tog @USERSPACE_USEC@ mikrosekunder. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: System slumretilstand @SLEEP@ trådt i kraft +Defined-By: systemd +Support: %SUPPORT_URL% + +System er nu gået i @SLEEP@ slumretilstand. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: System slumretilstand @SLEEP@ forladt +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemet har nu forladt @SLEEP@ slumretilstand. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Systemnedlukning påbegyndt +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemnedlukning er blevet påbegyndt. Nedlukningen er nu begyndt og +alle system services er blevet afbrudt og alle filsystemer afmonteret. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Enhed @UNIT@ har påbegyndt opstart +Defined-By: systemd +Support: %SUPPORT_URL% + +Enhed @UNIT@ er begyndt at starte op. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Enhed @UNIT har færdiggjort opstart +Defined-By: systemd +Support: %SUPPORT_URL% + +Enhed @UNIT@ er færdig med at starte op. + +Resultat for opstart er @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Enhed @UNIT@ har påbegyndt nedlukning +Defined-By: systemd +Support: %SUPPORT_URL% + +Enhed @UNIT@ har påbegyndt nedlukning. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Enhed @UNIT@ har færdiggjort nedlukning +Defined-By: systemd +Support: %SUPPORT_URL% + +Enhed @UNIT@ har færdiggjort nedlukning. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Enhed @UNIT@ har fejlet +Defined-By: systemd +Support: %SUPPORT_URL% + +Enhed @UNIT@ har fejlet. + +Resultatet er @RESULT@ + +-- d34d037fff1847e6ae669a370e694725 +Subject: Enhed @UNIT@ har påbegyndt genindlæsning af sin konfiguration +Defined-By: systemd +Support: %SUPPORT_URL% + +Enhed @UNIT@ er begyndt at genindlæse sin konfiguration + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Enhed @UNIT@ har færdiggjort genindlæsning af sin konfiguration +Defined-By: systemd +Support: %SUPPORT_URL% + +Enhed @UNIT@ er færdig med at genindlæse sin konfiguration + +Resultatet er: @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Process @EXECUTABLE@ kunne ikke eksekveres +Defined-By: systemd +Support: %SUPPORT_URL% + +Processen @EXECUTABLE@ kunne ikke eksekveres og fejlede. + +Processens returnerede fejlkode er @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Èn eller flere beskeder kunne ikke videresendes til syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Èn eller flere beskeder kunne ikke videresendes til syslog servicen +der kører side-om-side med journald. Dette indikerer typisk at syslog +implementationen ikke har kunnet følge med mængden af ventende beskeder. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Monteringspunkt er ikke tomt +Defined-By: systemd +Support: %SUPPORT_URL% + +Folderen @WHERE@ er specificeret som monteringspunkt (andet felt i +/etc/fstab eller Where= feltet i systemd enhedsfil) men er ikke tom. +Dette forstyrrer ikke monteringen, men de pre-eksisterende filer i folderen +bliver utilgængelige. For at se de over-monterede filer; montér det +underlæggende filsystem til en anden lokation. + +-- 24d8d4452573402496068381a6312df2 +Subject: En virtuel maskine eller container er blevet startet +Defined-By: systemd +Support: %SUPPORT_URL% + +Den virtuelle maskine @NAME@ med dens leder PID @LEADER@ er blevet +startet og er klar til brug. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: En virtuel maskine eller container er blevet afbrudt +Defined-By: systemd +Support: %SUPPORT_URL% + +Den virtuelle maskine @NAME@ med dens leder PID @LEADER@ er blevet +nedlukket. diff --git a/src/grp-journal/systemd-journald/systemd.fr.catalog.in b/src/grp-journal/systemd-journald/systemd.fr.catalog.in new file mode 100644 index 0000000000..573b288e74 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.fr.catalog.in @@ -0,0 +1,320 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2013-2015 Sylvain Plantefève +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# French translation + +# Le format du catalogue de messages est décrit (en anglais) içi : +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +-- f77379a8490b408bbe5f6940505a777b +Subject: Le journal a été démarré +Defined-By: systemd +Support: %SUPPORT_URL% + +Le processus du journal système a démarré, ouvert ses fichiers en écriture +et est prêt à traiter les requêtes. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Le journal a été arrêté +Defined-By: systemd +Support: %SUPPORT_URL% + +Le processus du journal système a été arrêté et tous ses fichiers actifs +ont été fermés. + +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: Espace disque utilisé par le journal +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +@JOURNAL_NAME@ (@JOURNAL_PATH@) utilise actuellement @CURRENT_USE_PRETTY@. +Le maximum autorisé est défini à @MAX_USE_PRETTY@. +Au moins @DISK_KEEP_FREE_PRETTY@ doivent être laissés libres +(sur @DISK_AVAILABLE_PRETTY@ d'espace disque actuellement libre). +La limite appliquée est donc @LIMIT_PRETTY@, dont @AVAILABLE_PRETTY@ +sont toujours disponibles. + +Les limites définissant la quantité d'espace disque que peut utiliser le +journal peuvent être configurées avec les paramètres SystemMaxUse=, +SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, +RuntimeMaxFileSize= dans le fichier /etc/systemd/journald.conf. +Voir journald.conf(5) pour plus de détails. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Des messages d'un service ont été supprimés +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Un service a essayé d'enregistrer un trop grand nombre de messages sur un +intervalle de temps donné. Des messages de ce service ont été évincés. + +Notez que seuls des messages de ce service ont été évincés, les messages des +autres services ne sont pas affectés. + +Les limites définissant ce comportement peuvent être configurées avec les +paramètres RateLimitIntervalSec= et RateLimitBurst= dans le fichier +/etc/systemd/journald.conf. Voir journald.conf(5) pour plus de détails. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Des messages du journal ont été manqués +Defined-By: systemd +Support: %SUPPORT_URL% + +Des messages du noyau ont été manqués car le journal système n'a pas été +capable de les traiter suffisamment vite. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Le processus @COREDUMP_PID@ (@COREDUMP_COMM@) a généré un fichier « core » +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Le processus @COREDUMP_PID@ (@COREDUMP_COMM@) a planté et généré un fichier « core ». + +Cela indique généralement une erreur de programmation dans le programme +incriminé, et cela devrait être notifié à son concepteur comme un défaut (bug). + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Une nouvelle session @SESSION_ID@ a été créée pour l'utilisateur @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Une nouvelle session a été créée pour l'utilisateur @USER_ID@ avec +l'identifiant (ID) @SESSION_ID@. + +Le processus maître de la session est @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: La session @SESSION_ID@ s'est terminée +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +La session d'identifiant (ID) @SESSION_ID@ s'est terminée. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Un nouveau poste (seat) @SEAT_ID@ est disponible +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Un nouveau poste (seat) @SEAT_ID@ a été configuré et est maintenant +disponible. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Le poste (seat) @SEAT_ID@ a été retiré +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Le poste (seat) @SEAT_ID@ a été retiré et n'est plus disponible. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Changement d'heure +Defined-By: systemd +Support: %SUPPORT_URL% + +L'horloge système a été modifiée et positionnée à @REALTIME@ microsecondes +après le 1er janvier 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Fuseau horaire modifié en @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Le fuseau horaire du système a été modifié et positionné à @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Le démarrage du système est terminé +Defined-By: systemd +Support: %SUPPORT_URL% + +Tous les services nécessaires au démarrage du système ont été lancés avec +succès. Notez que cela ne signifie pas que le système est maintenant au +repos, car des services peuvent encore être en train de terminer leur +démarrage. + +Le chargement du noyau a nécessité @KERNEL_USEC@ microsecondes. + +Le chargement du « RAM disk » initial a nécessité @INITRD_USEC@ microsecondes. + +Le chargement de l'espace utilisateur a nécessité @USERSPACE_USEC@ microsecondes. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Le système entre dans l'état de repos (sleep state) @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Le système est maintenant à l'état de repos (sleep state) @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Le système sorti de l'état de repos (sleep state) @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Le système est maintenant sorti de l'état de repos (sleep state) @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Arrêt du système amorcé +Defined-By: systemd +Support: %SUPPORT_URL% + +L'arrêt du système a été amorcé. L'arrêt a maintenant commencé, tous les +services du système sont terminés et tous les systèmes de fichiers sont +démontés. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: L'unité (unit) @UNIT@ a commencé à démarrer +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unité (unit) @UNIT@ a commencé à démarrer. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: L'unité (unit) @UNIT@ a terminé son démarrage +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unité (unit) @UNIT@ a terminé son démarrage, avec le résultat @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: L'unité (unit) @UNIT@ a commencé à s'arrêter +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unité (unit) @UNIT@ a commencé à s'arrêter. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: L'unité (unit) @UNIT@ a terminé son arrêt +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unité (unit) @UNIT@ a terminé son arrêt. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: L'unité (unit) @UNIT@ a échoué +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unité (unit) @UNIT@ a échoué, avec le résultat @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: L'unité (unit) @UNIT@ a commencé à recharger sa configuration +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unité (unit) @UNIT@ a commencé à recharger sa configuration. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: L'unité (unit) @UNIT@ a terminé de recharger configuration +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unité (unit) @UNIT@ a terminé de recharger configuration, +avec le résultat @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Le processus @EXECUTABLE@ n'a pas pu être exécuté +Defined-By: systemd +Support: %SUPPORT_URL% + +Le processus @EXECUTABLE@ n'a pas pu être exécuté, et a donc échoué. + +Le code d'erreur renvoyé est @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Un ou plusieurs messages n'ont pas pu être transmis à syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Un ou plusieurs messages n'ont pas pu être transmis au service syslog +s'exécutant conjointement avec journald. Cela indique généralement que +l'implémentation de syslog utilisée n'a pas été capable de suivre +la cadence du flux de messages. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Le point de montage n'est pas vide +Defined-By: systemd +Support: %SUPPORT_URL% + +Le répertoire @WHERE@ est spécifié comme point de montage (second champ du +fichier /etc/fstab, ou champ Where= dans une unité (unit) systemd) et n'est +pas vide. +Cela ne perturbe pas le montage du système de fichiers, mais les fichiers +préalablement présents dans ce répertoire sont devenus inaccessibles. +Pour atteindre ces fichiers, veuillez monter manuellement le système de +fichiers sous-jacent à un autre emplacement. + +-- 24d8d4452573402496068381a6312df2 +Subject: Une machine virtuelle ou un conteneur (container) a été démarré +Defined-By: systemd +Support: %SUPPORT_URL% + +La machine virtuelle @NAME@ a été démarrée avec le PID maître @LEADER@, +et est maintenant prête à l'emploi. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Une machine virtuelle ou un conteneur (container) a été arrêté +Defined-By: systemd +Support: %SUPPORT_URL% + +La machine virtuelle @NAME@ avec le PID maître @LEADER@ a été arrêtée. + +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: Le mode DNSSEC a été désactivé, car il n'est pas supporté par le serveur +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +Le service de résolution (systemd-resolved.service) a détecté que le serveur +DNS configuré ne supporte pas DNSSEC, et la validation DNSSEC a donc été +désactivée. + +Cet évènement se produit si DNSSEC=allow-downgrade est configuré dans +resolved.conf et que le serveur DNS configuré n'est pas compatible avec +DNSSEC. +Veuillez noter que ce mode permet des attaques de rétrogradation DNSSEC, +car un attaquant peut être capable de désactiver la validation DNSSEC sur +le système en injectant des réponses DNS dans le canal de communication. + +Cet évènement indique que le serveur DNS est effectivement incompatible avec +DNSSEC, ou qu'un attaquant a peut-être conduit une telle attaque avec succès. + +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: La validation DNSSEC a échoué +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Une requête ou une ressource DNS n'a pas passé la validation DNSSEC. +Ceci est généralement une indication que le canal de communication a été +altéré. + +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: Une ancre de confiance DNSSEC a été révoquée +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Une ancre de confiance DNSSEC a été révoquée. Une nouvelle ancre de +confiance doit être configurée, ou le système d'exploitation a besoin +d'être mis à jour, pour fournir une version à jour de l'ancre de confiance. diff --git a/src/grp-journal/systemd-journald/systemd.hr.catalog.in b/src/grp-journal/systemd-journald/systemd.hr.catalog.in new file mode 100644 index 0000000000..7502aed741 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.hr.catalog.in @@ -0,0 +1,314 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Croatian translation + +# Format kataloga je dokumentiran na +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# Za pojašnjenje zašto ovo radimo, posjetite https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: journal je pokrenut +Defined-By: systemd +Support: %SUPPORT_URL% + +Journal proces sustava se pokrenuo, otvorio je journal + datoteke za upis i spreman je za obradu zahtjeva. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: journal je zaustavljen +Defined-By: systemd +Support: %SUPPORT_URL% + +Journal proces sustava je isključio i zatvorio sve trenutno +aktivne journal datoteke. + +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: Diskovni prostor koji koristi journal +Defined-By: systemd +Support: %SUPPORT_URL% + +@JOURNAL_NAME@ (@JOURNAL_PATH@) trenutno koristi @CURRENT_USE_PRETTY@. +Najveća dopuštena upotreba je postavljena na @MAX_USE_PRETTY@. +Ostavljam najmanje @DISK_KEEP_FREE_PRETTY@ slobodno (trenutno dostupno @DISK_AVAILABLE_PRETTY@ diskovnog prostora). +Prisilno ograničenje upotrebe je @LIMIT_PRETTY@, od kojeg je @AVAILABLE_PRETTY@ još dostupno. + +Ograničenja kontroliraju koliko diskovnog prostora koristi journal mogu +se podesiti sa SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, +RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= settings u +/etc/systemd/journald.conf. Pogledajte journald.conf(5) za više pojedinosti. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Poruka iz usluge je potisnuta +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Usluga je prijavila previše poruka u određenom vremenskom razdoblju. Poruke +iz usluge su odbačene. + +Zapamtite da samo poruke iz usluge u upitu su +odbačene, ostale poruke usluga nisu zahvaćene. + +Ograničenja koja kontroliraju kada je poruka odbačena mogu se podesiti +sa RateLimitIntervalSec= i RateLimitBurst= u +/etc/systemd/journald.conf. Pogledajte journald.conf(5) za više pojedinosti. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Journal poruka je propuštena +Defined-By: systemd +Support: %SUPPORT_URL% + +Kernel poruka je izgubljena zato jer ih journal sustav nije mogao +dovoljno brzo obraditi. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Proces @COREDUMP_PID@ (@COREDUMP_COMM@) je izbacio jezgru +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Proces @COREDUMP_PID@ (@COREDUMP_COMM@) se srušio i izbacio jezgru. + +Rušenje programa je uobičajeno uzrokovano greškom u programiranju i +trebalo bi se prijaviti razvijatelju kao greška. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Nova sesija @SESSION_ID@ je stvorena za korisnika @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Nova sesija sa ID @SESSION_ID@ je stvorena za korisnika @USER_ID@. + +Glavni proces sesije je @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Sesija @SESSION_ID@ je prekinuta +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Sesija sa ID @SESSION_ID@ je prekinuta. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Novo sjedište @SEAT_ID@ je sada dostupno +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Novo sjedište @SEAT_ID@ je podešeno i sada je dostupno. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Sjedište @SEAT_ID@ je sada uklonjeno +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Sjedište @SEAT_ID@ je uklonjeno i više nije dostupno. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Vrijeme promjene +Defined-By: systemd +Support: %SUPPORT_URL% + +Sat sustava je promijenjen na @REALTIME@ microsekundi nakon 1. Siječnja, 1970 godine. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Vremenska zona je promijenjena u @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Vremenska zona je promijenjena u @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Pokretanje sustava je sada završeno +Defined-By: systemd +Support: %SUPPORT_URL% + +Sve usluge sustava koje su zadane za pokretanje pri pokretanju sustava +su uspješno pokrenute. Zapamtite da ovo ne znači da sada računalo +miruje zato jer se neke usluge još uvijek mogu pokretati. + +Pokretanje kernela zahtijeva @KERNEL_USEC@ mikrosekundi. + +Pokretanje početnog RAM diska zahtijeva @INITRD_USEC@ mikrosekundi. + +Pokretanje prostora korisnika zahtijeva @USERSPACE_USEC@ mikrosekundi. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Pokrenuto je stanje spavanja @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Sustav je sada pokrenuo stanje spavanja @SLEEP@ + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Završeno je stanje spavanja @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Sustav je sada završio stanje spavanja @SLEEP@ + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Pokrenuto je isključivanje sustava +Defined-By: systemd +Support: %SUPPORT_URL% + +Pokrenuto je isključivanje sustava. Isključivanje je sada pokrenuto, +sve usluge sustava su prekinute i svi datotečni sustavi su odmontirani. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Jedinica @UNIT@ je započela pokretanje +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedinica @UNIT@ je započela pokretanje. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Jedinica @UNIT@ je završila pokretanje +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedinica @UNIT@ je završila pokretanje. + +Rezultat pokretanja je @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Jedinica @UNIT@ je započela isključivanje +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedinica @UNIT@ je započela isključivanje. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Jedinica @UNIT@ je završila isključivanje +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedinica @UNIT@ je završila isključivanje. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Jedinica @UNIT@ nije uspjela +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedinica @UNIT@ nije uspjela. + +Rezultat je @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Jedinica @UNIT@ je započela ponovno učitavati podešavanja +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedinica @UNIT@ je započela ponovno učitavati podešavanja + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Jedinica @UNIT@ je završila ponovno učitavati podešavanja +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedinica @UNIT@ je završila ponovno učitavati podešavanja + +Rezultat je @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Proces @EXECUTABLE@ se ne može pokrenuti +Defined-By: systemd +Support: %SUPPORT_URL% + +Proces @EXECUTABLE@ se ne može pokrenuti i nije uspio. + +Broj greške vraćen ovim procesom je @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Jedna ili više poruka se ne mogu proslijediti u dnevnik sustava +Defined-By: systemd +Support: %SUPPORT_URL% + +Jedna ili više poruka se ne mogu proslijediti u dnevnik sustava, usluge +su pokrenute istovremeno s journalom. Ovo uobičajeno označava da +implementacija dnevnika sustava ne može slijediti brzinu +zahtjeva poruka. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Točka montiranja nije prazna +Defined-By: systemd +Support: %SUPPORT_URL% + +Direktorij @WHERE@ je određen za točku montiranja (drugi redak u +/etc/fstab ili Where= redak u datoteci systemd jedinice) i nije prazan. +To ne utječe na montiranje, ali postojeće datoteke u ovom direktoriju +postaju nedostupne. Kako bi vidjeli datoteke preko kojih je montirano, +ručno montirajte osnovni datotečni sustav na drugu lokaciju. + +-- 24d8d4452573402496068381a6312df2 +Subject: Virtualni stroj ili spremnik su pokrenuti +Defined-By: systemd +Support: %SUPPORT_URL% + +Virtualni stroj @NAME@ sa vodećim @LEADER@ PID-om je +pokrenut i spreman je za korištenje. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Virtualni stroj ili spremnik su isključeni +Defined-By: systemd +Support: %SUPPORT_URL% + +Virtualni stroj @NAME@ sa vodećim PID-om @LEADER@ je +isključen. + +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: DNSSEC način je isključen, jer ga poslužitelj ne podržava +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +Usluga razrješavanja (systemd-resolved.service) je otkrila da +podešeni DNS poslužitelj ne podržava DNSSEC, i DNSSEC, kao rezultat +provjera je isključena. + +Ovaj događaj će zauzeti mjesto ako je DNSSEC=allow-downgrade podešen u +resolved.conf i podešeni DNS poslužitelj je nekompatibilan s DNSSEC. Zapamtite +da korištenje ovog načina dopušta povećanje DNSSEC napada, napadač bi mogao +isključiti DNSSEC provjeru na sustavu umetanjem DNS odgovora u +komunikacijski kanal što rezultira povećanjem napada poput ovog. + +Ovaj događaj bi mogao označavati da je DNS poslužitelj uistinu nekompatibilan s +DNSSEC ili da je napadač uspješno izvršio takav napad. + +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: DNSSEC provjera neuspješna +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +DNS zahtjev ili snimak resursa nije prošao DNSSEC provjeru. To uobičajeno +označava da je komunikacijski kanal mijenjan. + +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: DNSSEC pouzdano sidro je opozvano +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +A DNSSEC trust anchor has been revoked. A new trust anchor has to be +configured, or the operating system needs to be updated, to provide an updated +DNSSEC trust anchor. diff --git a/src/grp-journal/systemd-journald/systemd.hu.catalog.in b/src/grp-journal/systemd-journald/systemd.hu.catalog.in new file mode 100644 index 0000000000..f538b7f958 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.hu.catalog.in @@ -0,0 +1,262 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2016 Gabor Kelemen +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages + +# The catalog format is documented on +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: A napló elindult +Defined-By: systemd +Support: %SUPPORT_URL% + +A rendszernapló folyamat elindult, megnyitotta írásra a naplófájlokat, +és most készen áll kérések feldolgozására. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: A napló leállt +Defined-By: systemd +Support: %SUPPORT_URL% + +A rendszernapló folyamat leállt, és bezárt minden jelenleg aktív naplófájlt. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Egy szolgáltatás üzenetei elnémítva +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Egy szolgáltatás túl sok üzenetet naplózott adott idő alatt. A +szolgáltatástól származó üzenetek eldobásra kerültek. + +Ne feledje, hogy csak a kérdéses szolgáltatás üzenetei kerültek eldobásra, + más szolgáltatások üzeneteit ez nem befolyásolja. + +Az üzenetek eldobását vezérlő korlátok az /etc/systemd/journald.conf +RateLimitIntervalSec= és RateLimitBurst= beállításaival adhatók meg. +Részletekért lásd a journald.conf(5) man oldalt. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Naplóüzenetek vesztek el +Defined-By: systemd +Support: %SUPPORT_URL% + +Kernelüzenetek vesztek el, mert a naplózó rendszer nem tudta elég gyorsan +feldolgozni azokat. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Egy folyamat összeomlott: @COREDUMP_PID@ (@COREDUMP_COMM@) +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Ez a folyamat: @COREDUMP_PID@ (@COREDUMP_COMM@) összeomlott, és core fájlt + írt ki. + +Ez általában programozási hibát jelez az összeomló programban, és +a szállítója felé kell bejelenteni. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Új munkamenet (@SESSION_ID@) létrehozva, felhasználója: @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Létrejött egy új munkamenet @SESSION_ID@ azonosítóval ezen felhasználóhoz: +@USER_ID@. + +A munkamenet vezető folyamata: @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Munkamenet (@SESSION_ID@) befejezve +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +A következő azonosítójú munkamenet befejeződött: @SESSION_ID@. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Elérhető egy új munkaállomás: @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Beállításra kerül és használható egy új munkaállomás: @SEAT_ID@. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: A munkaállomás eltávolítva: @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +A munkaállomás el lett távolítva, és már nem érhető el: @SEAT_ID@ + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Időmódosítás +Defined-By: systemd +Support: %SUPPORT_URL% + +A rendszeróra beállítva @REALTIME@ ezredmásodpercre 1970. január 1. után. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Időzóna-módosítás erre: @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +A rendszer időzónája módosítva lett erre: @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: A rendszer indítása kész +Defined-By: systemd +Support: %SUPPORT_URL% + +A rendszerindításkor szükséges indításhoz sorba állított összes +rendszerszolgáltatás elindult. Ne feledje, hogy ez nem jelenti, hogy a +gép üresjáratban van, mivel egyes szolgáltatások még az indítás +befejezésével lehetnek elfoglalva. + +A kernel indítása @KERNEL_USEC@ ezredmásodpercet igényelt. + +A kiinduló RAM lemez indítása @INITRD_USEC@ ezredmásodpercet igényelt. + +A felhasználói programok indítása @USERSPACE_USEC@ ezredmásodpercet igényelt. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: A rendszer „@SLEEP@” alvási állapotba lépett +Defined-By: systemd +Support: %SUPPORT_URL% + +A rendszer belépett ebbe az alvási állapotba: @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: A rendszer „@SLEEP@” alvási állapotból kilépett +Defined-By: systemd +Support: %SUPPORT_URL% + +A rendszer kilépett ebből az alvási állapotból: @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Rendszer leállítása kezdeményezve +Defined-By: systemd +Support: %SUPPORT_URL% + +A systemd leállítása kezdeményezve. A leállítás megkezdődött, minden +rendszerszolgáltatás befejeződik, minden fájlrendszer leválasztásra kerül. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: A(z) @UNIT@ egység indítása megkezdődött +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @UNIT@ egység megkezdte az indulást. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: A(z) @UNIT@ egység befejezte az indulást +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @UNIT@ egység befejezte az indulást + +Az indítás eredménye: @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: A(z) @UNIT@ egység megkezdte a leállást +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @UNIT@ egység megkezdte a leállást. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: A(z) @UNIT@ egység befejezte a leállást +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @UNIT@ egység befejezte a leállást. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: A(z) @UNIT@ egység hibát jelzett +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @UNIT@ egység hibát jelzett. + +Az eredmény: @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: A(z) @UNIT@ egység megkezdte a beállításainak újratöltését +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @UNIT@ egység megkezdte a beállításainak újratöltését. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: A(z) @UNIT@ egység befejezte a beállításainak újratöltését +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @UNIT@ egység befejezte a beállításainak újratöltését. + +Az eredmény: @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: A folyamat végrehajtása sikertelen: @EXECUTABLE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +A folyamat végrehajtása sikertelen volt, és hibát jelzett: @EXECUTABLE@. + +A folyamat által visszaadott hibaszám: @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Legalább egy üzenet nem továbbítható a rendszernaplónak +Defined-By: systemd +Support: %SUPPORT_URL% + +Legalább egy üzenet nem volt továbbítható a journald-vel párhuzamosan futó +syslog szolgáltatásnak. Ez általában azt jelenti, hogy a syslog +megvalósítás nem volt képes lépést tartani a sorba állított +üzenetek sebességével. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: A csatolási pont nem üres +Defined-By: systemd +Support: %SUPPORT_URL% + +A csatolási pontként megadott @WHERE@ könyvtár (második mező az /etc/fstab +fájlban, vagy a Where= sor a systemd egységfájlban) nem üres. Ez nem +akadályozza meg a csatolást, de a könyvtárban már meglévő fájlok +elérhetetlenné válnak. A fájlok láthatóvá tételéhez csatolja +az azokat tartalmazó fájlrendszert egy másodlagos helyre. + +-- 24d8d4452573402496068381a6312df2 +Subject: Egy virtuális gép vagy konténer elindult +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @NAME@ nevű virtuális gép (vezető PID: @LEADER@) elindult, és +használatra kész. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Egy virtuális gép vagy konténer befejeződött +Defined-By: systemd +Support: %SUPPORT_URL% + +A(z) @NAME@ nevű virtuális gép (vezető PID: @LEADER@) leállt. diff --git a/src/grp-journal/systemd-journald/systemd.it.catalog.in b/src/grp-journal/systemd-journald/systemd.it.catalog.in new file mode 100644 index 0000000000..86e44a604d --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.it.catalog.in @@ -0,0 +1,254 @@ +# This file is part of systemd. +# +# Copyright 2013 Daniele Medri +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages + +-- f77379a8490b408bbe5f6940505a777b +Subject: Il registro è stato avviato +Defined-By: systemd +Support: %SUPPORT_URL% + +Il processo relativo al registro di sistema è stato avviato, ha aperto i +file in scrittura ed è ora pronto a gestire richieste. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Il registro è stato terminato +Defined-By: systemd +Support: %SUPPORT_URL% + +Il processo relativo al registro di sistema è stato terminato e ha chiuso +tutti i file attivi. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: I messaggi di un servizio sono stati soppressi +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Un servizio ha registrato troppi messaggi in un dato periodo di tempo. +I messaggi del servizio sono stati eliminati. + +Solo i messaggi del servizio indicato sono stati +eliminati, i messaggi degli altri servizi rimangono invariati. + +I limiti oltre i quali i messaggi si eliminano si configurano +con RateLimitIntervalSec= e RateLimitBurst= in +/etc/systemd/journald.conf. Vedi journald.conf(5) per maggiori informazioni. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: I messaggi di un servizio sono stati perduti +Defined-By: systemd +Support: %SUPPORT_URL% + +I messaggi del kernel sono stati perduti perché, il registro di sistema +non è stato in grado di gestirli abbastanza velocemente. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Il processo @COREDUMP_PID@ (@COREDUMP_COMM@) ha generato un dump. +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Il processo @COREDUMP_PID@ (@COREDUMP_COMM@) si è bloccato generando un dump. + +Questo di solito capita per un errore di programmazione nell'applicazione e +dovrebbe essere segnalato al vendor come un bug. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: La nuova sessione @SESSION_ID@ è stata creata per l'utente @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Una nuova sessione con ID @SESSION_ID@ è stata creata per l'utente @USER_ID@. + +Il processo primario della sessione è @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: La sessione @SESSION_ID@ è terminata +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +La sessione con ID @SESSION_ID@ è terminata. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: La nuova postazione @SEAT_ID@ è ora disponibile +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +La nuova postazione @SEAT_ID@ è stata configurata ed è ora disponibile. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: La postazione @SEAT_ID@ è stata rimossa +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +La postazione @SEAT_ID@ è stata rimossa e non è più disponibile. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Cambio d'orario +Defined-By: systemd +Support: %SUPPORT_URL% + +L'orologio di sistema è cambiato in @REALTIME@ microsecondi dal 1 gennaio, 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Il fuso orario è cambiato in @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Il fuso orario di sistema è cambiato in @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Avvio del sistema completato. +Defined-By: systemd +Support: %SUPPORT_URL% + +Tutti i servizi di sistema richiesti per la fase di avvio sono stati eseguiti +con successo. Nota che la macchina potrebbe non essere ancora pronta in quanto +i servizi attivati sono in fase di completamento. + +L'avvio del kernel ha richiesto @KERNEL_USEC@ microsecondi. + +L'avvio del disco RAM ha richiesto @INITRD_USEC@ microsecondi. + +L'avvio dello userspace ha richiesto @USERSPACE_USEC@ microsecondi. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Il sistema è entrato in fase di pausa @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Il sistema è entrato nello stato di pausa @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Il sistema è uscito dalla fase di pausa @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Il sistema è uscito dallo stato di pausa @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Il sistema è in fase di spegnimento +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemd è in fase di spegnimento. Tutti i servizi di sistema +saranno terminati e tutti i file systems smontati. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: L'unità @UNIT@ inizia la fase di avvio +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unità @UNIT@ ha iniziato la fase di avvio. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: L'unità @UNIT@ termina la fase di avvio +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unità @UNIT@ ha terminato la fase di avvio. + +La fase di avvio è @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: L'unità @UNIT@ inizia la fase di spegnimento +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unità @UNIT@ ha iniziato la fase di spegnimento. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: L'unità @UNIT@ termina la fase di spegnimento +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unità @UNIT@ ha terminato la fase di spegnimento. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: L'unità @UNIT@ è fallita +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unità @UNIT@ è fallita. + +Il risultato è @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: L'unità @UNIT@ inizia a caricare la propria configurazione +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unità @UNIT@ è iniziata ricaricando la propria configurazione + +-- 7b05ebc668384222baa8881179cfda54 +Subject: L'unità @UNIT@ termina il caricamento della propria configurazione +Defined-By: systemd +Support: %SUPPORT_URL% + +L'unità @UNIT@ è terminata ricaricando la propria configurazione + +Il risultato è @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Il processo @EXECUTABLE@ non può essere eseguito +Defined-By: systemd +Support: %SUPPORT_URL% + +Il processo @EXECUTABLE@ non può essere eseguito e termina. + +Il numero di errore restituito durante l'esecuzione del processo è @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Uno o più messaggi non possono essere inoltrati a syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Uno o più messaggi non possono essere inviati al servizio syslog +eseguito in parallelo a journald. Questo di solito capita perché, +l'implementazione di syslog non sta al passo con la +velocità dei messaggi accodati. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Il punto di montaggio non è vuoto +Defined-By: systemd +Support: %SUPPORT_URL% + +La directory @WHERE@ è specificata come punto di montaggio (secondo campo +in /etc/fstab o nel campo Where= del file unità di systemd) e non è vuoto. +Questo non interferisce con il montaggio, ma i file pre-esistenti in questa +directory diventano inaccessibili. Per visualizzare i file, si suggerisce +di montare manualmente il file system indicato in una posizione secondaria. + +-- 24d8d4452573402496068381a6312df2 +Subject: Avviata macchina virtuale o container +Defined-By: systemd +Support: %SUPPORT_URL% + +La macchina virtuale @NAME@ con PID primario @LEADER@ è stata +avviata ed è pronta all'uso. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Terminata macchina virtuale o container +Defined-By: systemd +Support: %SUPPORT_URL% + +La macchina virtuale @NAME@ con PID primario @LEADER@ è stata spenta. diff --git a/src/grp-journal/systemd-journald/systemd.ko.catalog.in b/src/grp-journal/systemd-journald/systemd.ko.catalog.in new file mode 100644 index 0000000000..8a053254ee --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.ko.catalog.in @@ -0,0 +1,264 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Korean translation + +# The catalog format is documented on +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ +# +# Translator : +# Seong-ho Cho , 2015. + +-- f77379a8490b408bbe5f6940505a777b +Subject: 저널 시작 +Defined-By: systemd +Support: %SUPPORT_URL% + +시스템 저널 프로세스를 시작했고 기록목적으로 저널 파일을 열었으며, +프로세스 요청을 기다리고 있습니다. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: 저널 멈춤 +Defined-By: systemd +Support: %SUPPORT_URL% + +시스템 저널 프로세스를 껐고 현재 활성화 중인 저널 파일을 모두 +닫았습니다. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: 서비스의 메시지를 거절함 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +일정 시간동안 서비스에서 너무 많은 메시지를 기록했습니다. +서비스에서 오는 메시지를 거절했습니다. + +의문점이 있는 서비스로부터 오는 메시지만 거절했음을 참고하십시오 +다른 서비스의 메시지에는 영향을 주지 않습니다. + +메시지 거절 제어 제한 값은 /etc/systemd/journald.conf 의 +RateLimitIntervalSec= 변수와 RateLimitBurst= 변수로 설정합니다. +자세한 내용은 ournald.conf(5)를 살펴보십시오. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: 저널 메시지 놓침 +Defined-By: systemd +Support: %SUPPORT_URL% + +저널 시스템에서 커널 메시지를 충분히 빠르게 처리할 수 없어 커널 + 메시지를 잃었습니다. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: 프로세스 @COREDUMP_PID@번 코어 덤프(@COREDUMP_COMM@) 생성함 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +프로세스 @COREDUMP_PID@번 (@COREDUMP_COMM@)이 비정상적으로 끝나 +코어 덤프를 생성했습니다. + +보통 비정상 종료 관리 프로그램에서 프로그래밍 오류를 나타내며, +제작자에게 버그로 보고해야합니다. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: @USER_ID@ 사용자의 새 @SESSION_ID@ 세션 만듦 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +@USER_ID@ 사용자의 새 @SESSION_ID@ 세션을 만들었습니다. + +이 세션의 관리 프로세스는 @LEADER@ 입니다. + +-- 3354939424b4456d9802ca8333ed424a +Subject: @SESSION_ID@ 세션 마침 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +@SESSION_ID@ 세션을 끝냈습니다. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: 새 @SEAT_ID@ 시트 사용할 수 있음 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +새 @SEAT_ID@ 시트를 설정했고 사용할 수 있습니다. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: @SEAT_ID@ 시트 제거함 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +@SEAT_ID@ 시트를 제거했으며 더이상 사용할 수 없습니다. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: 시간 바꿈 +Defined-By: systemd +Support: %SUPPORT_URL% + +시스템 시계를 1970년 1월 1일 이후로 @REALTIME@ 마이크로초 지난 값으로 +설정했습니다. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: @TIMEZONE@ 시간대로 시간대 바꿈 +Defined-By: systemd +Support: %SUPPORT_URL% + +시스템 시간대를 @TIMEZONE@ 시간대로 바꾸었습니다. + +-- b07a249cd024414a82dd00cd181378ff +Subject: 시스템 시동 마침 +Defined-By: systemd +Support: %SUPPORT_URL% + +부팅 과정에 시작하려고 준비한 모든 시스템 서비스를 성공적으로 + 시작했습니다. 머신이 서비스처럼 대기중이라는 의미는 아니며 +지동을 완전히 마칠 때까지 사용중일 수도 있는 점 참고하십시오. + +커널 시동에 @KERNEL_USEC@ 마이크로초가 걸립니다. + +초기 램 디스크 시동에 @INITRD_USEC@ 마이크로초가 걸립니다. + +사용자 영역 시동에 @USERSPACE_USEC@ 마이크로초가 걸립니다. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: @SLEEP@ 대기 상태 진입 +Defined-By: systemd +Support: %SUPPORT_URL% + +@SLEEP@ 대기 상태로 진입했습니다. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: @SLEEP@ 대기 상태 마침 +Defined-By: systemd +Support: %SUPPORT_URL% + +@SLEEP@ 대기 상태를 마쳤습니다. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: 컴퓨터 끄기 시작 +Defined-By: systemd +Support: %SUPPORT_URL% + +컴퓨터 끄기 동작을 시작했습니다. 모든 시스템 동작을 멈추고 +모든 파일 시스템의 마운트를 해제합니다. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: @UNIT@ 유닛 시작 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 유닛을 시작했습니다. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: @UNIT@ 유닛 시동 마침 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 유닛 시동을 마쳤습니다. + +시동 결과는 @RESULT@ 입니다. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: @UNIT@ 유닛 끝내기 동작 시작 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 유닛 끝내기 동작을 시작했습니다. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: @UNIT@ 유닛 끝내기 동작 마침 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 유닛 끝내기 동작을 마쳤습니다. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: @UNIT@ 유닛 동작 실패 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 유닛 동작에 실패했습니다. + +결과는 @RESULT@ 입니다. + +-- d34d037fff1847e6ae669a370e694725 +Subject: @UNIT@ 유닛 설정 다시 읽기 시작 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 유닛의 설정 다시 읽기를 시작했습니다 + +-- 7b05ebc668384222baa8881179cfda54 +Subject: @UNIT@ 유닛 설정 다시 읽기 완료 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 유닛의 설정 다시 읽기 동작을 끝냈습니다. + +결과는 @RESULT@ 입니다. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: @EXECUTABLE@ 프로세스 시작할 수 없음 +Defined-By: systemd +Support: %SUPPORT_URL% + +@EXECUTABLE@ 프로세스를 시작할 수 없어 실행에 실패했습니다. + +이 프로세스에서 반환한 오류 번호는 @ERRNO@번 입니다. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: 하나 이상의 메시지를 syslog에 전달할 수 없음 +Defined-By: systemd +Support: %SUPPORT_URL% + +journald 서비스와 동시에 실행중인 syslog 서비스에 하나 이상의 메시지를 +전달할 수 없습니다. 보통 순차적으로 오는 메시지의 속도를 syslog 구현체가 +따라가지 못함을 의미합니다. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: 마운트 지점 비어있지 않음 +Defined-By: systemd +Support: %SUPPORT_URL% + +@WHERE@ 디렉터리를 마운트 지점으로 지정했으며 (/etc/fstab 파일의 + 두번째 필드 또는 systemd 유닛 파일의 Where= 필드) 비어있지 않습니다. +마운트 과정에 방해가 되진 않지만 이전에 이 디렉터리에 존재하는 파일에 + 접근할 수 없게 됩니다. 중복으로 마운트한 파일을 보려면, 근본 파일 +시스템의 다음 위치에 직접 마운트하십시오. + +-- 24d8d4452573402496068381a6312df2 +Subject: 가상 머신 또는 컨테이너 시작 +Defined-By: systemd +Support: %SUPPORT_URL% + +@LEADER@ 프로세스 ID로 동작하는 @NAME@ 가상 머신을 시작했으며, +이제부터 사용할 수 있습니다. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: 가상 머신 또는 컨테이너 마침 +Defined-By: systemd +Support: %SUPPORT_URL% + +@LEADER@ 프로세스 ID로 동작하는 @NAME@ 가상 머신을 껐습니다. diff --git a/src/grp-journal/systemd-journald/systemd.pl.catalog.in b/src/grp-journal/systemd-journald/systemd.pl.catalog.in new file mode 100644 index 0000000000..33c2122974 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.pl.catalog.in @@ -0,0 +1,315 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2014, 2015, 2016 Piotr Drąg +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Polish translation + +# The catalog format is documented on +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: Uruchomiono dziennik +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemowy proces dziennika został uruchomiony, otworzył pliki dziennika do +zapisu i jest gotowy do przetwarzania żądań. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Zatrzymano dziennik +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemowy proces dziennika został wyłączony i zamknął wszystkie obecnie +aktywne pliki dziennika. + +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: Miejsce na dysku używane przez dziennik +Defined-By: systemd +Support: %SUPPORT_URL% + +@JOURNAL_NAME@ (@JOURNAL_PATH@) obecnie używa @CURRENT_USE_PRETTY@. +Maksymalnie może używać @MAX_USE_PRETTY@. +Zostawianie co najmniej @DISK_KEEP_FREE_PRETTY@ wolnego (z obecnie dostępnego @DISK_AVAILABLE_PRETTY@ miejsca na dysku). +Wymuszone ograniczenie użycia wynosi więc @LIMIT_PRETTY@, z czego @AVAILABLE_PRETTY@ jest nadal dostępne. + +Ograniczenia kontrolujące ilość miejsca na dysku używanego przez dziennik +można konfigurować za pomocą ustawień SystemMaxUse=, SystemKeepFree=, +SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= +w pliku /etc/systemd/journald.conf. Strona journald.conf(5) zawiera więcej +informacji. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Ograniczono komunikaty z usługi +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Usługa zapisała za dużo komunikatów w określonym czasie. Komunikaty z usługi +zostały pominięte. + +Proszę zauważyć, że tylko komunikaty z danej usługi zostały pominięte. Nie ma +to wpływu na komunikaty innych usług. + +Ograniczenia kontrolujące pomijanie komunikatów mogą być konfigurowane +za pomocą opcji RateLimitIntervalSec= i RateLimitBurst= w pliku +/etc/systemd/journald.conf. Strona journald.conf(5) zawiera więcej informacji. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Utracono komunikaty dziennika +Defined-By: systemd +Support: %SUPPORT_URL% + +Komunikaty jądra zostały utracone, ponieważ system dziennika nie mógł +przetworzyć ich odpowiednio szybko. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Proces @COREDUMP_PID@ (@COREDUMP_COMM@) zrzucił plik core +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Proces @COREDUMP_PID@ (@COREDUMP_COMM@) uległ awarii i zrzucił plik core. + +Zwykle wskazuje to na błąd programistyczny w danym programie i powinno zostać +zgłoszone jego producentowi jako błąd. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Utworzono nową sesję @SESSION_ID@ dla użytkownika @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Nowa sesja o identyfikatorze @SESSION_ID@ została utworzona dla użytkownika +@USER_ID@. + +Proces prowadzący sesji: @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Zakończono sesję @SESSION_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Sesja o identyfikatorze @SESSION_ID@ została zakończona. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Dostępne jest nowe stanowisko @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Nowe stanowisko @SEAT_ID@ zostało skonfigurowane i jest teraz dostępne. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Usunięto stanowisko @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Stanowisko @SEAT_ID@ zostało usunięte i nie jest już dostępne. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Zmiana czasu +Defined-By: systemd +Support: %SUPPORT_URL% + +Zegar systemowy został zmieniony na @REALTIME@ μs po 1 stycznia 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Zmiana strefy czasowej na @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemowa strefa czasowa została zmieniona na @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Ukończono uruchamianie systemu +Defined-By: systemd +Support: %SUPPORT_URL% + +Wszystkie usługi systemowe obowiązkowo zakolejkowane do włączenia podczas +uruchamiania systemu zostały pomyślnie uruchomione. Proszę zauważyć, że nie +oznacza to, że komputer jest bezczynny, jako że usługi mogą wciąż kończyć +proces uruchamiania. + +Uruchamianie jądra zajęło @KERNEL_USEC@ μs. + +Uruchamianie początkowego dysku RAM zajęło @INITRD_USEC@ μs. + +Uruchamianie przestrzeni użytkownika zajęło @USERSPACE_USEC@ μs. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Przejście do stanu uśpienia @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +System przeszedł do stanu uśpienia @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Wyjście ze stanu uśpienia @SLEEP@ +Defined-By: systemd +Support: %SUPPORT_URL% + +System wyszedł ze stanu uśpienia @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Zainicjowano wyłączenie systemu +Defined-By: systemd +Support: %SUPPORT_URL% + +Zainicjowano wyłączenie systemd. Wyłączenie zostało rozpoczęte i wszystkie +usługi systemowe zostały zakończone, a wszystkie systemy plików odmontowane. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Rozpoczęto uruchamianie jednostki @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Jednostka @UNIT@ rozpoczęła uruchamianie. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Ukończono uruchamianie jednostki @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Jednostka @UNIT@ ukończyła uruchamianie. + +Wynik uruchamiania: @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Rozpoczęto wyłączanie jednostki @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Jednostka @UNIT@ rozpoczęła wyłączanie. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Ukończono wyłączanie jednostki @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Jednostka @UNIT@ ukończyła wyłączanie. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Jednostka @UNIT@ się nie powiodła +Defined-By: systemd +Support: %SUPPORT_URL% + +Jednostka @UNIT@ się nie powiodła. + +Wynik: @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Rozpoczęto ponowne wczytywanie konfiguracji jednostki @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Jednostka @UNIT@ rozpoczęła ponowne wczytywanie swojej konfiguracji. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Ukończono ponowne wczytywanie konfiguracji jednostki @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Jednostka @UNIT@ ukończyła ponowne wczytywanie swojej konfiguracji. + +Wynik: @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Nie można wykonać procesu @EXECUTABLE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Proces @EXECUTABLE@ nie mógł zostać wykonany i się nie powiódł. + +Numer błędu zwrócony przez ten proces: @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Nie można przekazać jednego lub więcej komunikatów do syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Jeden lub więcej komunikatów nie może zostać przekazanych do usługi syslog +uruchomionej obok journald. Zwykle oznacza to, że implementacja syslog nie +jest w stanie nadążyć za prędkością kolejki komunikatów. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Punkt montowania nie jest pusty +Defined-By: systemd +Support: %SUPPORT_URL% + +Katalog @WHERE@ został podany jako punkt montowania (drugie pole w pliku +/etc/fstab lub pole Where= w pliku jednostki systemd) i nie jest pusty. Nie +wpływa to na montowanie, ale wcześniej istniejące pliki w tym katalogu stają +się niedostępne. Aby zobaczyć te pliki, proszę ręcznie zamontować system +plików w innym położeniu. + +-- 24d8d4452573402496068381a6312df2 +Subject: Uruchomiono maszynę wirtualną lub kontener +Defined-By: systemd +Support: %SUPPORT_URL% + +Maszyna wirtualna @NAME@ (PID prowadzący @LEADER@) została uruchomiona i jest +gotowa do użycia. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Zakończono maszynę wirtualną lub kontener +Defined-By: systemd +Support: %SUPPORT_URL% + +Maszyna wirtualna @NAME@ (PID prowadzący @LEADER@) została wyłączona. + +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: Wyłączono tryb DNSSEC, ponieważ serwer go nie obsługuje +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +Usługa resolver (systemd-resolved.service) wykryła, że skonfigurowany serwer +DNS nie obsługuje DNSSEC, w wyniku czego walidacja DNSSEC została wyłączona. + +To zdarzenie będzie miało miejsce, jeśli skonfigurowano DNSSEC=allow-downgrade +w pliku resolved.conf, a skonfigurowany serwer DNS jest niezgodny z DNSSEC. +Proszę zauważyć, że używanie tego trybu umożliwia ataki wyłączające DNSSEC, +ponieważ atakujący będzie mógł wyłączyć walidację DNSSEC na komputerze przez +umieszczenie odpowiednich odpowiedzi DNS w kanale komunikacji. + +To zdarzenie może wskazywać, że serwer DNS jest faktycznie niezgodny z DNSSEC, +albo że atakującemu udało się upozorować atak tego typu. + +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: Walidacja DNSSEC się nie powiodła +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Zapytanie DNS lub ustawiony wpis zasobu nie przeszedł walidacji DNSSEC. +Zwykle wskazuje to, że ktoś manipulował używanym kanałem komunikacji. + +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: Unieważniono kotwicę zaufania DNSSEC +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Kotwica zaufania DNSSEC została unieważniona. Należy skonfigurować nową, albo +system operacyjny musi zostać zaktualizowany, aby dostarczyć zaktualizowaną +kotwicę zaufania DNSSEC. diff --git a/src/grp-journal/systemd-journald/systemd.pt_BR.catalog.in b/src/grp-journal/systemd-journald/systemd.pt_BR.catalog.in new file mode 100644 index 0000000000..e461c2b2ba --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.pt_BR.catalog.in @@ -0,0 +1,264 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2015 Rafael Ferreira (translation) +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Catálogo de mensagens para as mensagens do próprio systemd + +# O formato do catálogo está documentado em +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# Para uma explicação do porquê de fazermos tudo isso, veja +# https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: O jornal foi inciado +Defined-By: systemd +Support: %SUPPORT_URL% + +O processo jornal do sistema foi iniciado, arquivos foram abertos e está +pronto para processar requisições. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: O jornal foi interrompido +Defined-By: systemd +Support: %SUPPORT_URL% + +O processo do jornal do sistema foi desligado e todos os arquivos de jornal +do sistema foram fechados. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Mensagens de um serviço foram suprimidas +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Um serviço registrou no log um número excessivo de mensagens dentro de um +período de tempo. Mensagens do serviço foram descartadas. + +Note que apenas mensagens de um serviço em questão foram descartadas; outras +mensagens dos serviços não foram afetadas. + +Os controles de limites de quando as mensagens são descartadas pode ser +configurado com RateLimitIntervalSec= e RateLimitBurst= no +/etc/systemd/journald.conf. Veja journald.conf(5) para detalhes. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Mensagens do jornal foram perdidas +Defined-By: systemd +Support: %SUPPORT_URL% + +Mensagens do kernel foram perdidas pois o sistema do jornal não pôde +processá-las em velocidade suficiente para a demanda. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Processo @COREDUMP_PID@ (@COREDUMP_COMM@) despejou núcleo +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Processo @COREDUMP_PID@ (@COREDUMP_COMM@) travou e despejou o núcleo. + +Isso normalmente indica um erro de programação no programa que travou e +deveria ser relatado para seu fabricante como um erro. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: A nova sessão @SESSION_ID@ foi criada para usuário o @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Uma nova sessão com o ID @SESSION_ID@ foi criada para o usuário @USER_ID@. + +O processo originador da sessão é @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Sessão @SESSION_ID@ foi terminada +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Um sessão com o ID @SESSION_ID@ foi terminada. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Um novo seat @SEAT_ID@ está disponível +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Um novo seat @SEAT_ID@ foi configurado e está disponível. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Seat @SEAT_ID@ foi removido agora +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Um seat @SEAT_ID@ foi removido e não está mais disponível. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Time change +Defined-By: systemd +Support: %SUPPORT_URL% + +O relógio do sistema foi alterado para @REALTIME@ microssegundos após 1º de +janeiro de 1970. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Fuso horário alterado para @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +O fuso horário do sistema foi alterado para @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Inicialização do sistema foi concluída +Defined-By: systemd +Support: %SUPPORT_URL% + +Todos os serviços do sistema necessários que estão enfileirados para +executar na inicialização do sistema, foram iniciados com sucesso. Note +que isso não significa que a máquina está ociosa, pois os serviços podem +ainda estar ocupados com a inicialização completa. + +Inicialização do kernel precisou @KERNEL_USEC@ microssegundos. + +Disco de RAM inicial precisou de @INITRD_USEC@ microssegundos. + +Inicialização do espaço do usuário precisou de @USERSPACE_USEC@ microssegundos. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Estado de suspensão do sistema @SLEEP@ iniciado +Defined-By: systemd +Support: %SUPPORT_URL% + +O sistema entrou agora no estado de suspensão @SLEEP@. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Estado de suspensão do sistema @SLEEP@ finalizado +Defined-By: systemd +Support: %SUPPORT_URL% + +O sistema saiu agora do estado de suspensão @SLEEP@. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Desligamento do sistema iniciado +Defined-By: systemd +Support: %SUPPORT_URL% + +Desligamento do sistema foi inicializado. O desligamento se iniciou e todos +os serviços do sistema foram terminados e todos os sistemas desmontados. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Unidade @UNIT@ sendo iniciado +Defined-By: systemd +Support: %SUPPORT_URL% + +A unidade @UNIT@ está sendo iniciada. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Unidade @UNIT@ concluiu a inicialização +Defined-By: systemd +Support: %SUPPORT_URL% + +A unidade @UNIT@ concluiu a inicialização. + +The start-up result is @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Unidade @UNIT@ sendo desligado +Defined-By: systemd +Support: %SUPPORT_URL% + +A unidade @UNIT@ está sendo desligada. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: A unidade @UNIT@ concluiu o desligamento +Defined-By: systemd +Support: %SUPPORT_URL% + +A unidade @UNIT@ concluiu o desligamento. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: A unidade @UNIT@ falhou +Defined-By: systemd +Support: %SUPPORT_URL% + +A unidade @UNIT@ falhou. + +O resultado é @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Unidade @UNIT@ iniciou recarregamento de sua configuração +Defined-By: systemd +Support: %SUPPORT_URL% + +A unidade @UNIT@ iniciou o recarregamento de sua configuração. + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Unidade @UNIT@ concluiu recarregamento de sua configuração +Defined-By: systemd +Support: %SUPPORT_URL% + +A unidade @UNIT@ concluiu o recarregamento de sua configuração. + +O resultado é @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Processo @EXECUTABLE@ não pôde ser executado +Defined-By: systemd +Support: %SUPPORT_URL% + +O processo @EXECUTABLE@ não pôde ser executado e falhou. + +O número de erro retornado por este processo é @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Uma ou mais mensagens não puderam ser encaminhadas para o syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Uma ou mais mensagens não puderam ser encaminhadas para o serviço do syslog +em execução paralela ao journald. Isso normalmente indica que a implementação +do syslog não foi capaz de se manter com a velocidade das mensagens +enfileiradas. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Ponto de montagem não está vazio +Defined-By: systemd +Support: %SUPPORT_URL% + +O diretório @WHERE@ está especificado como ponto de montagem (o segundo campo +no /etc/fstab ou campo Where= no arquivo de unidade do systemd) e não está +vazio. Isso não interfere com a montagem, mas os arquivos pré-existentes +neste diretório se tornaram inacessívels. Para ver aqueles arquivos, sobre os +quais foi realizada a montagem, por favor monte manualmente o sistema de +arquivos subjacente para uma localização secundária. + +-- 24d8d4452573402496068381a6312df2 +Subject: Uma máquina virtual ou contêiner foi iniciado +Defined-By: systemd +Support: %SUPPORT_URL% + +A máquina virtual @NAME@ com seu PID @LEADER@ incial foi iniciada e está +pronto para ser usad. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Uma máquina virtual ou contêiner foi terminado +Defined-By: systemd +Support: %SUPPORT_URL% + +A máquina virtual @NAME@ com seu PID @LEADER@ incial foi desligada. diff --git a/src/grp-journal/systemd-journald/systemd.ru.catalog.in b/src/grp-journal/systemd-journald/systemd.ru.catalog.in new file mode 100644 index 0000000000..df55478592 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.ru.catalog.in @@ -0,0 +1,354 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2013-2016 Sergey Ptashnick +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Russian translation + +# Формат каталога сообщений описан по ссылке +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# Перед каждым элементом в комментарии указан Subject исходного +# сообщения (на английском). + +# Subject: The Journal has been started +-- f77379a8490b408bbe5f6940505a777b +Subject: Запущена служба журналирования +Defined-By: systemd +Support: %SUPPORT_URL% + +Процесс, отвечающий за журналирование системных событий, успешно запустился, +открыл для записи файлы журнала, и готов обрабатывать запросы. + +# Subject: The Journal has been stopped +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Служба журналирования остановлена +Defined-By: systemd +Support: %SUPPORT_URL% + +Процесс, отвечающий за журналирование системных событий, завершил работу и +закрыл все свои файлы. + +# Subject: Disk space used by the journal +-- ec387f577b844b8fa948f33cad9a75e6 +Subject: Место на диске, занятое журналом +Defined-By: systemd +Support: %SUPPORT_URL% + +@JOURNAL_NAME@ (@JOURNAL_PATH@) сейчас занимает @CURRENT_USE_PRETTY@. +Максимальный разрешенный размер составляет @MAX_USE_PRETTY@. +Оставляем свободными как минимум @DISK_KEEP_FREE_PRETTY@ (сейчас на диске +свободно @DISK_AVAILABLE_PRETTY@). +Таким образом, предел использования составляет @LIMIT_PRETTY@, из которых +@AVAILABLE_PRETTY@ пока свободно. + +Ограничения на размер журнала настраиваются при помощи параметров +SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, +RuntimeKeepFree=, RuntimeMaxFileSize= в файле /etc/systemd/journald.conf. +Более подробные сведения вы можете получить на справочной странице +journald.conf(5). + +# Subject: Messages from a service have been suppressed +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Часть сообщений от службы пропущена +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Служба отправила слишком много сообщений за короткий промежуток времени. +Часть сообщений была пропущена. + +Обратите внимание, что были пропущены сообщения только от этой службы, +сообщения других служб не затронуты. + +Предел, после которого служба журнала начинает игнорировать сообщения, +настраивается параметрами RateLimitIntervalSec= и RateLimitBurst= в файле +/etc/systemd/journald.conf. Подробности смотрите на странице руководства +journald.conf(5). + +# Subject: Journal messages have been missed +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Часть сообщений ядра пропущена +Defined-By: systemd +Support: %SUPPORT_URL% + +Часть сообщений, поступивших от ядра, была потеряна, так как служба +журналирования не успела их обработать. + +# Subject: Process @COREDUMP_PID@ (@COREDUMP_COMM@) dumped core +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Процесс @COREDUMP_PID@ (@COREDUMP_COMM@) сбросил дамп памяти +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Процесс @COREDUMP_PID@ (@COREDUMP_COMM@) завершился из-за критической ошибки. +Записан дамп памяти. + +Вероятно, это произошло из-за ошибки, допущенной в коде программы. +Рекомендуется сообщить её разработчикам о возникшей проблеме. + +# Subject: A new session @SESSION_ID@ has been created for user @USER_ID@ +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Для пользователя @USER_ID@ создан новый сеанс @SESSION_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Для пользователя @USER_ID@ создан новый сеанс с идентификатором @SESSION_ID@. + +Главный процесс нового сеанса имеет индентификатор @LEADER@. + +# Subject: A session @SESSION_ID@ has been terminated +-- 3354939424b4456d9802ca8333ed424a +Subject: Сеанс @SESSION_ID@ завершен +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Сеанс с идентификатором @SESSION_ID@ завершился. + +# Subject: A new seat @SEAT_ID@ is now available +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Добавлено новое рабочее место @SEAT_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Новое рабочее место (seat) @SEAT_ID@ полностью настроено и готово к +использованию. + +# Subject: A seat @SEAT_ID@ has now been removed +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Рабочее место @SEAT_ID@ отключено +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Рабочее место (seat) @SEAT_ID@ было отключено. + +# Subject: Time change +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Переведены системные часы +Defined-By: systemd +Support: %SUPPORT_URL% + +Системные часы были переведены. Сейчас они показывают @REALTIME@ микросекунд +с момента 00:00:00 1 января 1970 года. + +# Subject: Time zone change to @TIMEZONE@ +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Часовой пояс изменен на @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Системный часовой пояс был изменен. Новое значение: @TIMEZONE@. + +# Subject: System start-up is now complete +-- b07a249cd024414a82dd00cd181378ff +Subject: Запуск системы завершен +Defined-By: systemd +Support: %SUPPORT_URL% + +Все системные службы, запуск которых предписан настройками, были запущены. +Впрочем, это ещё не означает, что система в данный момент ничем не занята, +так как некоторые службы могут продолжать инициализацию даже после того, как +отчитались о своем запуске. + +Запуск ядра занял @KERNEL_USEC@ микросекунд. + +Процессы начального RAM-диска (initrd) отработали за @INITRD_USEC@ микросекунд. + +Запуск системных служб занял @USERSPACE_USEC@ микросекунд. + +# Subject: System sleep state @SLEEP@ entered +-- 6bbd95ee977941e497c48be27c254128 +Subject: Система перешла в состояние сна (@SLEEP@) +Defined-By: systemd +Support: %SUPPORT_URL% + +Система была переведена в состояние сна (@SLEEP@). + +# Subject: System sleep state @SLEEP@ left +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Система вышла из состояния сна (@SLEEP@) +Defined-By: systemd +Support: %SUPPORT_URL% + +Система была выведена из состояния сна (@SLEEP@). + +# Subject: System shutdown initiated +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Подготовка системы к выключению +Defined-By: systemd +Support: %SUPPORT_URL% + +Начат процесс подготовки к выключению компьютера. Останавливаются все системные +службы, отмонтируются все файловые системы. + +# Subject: Unit @UNIT@ has begun with start-up +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Начинается запуск юнита @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Начат процесс запуска юнита @UNIT@. + +# Subject: Unit @UNIT@ has finished start-up +-- 39f53479d3a045ac8e11786248231fbf +Subject: Запуск юнита @UNIT@ завершен +Defined-By: systemd +Support: %SUPPORT_URL% + +Процесс запуска юнита @UNIT@ был завершен. + +Результат: @RESULT@. + +# Subject: Unit @UNIT@ has begun shutting down +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Начинается остановка юнита @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Начат процесс остановки юнита @UNIT@. + +# Subject: Unit @UNIT@ has finished shutting down +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Завершена остановка юнита @UNIT@. +Defined-By: systemd +Support: %SUPPORT_URL% + +Процесс остановки юнита @UNIT@ был завершен. + +# Subject: Unit @UNIT@ has failed +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Ошибка юнита @UNIT@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Произошел сбой юнита @UNIT@. + +Результат: @RESULT@. + +# Subject: Unit @UNIT@ has begun with reloading its configuration +-- d34d037fff1847e6ae669a370e694725 +Subject: Юнит @UNIT@ начал перечитывать свои настройки +Defined-By: systemd +Support: %SUPPORT_URL% + +Юнит @UNIT@ начал процесс перечитывания своей конфигурации. + +# Subject: Unit @UNIT@ has finished reloading its configuration +-- 7b05ebc668384222baa8881179cfda54 +Subject: Юнит @UNIT@ завершил перечитывание своих настроек +Defined-By: systemd +Support: %SUPPORT_URL% + +Юнит @UNIT@ завершил процесс перечитывания своей конфигурации. + +Результат: @RESULT@. + +# Subject: Process @EXECUTABLE@ could not be executed +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Не удалось запустить процесс @EXECUTABLE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Сбой: не удалось запустить процесс @EXECUTABLE@. + +Код ошибки: @ERRNO@. + +# Subject: One or more messages could not be forwarded to syslog +-- 0027229ca0644181a76c4e92458afa2e +Subject: Часть сообщений не удалось передать процессу syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +Не удалось передать некоторые сообщения демону системного лога (syslog), +дублирующему работу службы системного журнала. Скорее всего, причина в том, что +используемая реализация syslog не успевает обрабатывать сообщения с достаточной +скоростью. + +# Subject: Mount point is not empty +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Каталог, являющийся точкой монтирования, не пуст +Defined-By: systemd +Support: %SUPPORT_URL% + +Каталог @WHERE@, который был указан в качестве точки монтирования (во втором +столбце файла /etc/fstab, либо в параметре Where= файла конфигурации юнита), +не является пустым. Это никак не мешает монтированию, однако ранее находившиеся +в нем файлы будут недоступны. Чтобы получить к ним доступ, вы можете вручную +перемонтировать эту файловую систему в другую точку. + +# Subject: A virtual machine or container has been started +-- 24d8d4452573402496068381a6312df2 +Subject: Запущена виртуальная машина/контейнер +Defined-By: systemd +Support: %SUPPORT_URL% + +Виртуальная машина @NAME@ (идентификатор главного процесса: @LEADER@) запущена и +готова к работе. + +# Subject: A virtual machine or container has been terminated +-- 58432bd3bace477cb514b56381b8a758 +Subject: Остановлена виртуальная машина/контейнер +Defined-By: systemd +Support: %SUPPORT_URL% + +Виртуальная машина @NAME@ (идентификатор главного процесса: @LEADER@) выключена. + +# Subject: DNSSEC mode has been turned off, as server doesn't support it +-- 36db2dfa5a9045e1bd4af5f93e1cf057 +Subject: Механизм DNSSEC был отключен, так как DNS-сервер его не поддерживает +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) resolved.conf(5) + +Служба разрешения имен хостов (systemd-resolved.service) определила, что +указанный в настойках DNS-сервер не поддерживает технологию DNSSEC, и +автоматически отключила DNSSEC-проверки. + +Данное событие возникает, если в файле resolved.conf указан параметр +DNSSEC=allow-downgrade, и вышестоящий DNS-сервер не поддерживает DNSSEC. +Обратите внимание, что режим allow-downgrade допускает возможность атаки +"DNSSEC downgrade", в ходе которой атакующий хакер блокирует проверки DNSSEC +путем отправки ложных сообщений от имени DNS-сервера. + +Возникновение данного события может свидетельствовать как о том, что ваш +DNS-сервер не поддерживает DNSSEC, так и о том, что некий хакер успешно провел +против вас атаку, направленную на блокировку DNSSEC-проверок. + +# Subject: DNSSEC validation failed +-- 1675d7f172174098b1108bf8c7dc8f5d +Subject: Проверка DNSSEC провалена +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +DNS-запрос или отдельная ресурсная запись не прошла проверку DNSSEC. +Как правило, это свидетельствует о постороннем вмешательстве в канал связи. + +# Subject: A DNSSEC trust anchor has been revoked +-- 4d4408cfd0d144859184d1e65d7c8a65 +Subject: Открытый ключ DNSSEC был отозван +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:systemd-resolved.service(8) + +Открытый ключ (trust ahcnor) DNSSEC был отозван. Необходимо настроить новый +открытый ключ, либо обновить систему, чтобы получить обновленный открытый ключ. diff --git a/src/grp-journal/systemd-journald/systemd.sr.catalog.in b/src/grp-journal/systemd-journald/systemd.sr.catalog.in new file mode 100644 index 0000000000..06a0ff648c --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.sr.catalog.in @@ -0,0 +1,262 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Serbian translation + +# Формат каталога је документован на +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# Да бисте видели зашто ово радимо, погледајте https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: Журнал је покренут +Defined-By: systemd +Support: %SUPPORT_URL% + +Системски журналски процес се покренуо, отворио журналске +датотеке за упис и спреман је за обраду захтева. + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: Журнал је заустављен +Defined-By: systemd +Support: %SUPPORT_URL% + +Системски журналски процес се зауставио и затворио све тренутно +отворене журналске датотеке. + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: Поруке од услуге су утишане +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +Услуга је уписала сувише порука за једно време. Поруке +од услуге су одбачене. + +Знајте да су само поруке од ове услуге одбачене, друге +услуге нису захваћене овим. + +Ограничења која подешавају начин на који се поруке одбацују се могу подесити +помоћу „RateLimitIntervalSec=“ и „RateLimitBurst=“ параметара унутар датотеке +/etc/systemd/journald.conf. Погледајте journald.conf(5) за појединости. + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: Журналске поруке су изгубљене +Defined-By: systemd +Support: %SUPPORT_URL% + +Поруке кернела су изгубљене јер журналски систем није могао да их +обради довољно брзо. + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: Процес @COREDUMP_PID@ (@COREDUMP_COMM@) је избацио своје језгро +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +Процес @COREDUMP_PID@ (@COREDUMP_COMM@) је пао и избацио своје језгро. + +Ово обично значи да постоји грешка у програму који је пао и ова +грешка треба да се пријави продавцу. + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: Нова сесија @SESSION_ID@ је направљена за корисника @USER_ID@ +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Нова сесија са ИБ-ом @SESSION_ID@ је направљена за корисника @USER_ID@. + +Водећи процес сесије је @LEADER@. + +-- 3354939424b4456d9802ca8333ed424a +Subject: Сесија @SESSION_ID@ је окончана +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Сесија са ИБ-ом @SESSION_ID@ је окончана. + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: Ново седиште @SEAT_ID@ је сада доступно +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Ново седиште @SEAT_ID@ је исподешавано и сада је доступно. + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: Седиште @SEAT_ID@ је сада уклоњено +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +Седиште @SEAT_ID@ је сада уклоњено и више није доступно. + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: Време је промењено +Defined-By: systemd +Support: %SUPPORT_URL% + +Системски сат је сада подешен на @REALTIME@ микросекунде након 1. јануара 1970. године. + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: Временска зона је промењена на @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +Временска зона је промењена на @TIMEZONE@. + +-- b07a249cd024414a82dd00cd181378ff +Subject: Подизање система је сада готово +Defined-By: systemd +Support: %SUPPORT_URL% + +Све системске услуге које су заказане за подизање су успешно покренуте. +Знајте да ово не значи да је машина сада беспослена јер услуге могу +и даље бити заузете завршавањем покретања система. + +Подизање кернела је трајало @KERNEL_USEC@ микросекунде. + +Подизање почетног РАМ диска је трајало @INITRD_USEC@ микросекунде. + +Подизање корисничких програма је трајало @USERSPACE_USEC@ микросекунде. + +-- 6bbd95ee977941e497c48be27c254128 +Subject: Системско стање спавања @SLEEP@ започето +Defined-By: systemd +Support: %SUPPORT_URL% + +Систем је сада ушао у @SLEEP@ стање спавања. + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: Системско стање спавања @SLEEP@ напуштено +Defined-By: systemd +Support: %SUPPORT_URL% + +Систем је изашао из @SLEEP@ стања спавања. + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: Гашење система започето +Defined-By: systemd +Support: %SUPPORT_URL% + +Систем-де гашење је започето. Гашење је сада почело и све +системске услуге су окончане и сви системи датотека откачени. + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: Јединица @UNIT@ је почела са покретањем +Defined-By: systemd +Support: %SUPPORT_URL% + +Јединица @UNIT@ је почела са покретањем. + +-- 39f53479d3a045ac8e11786248231fbf +Subject: Јединица @UNIT@ је завршила са покретањем +Defined-By: systemd +Support: %SUPPORT_URL% + +Јединица @UNIT@ је завршила са покретањем. + +Исход покретања је @RESULT@. + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: Јединица @UNIT@ је почела са гашењем +Defined-By: systemd +Support: %SUPPORT_URL% + +Јединица @UNIT@ је почела са гашењем. + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: Јединица @UNIT@ је завршила са гашењем +Defined-By: systemd +Support: %SUPPORT_URL% + +Јединица @UNIT@ је завршила са гашењем. + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: Јединица @UNIT@ је пукла +Defined-By: systemd +Support: %SUPPORT_URL% + +Јединица @UNIT@ је пукла. + +Исход је @RESULT@. + +-- d34d037fff1847e6ae669a370e694725 +Subject: Јединица @UNIT@ је почела са поновним учитавањем свог подешавања +Defined-By: systemd +Support: %SUPPORT_URL% + +Јединица @UNIT@ је почела са поновним учитавањем свог подешавања + +-- 7b05ebc668384222baa8881179cfda54 +Subject: Јединица @UNIT@ је завршила са поновним учитавањем свог подешавања +Defined-By: systemd +Support: %SUPPORT_URL% + +Јединица @UNIT@ је завршила са поновним учитавањем свог подешавања + +Исход је @RESULT@. + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: Процес @EXECUTABLE@ није могао бити извршен +Defined-By: systemd +Support: %SUPPORT_URL% + +Процес @EXECUTABLE@ није могао бити извршен и пукао је. + +Овај процес је вратио број грешке @ERRNO@. + +-- 0027229ca0644181a76c4e92458afa2e +Subject: Једна или више порука није могло бити прослеђено системском записнику +Defined-By: systemd +Support: %SUPPORT_URL% + +Једна или више порука није могло бити прослеђено „syslog“ услузи +која ради упоредно са журнал-деом. Ово обично значи да спроведена +„syslog“ услуга није могла да издржи брзину свих надолазећих +порука у реду. + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: Тачка качења није празна +Defined-By: systemd +Support: %SUPPORT_URL% + +Директоријум @WHERE@ је наведен као тачка качења (друго поље у +/etc/fstab датотеци или у „Where=“ пољу систем-де јединичне датотеке) +и он није празан. Ово не утиче на качење али ће већ постојеће датотеке у +овом директоријуму постати недоступне. Да бисте видели ове недоступне +датотеке, ручно прикачите основни систем датотека у другу +путању. + +-- 24d8d4452573402496068381a6312df2 +Subject: Виртуелна машина или контејнер је покренут(а) +Defined-By: systemd +Support: %SUPPORT_URL% + +Виртуелна машина @NAME@ са водећим ПИБ-ом @LEADER@ је +покренута и сада је спремна за коришћење. + +-- 58432bd3bace477cb514b56381b8a758 +Subject: Виртуелна машина или контејнер је окончан(а) +Defined-By: systemd +Support: %SUPPORT_URL% + +Виртуелна машина @NAME@ са водећим ПИБ-ом @LEADER@ је +угашена. diff --git a/src/grp-journal/systemd-journald/systemd.zh_CN.catalog.in b/src/grp-journal/systemd-journald/systemd.zh_CN.catalog.in new file mode 100644 index 0000000000..ba7c697c16 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.zh_CN.catalog.in @@ -0,0 +1,253 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2015 Boyuan Yang +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Simplified Chinese translation + +# 本 catalog 文档格式被记载在 +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# 如需了解我们为什么做这些工作,请见 https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: 日志已开始 +Defined-By: systemd +Support: %SUPPORT_URL% + +系统日志进程已启动,已打开供写入的日志文件并准备好处理请求。 + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: 日志已停止 +Defined-By: systemd +Support: %SUPPORT_URL% + +系统日志进程已终止,并已关闭所有当前活动的日志文件。 + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: 由某个服务而来的消息已被抑制 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +某个服务在一个时间周期内记录了太多消息。 +从该服务而来的消息已被丢弃。 + +请注意只有由有问题的服务传来的消息被丢弃, +其它服务的消息不受影响。 + +可以在 /etc/systemd/journald.conf 中设定 RateLimitIntervalSec= +以及 RateLimitBurst = 的值以控制丢弃信息的限制。 +请参见 journald.conf(5) 以了解详情。 + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: 日志消息已遗失 +Defined-By: systemd +Support: %SUPPORT_URL% + +因日志系统对内核消息的处理速度不够快, +部分信息已经遗失。 + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: 进程 @COREDUMP_PID@ (@COREDUMP_COMM@) 核心已转储 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +进程 @COREDUMP_PID@ (@COREDUMP_COMM@) 已崩溃并进行核心转储。 + +这通常意味着崩溃程序中存在编程错误,并应当将此错误向其开发者报告。 + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: 一个新会话 @SESSION_ID@ 已为用户 @USER_ID@ 建立 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +一个 ID 为 @SESSION_ID@ 的新会话已为用户 @USER_ID@ 建立。 + +该会话的首进程为 @LEADER@。 + +-- 3354939424b4456d9802ca8333ed424a +Subject: 会话 @SESSION_ID@ 已终止 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +一个 ID 为 @SESSION_ID@ 的会话已终止。 + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: 一个新的座位 @SEAT_ID@ 可用 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +一个新的座位 @SEAT_ID@ 已被配置并已可用。 + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: 座位 @SEAT_ID@ 已被移除 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +座位 @SEAT_ID@ 已被移除并不再可用。 + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: 时间已变更 +Defined-By: systemd +Support: %SUPPORT_URL% + +系统时钟已变更为1970年1月1日后 @REALTIME@ 微秒。 + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: 时区变更为 @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +系统时区已变更为 @TIMEZONE@。 + +-- b07a249cd024414a82dd00cd181378ff +Subject: 系统启动已完成 +Defined-By: systemd +Support: %SUPPORT_URL% + +所有系统启动时需要的系统服务均已成功启动。 +请注意这并不代表现在机器已经空闲,因为某些服务可能仍处于完成启动的过程中。 + +内核启动使用了 @KERNEL_USEC@ 毫秒。 + +初始内存盘启动使用了 @INITRD_USEC@ 毫秒。 + +用户空间启动使用了 @USERSPACE_USEC@ 毫秒。 + +-- 6bbd95ee977941e497c48be27c254128 +Subject: 系统已进入 @SLEEP@ 睡眠状态 +Defined-By: systemd +Support: http://lists.freedesktop.org/mailman/listinfo/systemd-deve + +系统现已进入 @SLEEP@ 睡眠状态。 + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: 系统已离开 @SLEEP@ 睡眠状态 +Defined-By: systemd +Support: %SUPPORT_URL% + +系统现已离开 @SLEEP@ 睡眠状态。 + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: 系统关机已开始 +Defined-By: systemd +Support: %SUPPORT_URL% + +系统关机操作已初始化。 +关机已开始,所有系统服务均已结束,所有文件系统已卸载。 + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: @UNIT@ 单元已开始启动 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 单元已开始启动。 + +-- 39f53479d3a045ac8e11786248231fbf +Subject: @UNIT@ 单元已结束启动 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 单元已结束启动。 + +启动结果为“@RESULT@”。 + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: @UNIT@ 单元已开始停止操作 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 单元已开始停止操作。 + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: @UNIT@ 单元已结束停止操作 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 单元已结束停止操作。 + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: @UNIT@ 单元已失败 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 单元已失败。 + +结果为“@RESULT@”。 + +-- d34d037fff1847e6ae669a370e694725 +Subject: @UNIT@ 单元已开始重新载入其配置 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 单元已开始重新载入其配置。 + +-- 7b05ebc668384222baa8881179cfda54 +Subject: @UNIT@ 单元已结束配置重载入 +Defined-By: systemd +Support: %SUPPORT_URL% + +@UNIT@ 单元已结束配置重载入操作。 + +结果为“@RESULT@”。 + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: 进程 @EXECUTABLE@ 无法执行 +Defined-By: systemd +Support: %SUPPORT_URL% + +进程 @EXECUTABLE@ 无法被执行并已失败。 + +该进程返回的错误代码为 @ERRNO@。 + +-- 0027229ca0644181a76c4e92458afa2e +Subject: 一个或更多消息无法被转发至 syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +有一条或更多的消息无法被转发至与 journald 同时运行的 syslog 服务。 +这通常意味着 syslog 实现无法跟上队列中消息进入的速度。 + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: 挂载点不为空 +Defined-By: systemd +Support: %SUPPORT_URL% + +目录 @WHERE@ 被指定为挂载点(即 /etc/fstab 文件的第二栏,或 systemd 单元 +文件的 Where= 字段),且该目录非空。 +这并不会影响挂载行为,但该目录中先前已存在的文件将无法被访问。 +如需查看这些文件,请手动将其下的文件系统挂载到另一个位置。 + +-- 24d8d4452573402496068381a6312df2 +Subject: 一个虚拟机或容器已启动 +Defined-By: systemd +Support: %SUPPORT_URL% + +虚拟机 @NAME@,以及其首进程 PID @LEADER@,已被启动并可被使用。 + +-- 58432bd3bace477cb514b56381b8a758 +Subject: 一个虚拟机或容器已被终止 +Defined-By: systemd +Support: %SUPPORT_URL% + +虚拟机 @NAME@,以及其首进程 PID @LEADER@,已被关闭并停止。 diff --git a/src/grp-journal/systemd-journald/systemd.zh_TW.catalog.in b/src/grp-journal/systemd-journald/systemd.zh_TW.catalog.in new file mode 100644 index 0000000000..f7b42fa1c7 --- /dev/null +++ b/src/grp-journal/systemd-journald/systemd.zh_TW.catalog.in @@ -0,0 +1,263 @@ +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# Copyright 2015 Jeff Huang +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# Message catalog for systemd's own messages +# Traditional Chinese translation + +# Catalog 的格式記錄於 +# http://www.freedesktop.org/wiki/Software/systemd/catalog + +# For an explanation why we do all this, see https://xkcd.com/1024/ + +-- f77379a8490b408bbe5f6940505a777b +Subject: 日誌已開始 +Defined-By: systemd +Support: %SUPPORT_URL% + +系統日誌行程已啟動,已開啟日誌 +檔案供寫入並準備好對行程的要求做出回應。 + +-- d93fb3c9c24d451a97cea615ce59c00b +Subject: 日誌已停止 +Defined-By: systemd +Support: %SUPPORT_URL% + +系統日誌行程已關閉,且關閉所有目前 +活躍的日誌檔案。 + +-- a596d6fe7bfa4994828e72309e95d61e +Subject: 從服務而來的訊息已被抑制 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:journald.conf(5) + +有一個服務在一個時間週期內記錄了太多訊息。 +從該服務而來的訊息已被丟棄。 + +注意,只有有問題的服務之訊息被丟棄, +其他服務的訊息則不受影響。 + +可以在 /etc/systemd/journald.conf 中設定 +RateLimitIntervalSec= 以及 RateLimitBurst= +來控制當訊息要開始被丟棄時的限制。參見 journald.conf(5) 以獲得更多資訊。 + +-- e9bf28e6e834481bb6f48f548ad13606 +Subject: 日誌訊息已遺失 +Defined-By: systemd +Support: %SUPPORT_URL% + +因日誌系統對核心訊息的處理不夠快速, +部份訊息已遺失。 + +-- fc2e22bc6ee647b6b90729ab34a250b1 +Subject: 行程 @COREDUMP_PID@ (@COREDUMP_COMM@) 核心傾印 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: man:core(5) + +行程 @COREDUMP_PID@ (@COREDUMP_COMM@) 當掉並核心傾印。 + +這通常代表了在當掉的程式中的一個程式錯誤 +並需要回報錯誤給其開發者。 + +-- 8d45620c1a4348dbb17410da57c60c66 +Subject: 新的工作階段 @SESSION_ID@ 已為使用者 @USER_ID@ 建立 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +一個新的工作階段,ID @SESSION_ID@ 已為使用者 @USER_ID@ 建立。 + +這個工作階段的領導行程為 @LEADER@。 + +-- 3354939424b4456d9802ca8333ed424a +Subject: 工作階段 @SESSION_ID@ 已結束 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +一個工作階段,ID @SESSION_ID@ 已結束。 + +-- fcbefc5da23d428093f97c82a9290f7b +Subject: 新的座位 @SEAT_ID@ 可用 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +一個新的座位 @SEAT_ID@ 已被設定且現在可用。 + +-- e7852bfe46784ed0accde04bc864c2d5 +Subject: 座位 @SEAT_ID@ 已被移除 +Defined-By: systemd +Support: %SUPPORT_URL% +Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat + +座位 @SEAT_ID@ 已被移除且不再可用。 + +-- c7a787079b354eaaa9e77b371893cd27 +Subject: 時間變更 +Defined-By: systemd +Support: %SUPPORT_URL% + +系統時間已變更為1970年1月1日後 @REALTIME@ 微秒。 + +-- 45f82f4aef7a4bbf942ce861d1f20990 +Subject: 時區變更為 @TIMEZONE@ +Defined-By: systemd +Support: %SUPPORT_URL% + +系統時區已變更為 @TIMEZONE@。 + +-- b07a249cd024414a82dd00cd181378ff +Subject: 系統啟動已完成 +Defined-By: systemd +Support: %SUPPORT_URL% + +所有開機所必要的系統服務都已成功啟動。 +注意這並不代表這臺機器有空閒的時間 +可以服務,可能仍忙於完成啟動。 + +核心啟動需要 @KERNEL_USEC@ 微秒。 + +初始 RAM 磁碟啟動需要 @INITRD_USEC@ 微秒。 + +使用者空間啟動需要 @USERSPACE_USEC@ 微秒。 + +-- 6bbd95ee977941e497c48be27c254128 +Subject: 系統進入 @SLEEP@ 睡眠狀態 +Defined-By: systemd +Support: %SUPPORT_URL% + +系統現在已進入 @SLEEP@ 睡眠狀態。 + +-- 8811e6df2a8e40f58a94cea26f8ebf14 +Subject: 系統離開 @SLEEP@ 睡眠狀態 +Defined-By: systemd +Support: %SUPPORT_URL% + +系統現在已離開 @SLEEP@ 睡眠狀態。 + +-- 98268866d1d54a499c4e98921d93bc40 +Subject: 系統關機開始 +Defined-By: systemd +Support: %SUPPORT_URL% + +Systemd 關閉已經開始。關閉已開始且所有系統服務 +都已結束,所有的檔案系統也都已被卸載。 + +-- 7d4958e842da4a758f6c1cdc7b36dcc5 +Subject: 單位 @UNIT@ 已開始啟動 +Defined-By: systemd +Support: %SUPPORT_URL% + +單位 @UNIT@ 已開始啟動。 + +-- 39f53479d3a045ac8e11786248231fbf +Subject: 單位 @UNIT@ 啟動已結束 +Defined-By: systemd +Support: %SUPPORT_URL% + +單位 @UNIT@ 啟動已結束。 + +啟動結果為 @RESULT@。 + +-- de5b426a63be47a7b6ac3eaac82e2f6f +Subject: 單位 @UNIT@ 已開始關閉 +Defined-By: systemd +Support: %SUPPORT_URL% + +單位 @UNIT@ 已開始關閉。 + +-- 9d1aaa27d60140bd96365438aad20286 +Subject: 單位 @UNIT@ 已關閉結束 +Defined-By: systemd +Support: %SUPPORT_URL% + +單位 @UNIT@ 已關閉結束。 + +-- be02cf6855d2428ba40df7e9d022f03d +Subject: 單位 @UNIT@ 已失敗 +Defined-By: systemd +Support: %SUPPORT_URL% + +單位 @UNIT@ 已失敗。 + +結果為 @RESULT@。 + +-- d34d037fff1847e6ae669a370e694725 +Subject: 單位 @UNIT@ 已開始重新載入其設定 +Defined-By: systemd +Support: %SUPPORT_URL% + +單位 @UNIT@ 已開始重新載入其設定 + +-- 7b05ebc668384222baa8881179cfda54 +Subject: 單位 @UNIT@ 已結束重新載入其設定 +Defined-By: systemd +Support: %SUPPORT_URL% + +單位 @UNIT@ 已結束重新載入其設定 + +結果為 @RESULT@。 + +-- 641257651c1b4ec9a8624d7a40a9e1e7 +Subject: 行程 @EXECUTABLE@ 無法執行 +Defined-By: systemd +Support: %SUPPORT_URL% + +行程 @EXECUTABLE@ 無法執行且失敗。 + +由該行程所回傳的錯誤碼為 @ERRNO@。 + +-- 0027229ca0644181a76c4e92458afa2e +Subject: 一個或更多訊息無法被轉發到 syslog +Defined-By: systemd +Support: %SUPPORT_URL% + +一個或更多訊息無法被轉發到 syslog 服務 +以及並行執行的 journald。這通常代表著 +syslog 實作並無未跟上佇列中訊息 +的速度。 + +-- 1dee0369c7fc4736b7099b38ecb46ee7 +Subject: 掛載點不為空 +Defined-By: systemd +Support: %SUPPORT_URL% + +目錄 @WHERE@ 被指定為掛載點(在 /etc/fstab 中的 +第二欄或是在 systemd 單位檔案中的 Where= 欄位)且其不為空。 +這並不會干擾掛載,但在此目錄中已存在的檔案 +會變成無法存取的狀態。要檢視這些 over-mounted 的檔案, +請手動掛載下面的檔案系統到次要 +位置。 + +-- 24d8d4452573402496068381a6312df2 +Subject: 虛擬機器或容器已啟動 +Defined-By: systemd +Support: %SUPPORT_URL% + +虛擬機器 @NAME@ 包含它的領導 PID @LEADER@ 現在 +已經開始並已經可以使用。 + +-- 58432bd3bace477cb514b56381b8a758 +Subject: 虛擬機器或容器已結束 +Defined-By: systemd +Support: %SUPPORT_URL% + +虛擬機器 @NAME@ 包含它的領導 PID @LEADER@ 已經 +關閉。 -- cgit v1.2.3-54-g00ecf