1
0
mirror of https://github.com/systemd/systemd synced 2025-10-05 19:54:46 +02:00

Compare commits

..

10 Commits

Author SHA1 Message Date
Pjotr Vertaalt
798c65cf1f po: Added translation using Weblate (Dutch)
Co-authored-by: Pjotr Vertaalt <pjotrvertaalt@gmail.com>
2021-03-23 11:06:02 +01:00
David Tardon
f055cf7786 man: document differences in clean exit status for Type=oneshot
See commit 1f0958f640b87175cd547c1e69084cfe54a22e9d .
2021-03-23 09:33:23 +01:00
Christian Hesse
3babb81625 man: rate limited services can be restartet from timer or socket
If rate limiting kicks in for Restart= logic it is still possible for a
timer or socket to restart the service.
2021-03-23 09:16:30 +01:00
Zbigniew Jędrzejewski-Szmek
39f756d3ae sd-event: disable epoll_pwait2 for now
This reverts the gist of commit 798445ab84cff51bde7fcf936f0fb19c37cf858c.

Unfortunately the new syscall causes test-event to hang. 32 bit architectures
seem affected: i686 and arm32 in fedora koji. 32 bit build of test-event hangs
reliably under valgrind:

$ PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig meson build-32 -Dc_args=-m32 -Dc_link_args=-m32 -Dcpp_args=-m32 -Dcpp_link_args=-m32 && ninja -C build-32 test-event && valgrind build/test-event

If I set epoll_pwait2_absent=true, so the new function is never called, then
the issue does not reproduce. It seems to be strictly tied to the syscall.

On amd64, the syscall is not used, at least with the kernel that Fedora
provides. The kernel patch 58169a52ebc9a733aeb5bea857bc5daa71a301bb says:

  For timespec, only support this new interface on 2038 aware platforms
  that define __kernel_timespec_t. So no CONFIG_COMPAT_32BIT_TIME.

And Fedora sets CONFIG_COMPAT_32BIT_TIME=y. I expect most other distros will too.

On amd64: epoll_wait_usec: epoll_pwait2: ret=-1 / errno=38
On i686 (same kernel): epoll_wait_usec: epoll_pwait2: ret=2 / errno=0

Is this some kind of emulation? Anyway, it seems that this is what is going wrong.

So let's disable the syscall until it becomes more widely available and the
kinks have been ironed out.

Fixes test-event issue in #19052.
2021-03-23 09:10:29 +01:00
Zbigniew Jędrzejewski-Szmek
ca83c7f88c
Merge pull request #19075 from keszybz/calendarspec-loop
Fix infinite loop in calendarspec calculation when timezone has negative DST save value
2021-03-23 09:06:16 +01:00
Zbigniew Jędrzejewski-Szmek
129cb6e249 shared/calendarspec: when mktime() moves us backwards, jump forward
When trying to calculate the next firing of 'Sun *-*-* 01:00:00', we'd fall
into an infinite loop, because mktime() moves us "backwards":

Before this patch:
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
...

We rely on mktime() normalizing the time. The man page does not say that it'll
move the time forward, but our algorithm relies on this. So let's catch this
case explicitly.

With this patch:
$ TZ=Europe/Dublin faketime 2021-03-21 build/systemd-analyze calendar --iterations=5 'Sun *-*-* 01:00:00'
Normalized form: Sun *-*-* 01:00:00
    Next elapse: Sun 2021-03-21 01:00:00 GMT
       (in UTC): Sun 2021-03-21 01:00:00 UTC
       From now: 59min left
       Iter. #2: Sun 2021-04-04 01:00:00 IST
       (in UTC): Sun 2021-04-04 00:00:00 UTC
       From now: 1 weeks 6 days left           <---- note the 2 week jump here
       Iter. #3: Sun 2021-04-11 01:00:00 IST
       (in UTC): Sun 2021-04-11 00:00:00 UTC
       From now: 2 weeks 6 days left
       Iter. #4: Sun 2021-04-18 01:00:00 IST
       (in UTC): Sun 2021-04-18 00:00:00 UTC
       From now: 3 weeks 6 days left
       Iter. #5: Sun 2021-04-25 01:00:00 IST
       (in UTC): Sun 2021-04-25 00:00:00 UTC
       From now: 1 months 4 days left

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1941335.
2021-03-23 00:35:02 +01:00
Zbigniew Jędrzejewski-Szmek
47b0b65766 test-calendarspec: do not convert timezone "" to ":"
I *think* it doesn't actually make any difference, because ":" will be ignored.
437f48a471f51ac9dd2697ee3b848a71b4f101df added prefixing with ":", but didn't
take into account the fact that we also use "" with a different meaning than
NULL here. But let's restore the original behaviour of specifying the empty
string.
2021-03-22 20:08:16 +01:00
Zbigniew Jędrzejewski-Szmek
f035bb1b7a test-calendarspec: print offending line in output
The output is rather long at this makes it easier to jump to the right place.
Also use normal output routines and set_unset_env() to make things more
compact.
2021-03-22 20:08:16 +01:00
Zbigniew Jędrzejewski-Szmek
462f15d92d shared/calendarspec: constify parameter and simplify assignments to variable
The scope of start & stop is narrowed down, and they are assigned only once.
No functional change, but I think the code is easier to read this way.
Also add a comment to make the code easier to read.
2021-03-22 20:08:16 +01:00
Zbigniew Jędrzejewski-Szmek
169615c9a8 shared/calendarspec: abort calculation after 1000 iterations
We have a bug where we seem to enter an infinite loop when running in the
Europe/Dublin timezone. The timezone is "special" because it has negative SAVE
values. The handling of this should obviously be fixed, but let's use a
belt-and-suspenders approach, and gracefully fail if we fail to find an answer
within a specific number of attempts. The code in this function is rather
complex, and it's hard to rule out another bug in the future.
2021-03-22 13:44:57 +01:00
8 changed files with 952 additions and 65 deletions

View File

@ -756,14 +756,19 @@
If set to <option>no</option> (the default), the service will
not be restarted. If set to <option>on-success</option>, it
will be restarted only when the service process exits cleanly.
In this context, a clean exit means an exit code of 0, or one
of the signals
<constant>SIGHUP</constant>,
<constant>SIGINT</constant>,
<constant>SIGTERM</constant> or
<constant>SIGPIPE</constant>, and
additionally, exit statuses and signals specified in
<varname>SuccessExitStatus=</varname>. If set to
In this context, a clean exit means any of the following:
<itemizedlist>
<listitem><simpara>exit code of 0;</simpara></listitem>
<listitem><simpara>for types other than
<varname>Type=oneshot</varname>, one of the signals
<constant>SIGHUP</constant>,
<constant>SIGINT</constant>,
<constant>SIGTERM</constant>, or
<constant>SIGPIPE</constant>;</simpara></listitem>
<listitem><simpara>exit statuses and signals specified in
<varname>SuccessExitStatus=</varname>.</simpara></listitem>
</itemizedlist>
If set to
<option>on-failure</option>, the service will be restarted
when the process exits with a non-zero exit code, is
terminated by a signal (including on core dump, but excluding
@ -885,7 +890,7 @@
<listitem><para>Takes a list of exit status definitions that, when returned by the main service
process, will be considered successful termination, in addition to the normal successful exit status
0 and the signals <constant>SIGHUP</constant>, <constant>SIGINT</constant>,
0 and, except for <varname>Type=oneshot</varname>, the signals <constant>SIGHUP</constant>, <constant>SIGINT</constant>,
<constant>SIGTERM</constant>, and <constant>SIGPIPE</constant>. Exit status definitions can be
numeric termination statuses, termination status names, or termination signal names, separated by
spaces. See the Process Exit Codes section in

View File

@ -1037,13 +1037,13 @@
<varname>Restart=</varname> logic.</para>
<para>Note that units which are configured for <varname>Restart=</varname>, and which reach the start
limit are not attempted to be restarted anymore; however, they may still be restarted manually at a
later point, after the <replaceable>interval</replaceable> has passed. From that point on, the
restart logic is activated again. <command>systemctl reset-failed</command> will cause the restart
rate counter for a service to be flushed, which is useful if the administrator wants to manually
start a unit and the start limit interferes with that. Rate-limiting is enforced after any unit
condition checks are executed, and hence unit activations with failing conditions do not count
towards the rate limit.</para>
limit are not attempted to be restarted anymore; however, they may still be restarted manually or
from a timer or socket at a later point, after the <replaceable>interval</replaceable> has passed.
From that point on, the restart logic is activated again. <command>systemctl reset-failed</command>
will cause the restart rate counter for a service to be flushed, which is useful if the administrator
wants to manually start a unit and the start limit interferes with that. Rate-limiting is enforced
after any unit condition checks are executed, and hence unit activations with failing conditions do
not count towards the rate limit.</para>
<para>When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters
are flushed out too. This means that configuring start rate limiting for a unit that is not

View File

@ -30,3 +30,4 @@ zh_TW
pa
kab
si
nl

849
po/nl.po Normal file
View File

@ -0,0 +1,849 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the systemd package.
# Pjotr Vertaalt <pjotrvertaalt@gmail.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: systemd\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-08 17:48+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/core/org.freedesktop.systemd1.policy.in:22
msgid "Send passphrase back to system"
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:23
msgid ""
"Authentication is required to send the entered passphrase back to the system."
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:33
msgid "Manage system services or other units"
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:34
msgid "Authentication is required to manage system services or other units."
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:43
msgid "Manage system service or unit files"
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:44
msgid "Authentication is required to manage system service or unit files."
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:54
msgid "Set or unset system and service manager environment variables"
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:55
msgid ""
"Authentication is required to set or unset system and service manager "
"environment variables."
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:64
msgid "Reload the systemd state"
msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:65
msgid "Authentication is required to reload the systemd state."
msgstr ""
#: src/home/org.freedesktop.home1.policy:13
msgid "Create a home area"
msgstr ""
#: src/home/org.freedesktop.home1.policy:14
msgid "Authentication is required to create a user's home area."
msgstr ""
#: src/home/org.freedesktop.home1.policy:23
msgid "Remove a home area"
msgstr ""
#: src/home/org.freedesktop.home1.policy:24
msgid "Authentication is required to remove a user's home area."
msgstr ""
#: src/home/org.freedesktop.home1.policy:33
msgid "Check credentials of a home area"
msgstr ""
#: src/home/org.freedesktop.home1.policy:34
msgid ""
"Authentication is required to check credentials against a user's home area."
msgstr ""
#: src/home/org.freedesktop.home1.policy:43
msgid "Update a home area"
msgstr ""
#: src/home/org.freedesktop.home1.policy:44
msgid "Authentication is required to update a user's home area."
msgstr ""
#: src/home/org.freedesktop.home1.policy:53
msgid "Resize a home area"
msgstr ""
#: src/home/org.freedesktop.home1.policy:54
msgid "Authentication is required to resize a user's home area."
msgstr ""
#: src/home/org.freedesktop.home1.policy:63
msgid "Change password of a home area"
msgstr ""
#: src/home/org.freedesktop.home1.policy:64
msgid ""
"Authentication is required to change the password of a user's home area."
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:20
msgid "Set hostname"
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:21
msgid "Authentication is required to set the local hostname."
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:30
msgid "Set static hostname"
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:31
msgid ""
"Authentication is required to set the statically configured local hostname, "
"as well as the pretty hostname."
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:41
msgid "Set machine information"
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:42
msgid "Authentication is required to set local machine information."
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:51
msgid "Get product UUID"
msgstr ""
#: src/hostname/org.freedesktop.hostname1.policy:52
msgid "Authentication is required to get product UUID."
msgstr ""
#: src/import/org.freedesktop.import1.policy:22
msgid "Import a VM or container image"
msgstr ""
#: src/import/org.freedesktop.import1.policy:23
msgid "Authentication is required to import a VM or container image"
msgstr ""
#: src/import/org.freedesktop.import1.policy:32
msgid "Export a VM or container image"
msgstr ""
#: src/import/org.freedesktop.import1.policy:33
msgid "Authentication is required to export a VM or container image"
msgstr ""
#: src/import/org.freedesktop.import1.policy:42
msgid "Download a VM or container image"
msgstr ""
#: src/import/org.freedesktop.import1.policy:43
msgid "Authentication is required to download a VM or container image"
msgstr ""
#: src/locale/org.freedesktop.locale1.policy:22
msgid "Set system locale"
msgstr ""
#: src/locale/org.freedesktop.locale1.policy:23
msgid "Authentication is required to set the system locale."
msgstr ""
#: src/locale/org.freedesktop.locale1.policy:33
msgid "Set system keyboard settings"
msgstr ""
#: src/locale/org.freedesktop.locale1.policy:34
msgid "Authentication is required to set the system keyboard settings."
msgstr ""
#: src/login/org.freedesktop.login1.policy:22
msgid "Allow applications to inhibit system shutdown"
msgstr ""
#: src/login/org.freedesktop.login1.policy:23
msgid ""
"Authentication is required for an application to inhibit system shutdown."
msgstr ""
#: src/login/org.freedesktop.login1.policy:33
msgid "Allow applications to delay system shutdown"
msgstr ""
#: src/login/org.freedesktop.login1.policy:34
msgid "Authentication is required for an application to delay system shutdown."
msgstr ""
#: src/login/org.freedesktop.login1.policy:44
msgid "Allow applications to inhibit system sleep"
msgstr ""
#: src/login/org.freedesktop.login1.policy:45
msgid "Authentication is required for an application to inhibit system sleep."
msgstr ""
#: src/login/org.freedesktop.login1.policy:55
msgid "Allow applications to delay system sleep"
msgstr ""
#: src/login/org.freedesktop.login1.policy:56
msgid "Authentication is required for an application to delay system sleep."
msgstr ""
#: src/login/org.freedesktop.login1.policy:65
msgid "Allow applications to inhibit automatic system suspend"
msgstr ""
#: src/login/org.freedesktop.login1.policy:66
msgid ""
"Authentication is required for an application to inhibit automatic system "
"suspend."
msgstr ""
#: src/login/org.freedesktop.login1.policy:75
msgid "Allow applications to inhibit system handling of the power key"
msgstr ""
#: src/login/org.freedesktop.login1.policy:76
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the power key."
msgstr ""
#: src/login/org.freedesktop.login1.policy:86
msgid "Allow applications to inhibit system handling of the suspend key"
msgstr ""
#: src/login/org.freedesktop.login1.policy:87
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the suspend key."
msgstr ""
#: src/login/org.freedesktop.login1.policy:97
msgid "Allow applications to inhibit system handling of the hibernate key"
msgstr ""
#: src/login/org.freedesktop.login1.policy:98
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the hibernate key."
msgstr ""
#: src/login/org.freedesktop.login1.policy:107
msgid "Allow applications to inhibit system handling of the lid switch"
msgstr ""
#: src/login/org.freedesktop.login1.policy:108
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the lid switch."
msgstr ""
#: src/login/org.freedesktop.login1.policy:117
msgid "Allow applications to inhibit system handling of the reboot key"
msgstr ""
#: src/login/org.freedesktop.login1.policy:118
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the reboot key."
msgstr ""
#: src/login/org.freedesktop.login1.policy:128
msgid "Allow non-logged-in user to run programs"
msgstr ""
#: src/login/org.freedesktop.login1.policy:129
msgid "Explicit request is required to run programs as a non-logged-in user."
msgstr ""
#: src/login/org.freedesktop.login1.policy:138
msgid "Allow non-logged-in users to run programs"
msgstr ""
#: src/login/org.freedesktop.login1.policy:139
msgid "Authentication is required to run programs as a non-logged-in user."
msgstr ""
#: src/login/org.freedesktop.login1.policy:148
msgid "Allow attaching devices to seats"
msgstr ""
#: src/login/org.freedesktop.login1.policy:149
msgid "Authentication is required to attach a device to a seat."
msgstr ""
#: src/login/org.freedesktop.login1.policy:159
msgid "Flush device to seat attachments"
msgstr ""
#: src/login/org.freedesktop.login1.policy:160
msgid "Authentication is required to reset how devices are attached to seats."
msgstr ""
#: src/login/org.freedesktop.login1.policy:169
msgid "Power off the system"
msgstr ""
#: src/login/org.freedesktop.login1.policy:170
msgid "Authentication is required to power off the system."
msgstr ""
#: src/login/org.freedesktop.login1.policy:180
msgid "Power off the system while other users are logged in"
msgstr ""
#: src/login/org.freedesktop.login1.policy:181
msgid ""
"Authentication is required to power off the system while other users are "
"logged in."
msgstr ""
#: src/login/org.freedesktop.login1.policy:191
msgid "Power off the system while an application is inhibiting this"
msgstr ""
#: src/login/org.freedesktop.login1.policy:192
msgid ""
"Authentication is required to power off the system while an application is "
"inhibiting this."
msgstr ""
#: src/login/org.freedesktop.login1.policy:202
msgid "Reboot the system"
msgstr ""
#: src/login/org.freedesktop.login1.policy:203
msgid "Authentication is required to reboot the system."
msgstr ""
#: src/login/org.freedesktop.login1.policy:213
msgid "Reboot the system while other users are logged in"
msgstr ""
#: src/login/org.freedesktop.login1.policy:214
msgid ""
"Authentication is required to reboot the system while other users are logged "
"in."
msgstr ""
#: src/login/org.freedesktop.login1.policy:224
msgid "Reboot the system while an application is inhibiting this"
msgstr ""
#: src/login/org.freedesktop.login1.policy:225
msgid ""
"Authentication is required to reboot the system while an application is "
"inhibiting this."
msgstr ""
#: src/login/org.freedesktop.login1.policy:235
msgid "Halt the system"
msgstr ""
#: src/login/org.freedesktop.login1.policy:236
msgid "Authentication is required to halt the system."
msgstr ""
#: src/login/org.freedesktop.login1.policy:246
msgid "Halt the system while other users are logged in"
msgstr ""
#: src/login/org.freedesktop.login1.policy:247
msgid ""
"Authentication is required to halt the system while other users are logged "
"in."
msgstr ""
#: src/login/org.freedesktop.login1.policy:257
msgid "Halt the system while an application is inhibiting this"
msgstr ""
#: src/login/org.freedesktop.login1.policy:258
msgid ""
"Authentication is required to halt the system while an application is "
"inhibiting this."
msgstr ""
#: src/login/org.freedesktop.login1.policy:268
msgid "Suspend the system"
msgstr ""
#: src/login/org.freedesktop.login1.policy:269
msgid "Authentication is required to suspend the system."
msgstr ""
#: src/login/org.freedesktop.login1.policy:278
msgid "Suspend the system while other users are logged in"
msgstr ""
#: src/login/org.freedesktop.login1.policy:279
msgid ""
"Authentication is required to suspend the system while other users are "
"logged in."
msgstr ""
#: src/login/org.freedesktop.login1.policy:289
msgid "Suspend the system while an application is inhibiting this"
msgstr ""
#: src/login/org.freedesktop.login1.policy:290
msgid ""
"Authentication is required to suspend the system while an application is "
"inhibiting this."
msgstr ""
#: src/login/org.freedesktop.login1.policy:300
msgid "Hibernate the system"
msgstr ""
#: src/login/org.freedesktop.login1.policy:301
msgid "Authentication is required to hibernate the system."
msgstr ""
#: src/login/org.freedesktop.login1.policy:310
msgid "Hibernate the system while other users are logged in"
msgstr ""
#: src/login/org.freedesktop.login1.policy:311
msgid ""
"Authentication is required to hibernate the system while other users are "
"logged in."
msgstr ""
#: src/login/org.freedesktop.login1.policy:321
msgid "Hibernate the system while an application is inhibiting this"
msgstr ""
#: src/login/org.freedesktop.login1.policy:322
msgid ""
"Authentication is required to hibernate the system while an application is "
"inhibiting this."
msgstr ""
#: src/login/org.freedesktop.login1.policy:332
msgid "Manage active sessions, users and seats"
msgstr ""
#: src/login/org.freedesktop.login1.policy:333
msgid "Authentication is required to manage active sessions, users and seats."
msgstr ""
#: src/login/org.freedesktop.login1.policy:342
msgid "Lock or unlock active sessions"
msgstr ""
#: src/login/org.freedesktop.login1.policy:343
msgid "Authentication is required to lock or unlock active sessions."
msgstr ""
#: src/login/org.freedesktop.login1.policy:352
msgid "Set the reboot \"reason\" in the kernel"
msgstr ""
#: src/login/org.freedesktop.login1.policy:353
msgid "Authentication is required to set the reboot \"reason\" in the kernel."
msgstr ""
#: src/login/org.freedesktop.login1.policy:363
msgid "Indicate to the firmware to boot to setup interface"
msgstr ""
#: src/login/org.freedesktop.login1.policy:364
msgid ""
"Authentication is required to indicate to the firmware to boot to setup "
"interface."
msgstr ""
#: src/login/org.freedesktop.login1.policy:374
msgid "Indicate to the boot loader to boot to the boot loader menu"
msgstr ""
#: src/login/org.freedesktop.login1.policy:375
msgid ""
"Authentication is required to indicate to the boot loader to boot to the "
"boot loader menu."
msgstr ""
#: src/login/org.freedesktop.login1.policy:385
msgid "Indicate to the boot loader to boot a specific entry"
msgstr ""
#: src/login/org.freedesktop.login1.policy:386
msgid ""
"Authentication is required to indicate to the boot loader to boot into a "
"specific boot loader entry."
msgstr ""
#: src/login/org.freedesktop.login1.policy:396
msgid "Set a wall message"
msgstr ""
#: src/login/org.freedesktop.login1.policy:397
msgid "Authentication is required to set a wall message"
msgstr ""
#: src/login/org.freedesktop.login1.policy:406
msgid "Change Session"
msgstr ""
#: src/login/org.freedesktop.login1.policy:407
msgid "Authentication is required to change the virtual terminal."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:22
msgid "Log into a local container"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:23
msgid "Authentication is required to log into a local container."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:32
msgid "Log into the local host"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:33
msgid "Authentication is required to log into the local host."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:42
msgid "Acquire a shell in a local container"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:43
msgid "Authentication is required to acquire a shell in a local container."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:53
msgid "Acquire a shell on the local host"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:54
msgid "Authentication is required to acquire a shell on the local host."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:64
msgid "Acquire a pseudo TTY in a local container"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:65
msgid ""
"Authentication is required to acquire a pseudo TTY in a local container."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:74
msgid "Acquire a pseudo TTY on the local host"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:75
msgid "Authentication is required to acquire a pseudo TTY on the local host."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:84
msgid "Manage local virtual machines and containers"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:85
msgid ""
"Authentication is required to manage local virtual machines and containers."
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:95
msgid "Manage local virtual machine and container images"
msgstr ""
#: src/machine/org.freedesktop.machine1.policy:96
msgid ""
"Authentication is required to manage local virtual machine and container "
"images."
msgstr ""
#: src/network/org.freedesktop.network1.policy:22
msgid "Set NTP servers"
msgstr ""
#: src/network/org.freedesktop.network1.policy:23
msgid "Authentication is required to set NTP servers."
msgstr ""
#: src/network/org.freedesktop.network1.policy:33
#: src/resolve/org.freedesktop.resolve1.policy:44
msgid "Set DNS servers"
msgstr ""
#: src/network/org.freedesktop.network1.policy:34
#: src/resolve/org.freedesktop.resolve1.policy:45
msgid "Authentication is required to set DNS servers."
msgstr ""
#: src/network/org.freedesktop.network1.policy:44
#: src/resolve/org.freedesktop.resolve1.policy:55
msgid "Set domains"
msgstr ""
#: src/network/org.freedesktop.network1.policy:45
#: src/resolve/org.freedesktop.resolve1.policy:56
msgid "Authentication is required to set domains."
msgstr ""
#: src/network/org.freedesktop.network1.policy:55
#: src/resolve/org.freedesktop.resolve1.policy:66
msgid "Set default route"
msgstr ""
#: src/network/org.freedesktop.network1.policy:56
#: src/resolve/org.freedesktop.resolve1.policy:67
msgid "Authentication is required to set default route."
msgstr ""
#: src/network/org.freedesktop.network1.policy:66
#: src/resolve/org.freedesktop.resolve1.policy:77
msgid "Enable/disable LLMNR"
msgstr ""
#: src/network/org.freedesktop.network1.policy:67
#: src/resolve/org.freedesktop.resolve1.policy:78
msgid "Authentication is required to enable or disable LLMNR."
msgstr ""
#: src/network/org.freedesktop.network1.policy:77
#: src/resolve/org.freedesktop.resolve1.policy:88
msgid "Enable/disable multicast DNS"
msgstr ""
#: src/network/org.freedesktop.network1.policy:78
#: src/resolve/org.freedesktop.resolve1.policy:89
msgid "Authentication is required to enable or disable multicast DNS."
msgstr ""
#: src/network/org.freedesktop.network1.policy:88
#: src/resolve/org.freedesktop.resolve1.policy:99
msgid "Enable/disable DNS over TLS"
msgstr ""
#: src/network/org.freedesktop.network1.policy:89
#: src/resolve/org.freedesktop.resolve1.policy:100
msgid "Authentication is required to enable or disable DNS over TLS."
msgstr ""
#: src/network/org.freedesktop.network1.policy:99
#: src/resolve/org.freedesktop.resolve1.policy:110
msgid "Enable/disable DNSSEC"
msgstr ""
#: src/network/org.freedesktop.network1.policy:100
#: src/resolve/org.freedesktop.resolve1.policy:111
msgid "Authentication is required to enable or disable DNSSEC."
msgstr ""
#: src/network/org.freedesktop.network1.policy:110
#: src/resolve/org.freedesktop.resolve1.policy:121
msgid "Set DNSSEC Negative Trust Anchors"
msgstr ""
#: src/network/org.freedesktop.network1.policy:111
#: src/resolve/org.freedesktop.resolve1.policy:122
msgid "Authentication is required to set DNSSEC Negative Trust Anchors."
msgstr ""
#: src/network/org.freedesktop.network1.policy:121
msgid "Revert NTP settings"
msgstr ""
#: src/network/org.freedesktop.network1.policy:122
msgid "Authentication is required to reset NTP settings."
msgstr ""
#: src/network/org.freedesktop.network1.policy:132
msgid "Revert DNS settings"
msgstr ""
#: src/network/org.freedesktop.network1.policy:133
msgid "Authentication is required to reset DNS settings."
msgstr ""
#: src/network/org.freedesktop.network1.policy:143
msgid "DHCP server sends force renew message"
msgstr ""
#: src/network/org.freedesktop.network1.policy:144
msgid "Authentication is required to send force renew message."
msgstr ""
#: src/network/org.freedesktop.network1.policy:154
msgid "Renew dynamic addresses"
msgstr ""
#: src/network/org.freedesktop.network1.policy:155
msgid "Authentication is required to renew dynamic addresses."
msgstr ""
#: src/network/org.freedesktop.network1.policy:165
msgid "Reload network settings"
msgstr ""
#: src/network/org.freedesktop.network1.policy:166
msgid "Authentication is required to reload network settings."
msgstr ""
#: src/network/org.freedesktop.network1.policy:176
msgid "Reconfigure network interface"
msgstr ""
#: src/network/org.freedesktop.network1.policy:177
msgid "Authentication is required to reconfigure network interface."
msgstr ""
#: src/portable/org.freedesktop.portable1.policy:13
msgid "Inspect a portable service image"
msgstr ""
#: src/portable/org.freedesktop.portable1.policy:14
msgid "Authentication is required to inspect a portable service image."
msgstr ""
#: src/portable/org.freedesktop.portable1.policy:23
msgid "Attach or detach a portable service image"
msgstr ""
#: src/portable/org.freedesktop.portable1.policy:24
msgid ""
"Authentication is required to attach or detach a portable service image."
msgstr ""
#: src/portable/org.freedesktop.portable1.policy:34
msgid "Delete or modify portable service image"
msgstr ""
#: src/portable/org.freedesktop.portable1.policy:35
msgid ""
"Authentication is required to delete or modify a portable service image."
msgstr ""
#: src/resolve/org.freedesktop.resolve1.policy:22
msgid "Register a DNS-SD service"
msgstr ""
#: src/resolve/org.freedesktop.resolve1.policy:23
msgid "Authentication is required to register a DNS-SD service"
msgstr ""
#: src/resolve/org.freedesktop.resolve1.policy:33
msgid "Unregister a DNS-SD service"
msgstr ""
#: src/resolve/org.freedesktop.resolve1.policy:34
msgid "Authentication is required to unregister a DNS-SD service"
msgstr ""
#: src/resolve/org.freedesktop.resolve1.policy:132
msgid "Revert name resolution settings"
msgstr ""
#: src/resolve/org.freedesktop.resolve1.policy:133
msgid "Authentication is required to reset name resolution settings."
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:22
msgid "Set system time"
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:23
msgid "Authentication is required to set the system time."
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:33
msgid "Set system timezone"
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:34
msgid "Authentication is required to set the system timezone."
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:43
msgid "Set RTC to local timezone or UTC"
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:44
msgid ""
"Authentication is required to control whether the RTC stores the local or "
"UTC time."
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:53
msgid "Turn network time synchronization on or off"
msgstr ""
#: src/timedate/org.freedesktop.timedate1.policy:54
msgid ""
"Authentication is required to control whether network time synchronization "
"shall be enabled."
msgstr ""
#: src/core/dbus-unit.c:359
msgid "Authentication is required to start '$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:360
msgid "Authentication is required to stop '$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:361
msgid "Authentication is required to reload '$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:362 src/core/dbus-unit.c:363
msgid "Authentication is required to restart '$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:535
msgid ""
"Authentication is required to send a UNIX signal to the processes of "
"'$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:566
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:599
msgid "Authentication is required to set properties on '$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:708
msgid ""
"Authentication is required to delete files and directories associated with "
"'$(unit)'."
msgstr ""
#: src/core/dbus-unit.c:757
msgid ""
"Authentication is required to freeze or thaw the processes of '$(unit)' unit."
msgstr ""

View File

@ -3808,10 +3808,15 @@ static int epoll_wait_usec(
int maxevents,
usec_t timeout) {
static bool epoll_pwait2_absent = false;
int r, msec;
#if 0
static bool epoll_pwait2_absent = false;
/* A wrapper that uses epoll_pwait2() if available, and falls back to epoll_wait() if not */
/* A wrapper that uses epoll_pwait2() if available, and falls back to epoll_wait() if not.
*
* FIXME: this is temporarily disabled until epoll_pwait2() becomes more widely available.
* See https://github.com/systemd/systemd/pull/18973 and
* https://github.com/systemd/systemd/issues/19052. */
if (!epoll_pwait2_absent && timeout != USEC_INFINITY) {
struct timespec ts;
@ -3829,6 +3834,7 @@ static int epoll_wait_usec(
epoll_pwait2_absent = true;
}
#endif
if (timeout == USEC_INFINITY)
msec = -1;

View File

@ -1101,7 +1101,7 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
return 0;
}
static int find_end_of_month(struct tm *tm, bool utc, int day) {
static int find_end_of_month(const struct tm *tm, bool utc, int day) {
struct tm t = *tm;
t.tm_mon++;
@ -1114,28 +1114,39 @@ static int find_end_of_month(struct tm *tm, bool utc, int day) {
return t.tm_mday;
}
static int find_matching_component(const CalendarSpec *spec, const CalendarComponent *c,
struct tm *tm, int *val) {
const CalendarComponent *p = c;
int start, stop, d = -1;
static int find_matching_component(
const CalendarSpec *spec,
const CalendarComponent *c,
const struct tm *tm, /* tm is only used for end-of-month calculations */
int *val) {
int d = -1, r;
bool d_set = false;
int r;
assert(val);
/* Finds the *earliest* matching time specified by one of the CalendarCompoment items in chain c.
* If no matches can be found, returns -ENOENT.
* Otherwise, updates *val to the matching time. 1 is returned if *val was changed, 0 otherwise.
*/
if (!c)
return 0;
while (c) {
start = c->start;
stop = c->stop;
bool end_of_month = spec->end_of_month && c == spec->day;
if (spec->end_of_month && p == spec->day) {
start = find_end_of_month(tm, spec->utc, start);
stop = find_end_of_month(tm, spec->utc, stop);
while (c) {
int start, stop;
if (end_of_month) {
start = find_end_of_month(tm, spec->utc, c->start);
stop = find_end_of_month(tm, spec->utc, c->stop);
if (stop > 0)
SWAP_TWO(start, stop);
} else {
start = c->start;
stop = c->stop;
}
if (start >= *val) {
@ -1184,15 +1195,18 @@ static int tm_within_bounds(struct tm *tm, bool utc) {
return negative_errno();
/* Did any normalization take place? If so, it was out of bounds before */
bool good = t.tm_year == tm->tm_year &&
t.tm_mon == tm->tm_mon &&
t.tm_mday == tm->tm_mday &&
t.tm_hour == tm->tm_hour &&
t.tm_min == tm->tm_min &&
t.tm_sec == tm->tm_sec;
if (!good)
int cmp = CMP(t.tm_year, tm->tm_year) ?:
CMP(t.tm_mon, tm->tm_mon) ?:
CMP(t.tm_mday, tm->tm_mday) ?:
CMP(t.tm_hour, tm->tm_hour) ?:
CMP(t.tm_min, tm->tm_min) ?:
CMP(t.tm_sec, tm->tm_sec);
if (cmp < 0)
return -EDEADLK; /* Refuse to go backward */
if (cmp > 0)
*tm = t;
return good;
return cmp == 0;
}
static bool matches_weekday(int weekdays_bits, const struct tm *tm, bool utc) {
@ -1210,6 +1224,10 @@ static bool matches_weekday(int weekdays_bits, const struct tm *tm, bool utc) {
return (weekdays_bits & (1 << k));
}
/* A safety valve: if we get stuck in the calculation, return an error.
* C.f. https://bugzilla.redhat.com/show_bug.cgi?id=1941335. */
#define MAX_CALENDAR_ITERATIONS 1000
static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
struct tm c;
int tm_usec;
@ -1223,7 +1241,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
c = *tm;
tm_usec = *usec;
for (;;) {
for (unsigned iteration = 0; iteration < MAX_CALENDAR_ITERATIONS; iteration++) {
/* Normalize the current date */
(void) mktime_or_timegm(&c, spec->utc);
c.tm_isdst = spec->dst;
@ -1320,6 +1338,14 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
*usec = tm_usec;
return 0;
}
/* It seems we entered an infinite loop. Let's gracefully return an error instead of hanging or
* aborting. This code is also exercised when timers.target is brought up during early boot, so
* aborting here is problematic and hard to diagnose for users. */
_cleanup_free_ char *s = NULL;
(void) calendar_spec_to_string(spec, &s);
return log_warning_errno(SYNTHETIC_ERRNO(EDEADLK),
"Infinite loop in calendar calculation: %s", strna(s));
}
static int calendar_spec_next_usec_impl(const CalendarSpec *spec, usec_t usec, usec_t *ret_next) {

View File

@ -2,11 +2,11 @@
#include "alloc-util.h"
#include "calendarspec.h"
#include "env-util.h"
#include "errno-util.h"
#include "string-util.h"
#include "util.h"
static void test_one(const char *input, const char *output) {
static void _test_one(int line, const char *input, const char *output) {
CalendarSpec *c;
_cleanup_free_ char *p = NULL, *q = NULL;
usec_t u;
@ -16,13 +16,13 @@ static void test_one(const char *input, const char *output) {
assert_se(calendar_spec_from_string(input, &c) >= 0);
assert_se(calendar_spec_to_string(c, &p) >= 0);
printf("\"%s\"\"%s\"\n", input, p);
log_info("line %d: \"%s\"\"%s\"", line, input, p);
assert_se(streq(p, output));
u = now(CLOCK_REALTIME);
r = calendar_spec_next_usec(c, u, &u);
printf("Next: %s\n", r < 0 ? strerror_safe(r) : format_timestamp(buf, sizeof(buf), u));
log_info("Next: %s", r < 0 ? strerror_safe(r) : format_timestamp(buf, sizeof buf, u));
calendar_spec_free(c);
assert_se(calendar_spec_from_string(p, &c) >= 0);
@ -31,8 +31,9 @@ static void test_one(const char *input, const char *output) {
assert_se(streq(q, p));
}
#define test_one(input, output) _test_one(__LINE__, input, output)
static void test_next(const char *input, const char *new_tz, usec_t after, usec_t expect) {
static void _test_next(int line, const char *input, const char *new_tz, usec_t after, usec_t expect) {
CalendarSpec *c;
usec_t u;
char *old_tz;
@ -43,22 +44,19 @@ static void test_next(const char *input, const char *new_tz, usec_t after, usec_
if (old_tz)
old_tz = strdupa(old_tz);
if (new_tz) {
char *colon_tz;
if (!isempty(new_tz))
new_tz = strjoina(":", new_tz);
colon_tz = strjoina(":", new_tz);
assert_se(setenv("TZ", colon_tz, 1) >= 0);
} else
assert_se(unsetenv("TZ") >= 0);
assert_se(set_unset_env("TZ", new_tz, true) == 0);
tzset();
assert_se(calendar_spec_from_string(input, &c) >= 0);
printf("\"%s\"\n", input);
log_info("line %d: \"%s\" new_tz=%s", line, input, strnull(new_tz));
u = after;
r = calendar_spec_next_usec(c, after, &u);
printf("At: %s\n", r < 0 ? strerror_safe(r) : format_timestamp_style(buf, sizeof buf, u, TIMESTAMP_US));
log_info("At: %s", r < 0 ? strerror_safe(r) : format_timestamp_style(buf, sizeof buf, u, TIMESTAMP_US));
if (expect != USEC_INFINITY)
assert_se(r >= 0 && u == expect);
else
@ -66,12 +64,10 @@ static void test_next(const char *input, const char *new_tz, usec_t after, usec_
calendar_spec_free(c);
if (old_tz)
assert_se(setenv("TZ", old_tz, 1) >= 0);
else
assert_se(unsetenv("TZ") >= 0);
assert_se(set_unset_env("TZ", old_tz, true) == 0);
tzset();
}
#define test_next(input, new_tz, after, expect) _test_next(__LINE__, input,new_tz,after,expect)
static void test_timestamp(void) {
char buf[FORMAT_TIMESTAMP_MAX];
@ -83,12 +79,12 @@ static void test_timestamp(void) {
x = now(CLOCK_REALTIME);
assert_se(format_timestamp_style(buf, sizeof(buf), x, TIMESTAMP_US));
printf("%s\n", buf);
assert_se(format_timestamp_style(buf, sizeof buf, x, TIMESTAMP_US));
log_info("%s", buf);
assert_se(calendar_spec_from_string(buf, &c) >= 0);
assert_se(calendar_spec_to_string(c, &t) >= 0);
calendar_spec_free(c);
printf("%s\n", t);
log_info("%s", t);
assert_se(parse_timestamp(t, &y) >= 0);
assert_se(y == x);
@ -104,11 +100,11 @@ static void test_hourly_bug_4031(void) {
n = now(CLOCK_REALTIME);
assert_se((r = calendar_spec_next_usec(c, n, &u)) >= 0);
printf("Now: %s (%"PRIu64")\n", format_timestamp_style(buf, sizeof buf, n, TIMESTAMP_US), n);
printf("Next hourly: %s (%"PRIu64")\n", r < 0 ? strerror_safe(r) : format_timestamp_style(buf, sizeof buf, u, TIMESTAMP_US), u);
log_info("Now: %s (%"PRIu64")", format_timestamp_style(buf, sizeof buf, n, TIMESTAMP_US), n);
log_info("Next hourly: %s (%"PRIu64")", r < 0 ? strerror_safe(r) : format_timestamp_style(buf, sizeof buf, u, TIMESTAMP_US), u);
assert_se((r = calendar_spec_next_usec(c, u, &w)) >= 0);
printf("Next hourly: %s (%"PRIu64")\n", r < 0 ? strerror_safe(r) : format_timestamp_style(zaf, sizeof zaf, w, TIMESTAMP_US), w);
log_info("Next hourly: %s (%"PRIu64")", r < 0 ? strerror_safe(r) : format_timestamp_style(zaf, sizeof zaf, w, TIMESTAMP_US), w);
assert_se(n < u);
assert_se(u <= n + USEC_PER_HOUR);
@ -209,15 +205,18 @@ int main(int argc, char* argv[]) {
test_next("2017-08-06 9..17/2:00 UTC", "", 1502029800000000, 1502031600000000);
test_next("2016-12-* 3..21/6:00 UTC", "", 1482613200000001, 1482634800000000);
test_next("2017-09-24 03:30:00 Pacific/Auckland", "", 12345, 1506177000000000);
// Due to daylight saving time - 2017-09-24 02:30:00 does not exist
/* Due to daylight saving time - 2017-09-24 02:30:00 does not exist */
test_next("2017-09-24 02:30:00 Pacific/Auckland", "", 12345, -1);
test_next("2017-04-02 02:30:00 Pacific/Auckland", "", 12345, 1491053400000000);
// Confirm that even though it's a time change here (backward) 02:30 happens only once
/* Confirm that even though it's a time change here (backward) 02:30 happens only once */
test_next("2017-04-02 02:30:00 Pacific/Auckland", "", 1491053400000000, -1);
test_next("2017-04-02 03:30:00 Pacific/Auckland", "", 12345, 1491060600000000);
// Confirm that timezones in the Spec work regardless of current timezone
/* Confirm that timezones in the Spec work regardless of current timezone */
test_next("2017-09-09 20:42:00 Pacific/Auckland", "", 12345, 1504946520000000);
test_next("2017-09-09 20:42:00 Pacific/Auckland", "EET", 12345, 1504946520000000);
/* Check that we don't start looping if mktime() moves us backwards */
test_next("Sun *-*-* 01:00:00 Europe/Dublin", "", 1616412478000000, 1617494400000000);
test_next("Sun *-*-* 01:00:00 Europe/Dublin", "IST", 1616412478000000, 1617494400000000);
assert_se(calendar_spec_from_string("test", &c) < 0);
assert_se(calendar_spec_from_string(" utc", &c) < 0);

View File

@ -1340,6 +1340,7 @@ install_zoneinfo() {
inst_any /usr/share/zoneinfo/Asia/Vladivostok
inst_any /usr/share/zoneinfo/Australia/Sydney
inst_any /usr/share/zoneinfo/Europe/Berlin
inst_any /usr/share/zoneinfo/Europe/Dublin
inst_any /usr/share/zoneinfo/Europe/Kiev
inst_any /usr/share/zoneinfo/Pacific/Auckland
inst_any /usr/share/zoneinfo/Pacific/Honolulu