Lennart Poettering [Wed, 31 Oct 2018 14:49:19 +0000 (15:49 +0100)]
core: split environment block mantained by PID 1's Manager object in two
This splits the "environment" field of Manager into two:
transient_environment and client_environment. The former is generated
from configuration file, kernel cmdline, environment generators. The
latter is the one the user can control with "systemctl set-environment"
and similar.
Both sets are merged transparently whenever needed. Separating the two
sets has the benefit that we can safely flush out the former while
keeping the latter during daemon reload cycles, so that env var settings
from env generators or configuration files do not accumulate, but
dynamic API changes are kept around.
Note that this change is not entirely transparent to users: if the user
first uses "set-environment" to override a transient variable, and then
uses "unset-environment" to unset it again things will revert to the
original transient variable now, while previously the variable was fully
removed. This change in behaviour should not matter too much though I
figure.
Fixes: #9972
Lennart Poettering [Wed, 31 Oct 2018 16:03:50 +0000 (17:03 +0100)]
strv: wrap strv_new() in a macro so that NULL sentinel is implicit
Lennart Poettering [Wed, 31 Oct 2018 14:15:41 +0000 (15:15 +0100)]
Merge pull request #10573 from faheel/master
Convert remaining docs to Markdown
welaq [Wed, 31 Oct 2018 13:53:46 +0000 (15:53 +0200)]
l10n: Add Lithuanian translation (#10590)
Create lt.po
Yu Watanabe [Wed, 31 Oct 2018 11:35:06 +0000 (20:35 +0900)]
po: drop my copyright
Lennart Poettering [Wed, 31 Oct 2018 11:10:12 +0000 (12:10 +0100)]
Merge pull request #10556 from yuwata/udev-event-cleanup-2
udev-event: several fixes for previous PR
Yu Watanabe [Wed, 31 Oct 2018 03:35:25 +0000 (12:35 +0900)]
network: also monitor udev 'change' event for network interfaces
If networkd starts earlier than all network interfaces are initialized,
then uninitialized interfaces are staying in pending state and cannot
become up.
With this, such interfaces are started after receiving 'change' event.
Joerg Behrmann [Tue, 30 Oct 2018 15:01:43 +0000 (16:01 +0100)]
core: apply WorkingDirectory after enforce_user
If WorkingDirectory is on NFS, root might only have the privileges of
nobody and the chdir to the WorkingDirectory might fail, even if the
user running the service would have the proper privileges to chdir to
that directory.
Fixes #10568
Alan Jenkins [Wed, 31 Oct 2018 09:49:29 +0000 (09:49 +0000)]
units: remove unused busnames.target
I found zero references to busnames.target, using git grep "busnames".
(And we do not install using a wildcard units/*.*. There is no
busnames.target installed on my Fedora 28 system).
Yu Watanabe [Wed, 31 Oct 2018 10:04:41 +0000 (19:04 +0900)]
Merge pull request #10586 from keszybz/more-copyright-and-license-cleanup
More copyright and license cleanup
Zbigniew Jędrzejewski-Szmek [Wed, 31 Oct 2018 08:29:11 +0000 (09:29 +0100)]
po: drop duplicate "This file is distributed under..." lines
The header already says "LGPL-2.1+", so there is no need to repeat
the same thing more ambiguously.
Zbigniew Jędrzejewski-Szmek [Wed, 31 Oct 2018 08:30:01 +0000 (09:30 +0100)]
Drop copyright for Marius Vollmer
Ack in #9320.
Zbigniew Jędrzejewski-Szmek [Wed, 31 Oct 2018 08:27:22 +0000 (09:27 +0100)]
Drop copyright for Piotr Drąg
Ack in #9320.
Also drop some lines with my name.
Muhammet Kara [Tue, 30 Oct 2018 21:20:03 +0000 (00:20 +0300)]
po: Update Turkish translation
Yu Watanabe [Mon, 29 Oct 2018 13:57:38 +0000 (22:57 +0900)]
dissect: do not store unused devnum
Yu Watanabe [Mon, 29 Oct 2018 13:37:14 +0000 (22:37 +0900)]
udev-event: fix timeout log messages
Follow-up for
e81c3a4c5fbbea89fe6c1e3d0ace669b8130aa92.
Yu Watanabe [Mon, 29 Oct 2018 13:45:14 +0000 (22:45 +0900)]
udev-event: do not store unused devnum
Yu Watanabe [Mon, 29 Oct 2018 03:38:40 +0000 (12:38 +0900)]
udev-event: check whether device has devnum before calling udev_node_remove()
This fixes a bug in 'remove' event handling, which was introduced by
eb1f9e30ec603ab34631cc3adba1def49485b505, as 'devnum' variable may
not be initialized.
scootergrisen [Wed, 31 Oct 2018 00:10:06 +0000 (01:10 +0100)]
danish to Danish (#10584)
Piotr Drąg [Mon, 29 Oct 2018 15:44:07 +0000 (16:44 +0100)]
catalog: update Polish translation
Zbigniew Jędrzejewski-Szmek [Tue, 30 Oct 2018 22:55:39 +0000 (23:55 +0100)]
Merge pull request #10569 from poettering/various-doc-fixes
various man page fixes
Faheel Ahmad [Tue, 30 Oct 2018 17:31:20 +0000 (23:01 +0530)]
docs: Update links to updated docs
Insun [Sun, 28 Oct 2018 12:26:13 +0000 (21:26 +0900)]
core: don't drop timer expired but not yet processed when system date is changed
There is difference between time set by the user and real elapsed time because of accuracy feature.
If you change the system date(or time) between these times, the timer drops.
You can easily reproduce it with the following command.
-----------------------------------------------------------
$ systemd-run --on-active=3s ls; sleep 3; date -s "`date`"
-----------------------------------------------------------
In the following command, the problem is rarely reproduced. But it exists.
---------------------------------------------------------------------------------------------
$ systemd-run --on-active=3s --timer-property=AccuracySec=1us ls ; sleep 1; date -s "`date`"
---------------------------------------------------------------------------------------------
Note : Global AccuracySec value.
----------------------------------------------------------------------
$ cat /etc/systemd/system.conf
DefaultTimerAccuracySec=1min
----------------------------------------------------------------------
Lennart Poettering [Tue, 30 Oct 2018 14:36:52 +0000 (15:36 +0100)]
Merge pull request #10559 from yuwata/sd-device-prototype-change
sd-device: change prototype of sd_device_get_is_initialized()
Lennart Poettering [Mon, 29 Oct 2018 20:09:57 +0000 (21:09 +0100)]
man: document what "in-memory" units means
Fixes: #10338
Lennart Poettering [Mon, 29 Oct 2018 19:49:41 +0000 (20:49 +0100)]
man: document that "list-dependencies --reverse" is pretty incomplete
Fixes: #9681
Lennart Poettering [Mon, 29 Oct 2018 19:45:04 +0000 (20:45 +0100)]
man: emphasize the ReadOnlyPaths= mount propagation "hole"
This changes the ProtectSystem= documentation to refer in more explicit
words to the restrictions of ReadOnlyPath=, as sugegsted in #9857.
THis also extends the paragraph in ReadOnlyPath= that explains the hole.
Fixes: #9857
Lennart Poettering [Mon, 29 Oct 2018 19:24:06 +0000 (20:24 +0100)]
man: document that various sandboxing settings are not available in --user services
This is brief and doesn't go into detail, but should at least indicate
to those searching for it that some stuff is not available.
Fixes: #9870
Lennart Poettering [Mon, 29 Oct 2018 19:20:37 +0000 (20:20 +0100)]
man: document relationship of .socket units and network namespaces
Fixes: #10018
Lennart Poettering [Mon, 29 Oct 2018 19:07:22 +0000 (20:07 +0100)]
man: don't claim that AssertXYZ= expressions failing had an effect on unit state
In the documentation for ConditionXYZ= we claimed that AssertXYZ= would
have an effect on unit state (which is wrong), while at the
documentation for AssertXYZ= we said it only has an effect on the job,
but not the unit (which is right). Let's fix this contradiction, and
only claim the latter.
Also, fix a couple of other things (for example, stop talking about a
"failure state", but let's just expressly called it "the 'failed' state",
as that's the actual name of that state.
Finally, let's emphasize again when the conditions/assertions are
executed, and that they hence are not useful to conditionalize deps.
Fixes: #10433
Lennart Poettering [Mon, 29 Oct 2018 18:55:27 +0000 (19:55 +0100)]
man: document that "systemctl reset-failed" also reset the start limit counters
Fixes: #10529
Franck Bui [Tue, 30 Oct 2018 07:05:02 +0000 (08:05 +0100)]
core: skip unit deserialization and move to the next one when unit_deserialize() fails
If unit_deserialize() fails (because one read line is overly long), it returns
an error and we would have assumed that the next read would point to the next
unit to deserialize.
But instead unit_deserialize() can leave the file offset in the middle of a
line.
Therefore we need to ignore and skip the current unit in this case too.
While at it, move unit deserialization in a dedicated functions. That should
make the code easier to read.
Lennart Poettering [Tue, 30 Oct 2018 13:51:55 +0000 (14:51 +0100)]
Merge pull request #10563 from keszybz/lz4-quickfix-quickfix
journal: adapt for new improved LZ4_decompress_safe_partial()
Faheel Ahmad [Tue, 30 Oct 2018 10:28:58 +0000 (15:58 +0530)]
docs: Convert HACKING to Markdown
Also fix minor grammatical errors
Faheel Ahmad [Tue, 30 Oct 2018 10:28:44 +0000 (15:58 +0530)]
docs: Convert CODING_STYLE to Markdown
Also fix minor grammatical errors
Zbigniew Jędrzejewski-Szmek [Tue, 30 Oct 2018 08:02:26 +0000 (09:02 +0100)]
fuzz-compress: add fuzzer for compression and decompression
Zbigniew Jędrzejewski-Szmek [Mon, 29 Oct 2018 13:55:33 +0000 (14:55 +0100)]
journal: adapt for new improved LZ4_decompress_safe_partial()
With lz4 1.8.3, this function can now decompress partial results into a smaller
buffer. The release news don't say anything interesting, but the test case that
was previously failing now works OK.
Fixes #10259.
A test is added. It shows that with *older* lz4, a partial decompression can
occur with the returned size smaller then the requested number of bytes _and_
smaller then the size of the compressed data:
(lz4-libs-1.8.2-1.fc29.x86_64)
Compressed 4194304 → 16464
Decompressed → 4194304
Decompressed partial 12/4194304 → 4194304
Decompressed partial 1/1 → -2 (bad)
Decompressed partial 2/2 → -2 (bad)
Decompressed partial 3/3 → -2 (bad)
Decompressed partial 4/4 → -2 (bad)
Decompressed partial 5/5 → -2 (bad)
Decompressed partial 6/6 → 6 (good)
Decompressed partial 7/7 → 6 (good)
Decompressed partial 8/8 → 6 (good)
Decompressed partial 9/9 → 6 (good)
Decompressed partial 10/10 → 6 (good)
Decompressed partial 11/11 → 6 (good)
Decompressed partial 12/12 → 6 (good)
Decompressed partial 13/13 → 6 (good)
Decompressed partial 14/14 → 6 (good)
Decompressed partial 15/15 → 6 (good)
Decompressed partial 16/16 → 6 (good)
Decompressed partial 17/17 → 6 (good)
Decompressed partial 18/18 → -16459 (bad)
(lz4-libs-1.8.3-1.fc29.x86_64)
Compressed 4194304 → 16464
Decompressed → 4194304
Decompressed partial 12/4194304 → 12
Decompressed partial 1/1 → 1 (good)
Decompressed partial 2/2 → 2 (good)
Decompressed partial 3/3 → 3 (good)
Decompressed partial 4/4 → 4 (good)
...
If we got such a short "successful" decompression in decompress_startswith() as
implemented before this patch, we could be confused and return a false negative
result. But it turns out that this only occurs with small output buffer
sizes. We use greedy_realloc() to manager the buffer, so it is always at least
64 bytes. I couldn't hit a case where decompress_startswith() would actually
return a bogus result. But since the lack of proof is not conclusive, the code
for *older* lz4 is changed too, just to be safe. We cannot rule out that on a
different architecture or with some unlucky compressed string we could hit this
corner case.
The fallback code is guarded by a version check. The check uses a function not
the compile-time define, because there was no soversion bump in lz4 or new
symbols, and we could be compiled against a newer lz4 and linked at runtime
with an older one. (This happens routinely e.g. when somebody upgrades a subset
of distro packages.)
Bastien Nocera [Mon, 29 Oct 2018 13:31:39 +0000 (13:31 +0000)]
hwdb: Apply the same quirk to all the lis3lv02d devices
HP laptops and desktop containing the lis3lv02d device (as supported by
the drivers/platform/x86/hp_accel.c driver) are supposed to output their
values according to their "standard" orientation, one that
corresponds to "can play neverball".
For all those devices, we need to convert that "neverball" orientation
to a "Windows 8" orientation. We will not accept quirks for HP machines
that use the lis3lv02d device, they should go in the hp_accel.c driver
instead.
Closes: #5160
Peter Hutterer [Mon, 29 Oct 2018 03:45:45 +0000 (13:45 +1000)]
hwdb: add a click angle entry for the Logitech MX Anywhere 2s
Zbigniew Jędrzejewski-Szmek [Mon, 29 Oct 2018 21:21:28 +0000 (22:21 +0100)]
test-compress: add test for short decompress_startswith calls
I thought this might fail with lz4 < 1.8.3, but it seems that because of
greedy_realloc, we always use a buffer that is large enough, and it always
passes.
Yu Watanabe [Mon, 29 Oct 2018 22:54:20 +0000 (07:54 +0900)]
Merge pull request #10564 from evverx/lldp-fuzzer
tests: add an lldp fuzzer
Zbigniew Jędrzejewski-Szmek [Mon, 29 Oct 2018 17:32:51 +0000 (18:32 +0100)]
Drop support for lz4 < 1.3.0
lz4-r130 was released on May 29th, 2015. Let's drop the work-around for older
versions. In particular, we won't test any new code against those ancient
releases, so we shouldn't pretend they are supported.
dkg [Mon, 29 Oct 2018 17:28:11 +0000 (13:28 -0400)]
doc: spell initramfs properly (#10566)
Evgeny Vereshchagin [Mon, 29 Oct 2018 15:24:16 +0000 (15:24 +0000)]
tests: add an lldp fuzzer
I went through my antique collection of fuzzers the other day
to see which ones I hadn't sent upstream yet. This one
seems to be nice to have and ready to be merged. As far as I can
tell, it hasn't managed to find anything useful yet,
but it's better to be safe than sorry especially when it comes to networking
code :-)
Evgeny Vereshchagin [Mon, 29 Oct 2018 15:21:58 +0000 (15:21 +0000)]
journal: drop an unused variable clang is complaining about
../../src/systemd/src/journal/journal-file.c:3592:30: warning: unused variable 'p' [-Wunused-variable]
_cleanup_free_ char *p = NULL;
^
1 warning generated.
This is a follow-up to
681276589159fa08e0a.
TJ [Mon, 29 Oct 2018 02:06:03 +0000 (02:06 +0000)]
hwdb: Add Asus T300CHI accelerator matrix
Yu Watanabe [Mon, 29 Oct 2018 08:32:21 +0000 (17:32 +0900)]
sd-device: make sd_device_get_is_initialized() returns is_initialized by return value
Yu Watanabe [Mon, 29 Oct 2018 08:17:57 +0000 (17:17 +0900)]
sd-device: make several sd_device_get_*() accepts NULL pointer for buffer of returned value
When only the existence of the value are important, then we can set
NULL now.
Yu Watanabe [Mon, 29 Oct 2018 03:03:27 +0000 (12:03 +0900)]
Merge pull request #10551 from keszybz/two-trivial-cleanups
Two trivial cleanups
Yu Watanabe [Mon, 29 Oct 2018 01:41:35 +0000 (10:41 +0900)]
util: do not assign return value if it is not used (#10552)
Zbigniew Jędrzejewski-Szmek [Sun, 28 Oct 2018 22:28:34 +0000 (23:28 +0100)]
test-chown-rec: use logging helper here too
Zbigniew Jędrzejewski-Szmek [Sun, 28 Oct 2018 17:27:48 +0000 (18:27 +0100)]
test-network-tables: remove duplicate line
Zbigniew Jędrzejewski-Szmek [Sun, 28 Oct 2018 12:00:14 +0000 (13:00 +0100)]
Merge pull request #10512 from yuwata/udev-event-cleanup
udev-event: replace udev_device by sd_device
Piotr Drąg [Fri, 26 Oct 2018 19:18:15 +0000 (21:18 +0200)]
po: update Polish translation
Dave Reisner [Sat, 27 Oct 2018 03:46:49 +0000 (23:46 -0400)]
curl-util: fix error code check from curl_multi_socket_action
After curl 7.20.0, this function never returns negative error codes.
Make this consistent with the other call to this function and only
compare against CURLM_OK.
Yu Watanabe [Fri, 26 Oct 2018 22:42:11 +0000 (07:42 +0900)]
po: update Japanese translation
Yu Watanabe [Fri, 26 Oct 2018 22:49:28 +0000 (07:49 +0900)]
Merge pull request #10537 from poettering/sentinelimania
add some missing _sentinel_ decorators
Yu Watanabe [Thu, 25 Oct 2018 04:59:03 +0000 (13:59 +0900)]
udev-event: replace udev_device in subst_format_var() by sd_device
Yu Watanabe [Thu, 25 Oct 2018 05:00:36 +0000 (14:00 +0900)]
udev-event: drop prototype of nonexistent function
Yu Watanabe [Thu, 25 Oct 2018 04:07:09 +0000 (13:07 +0900)]
udev-event: move definition of struct subst_map
Yu Watanabe [Thu, 25 Oct 2018 02:14:11 +0000 (11:14 +0900)]
udev-event: replace udev_device in udev_event_execute_rules() by sd_device
Also, this adds many logs.
Yu Watanabe [Thu, 25 Oct 2018 01:32:35 +0000 (10:32 +0900)]
udev-event: move devnode handling logic to a new function
Also, replace udev_device by sd_device.
Yu Watanabe [Wed, 24 Oct 2018 22:45:48 +0000 (07:45 +0900)]
udev-event: move conditions to rename network interface into rename_netif()
Also, replace udev_device by sd_device.
Yu Watanabe [Wed, 24 Oct 2018 22:04:59 +0000 (07:04 +0900)]
udev-event: rename udev_event_unref() to udev_event_free()
As struct udev_event does not have a reference counter.
Yu Watanabe [Wed, 24 Oct 2018 22:03:24 +0000 (07:03 +0900)]
udev-event: fix memleak in udev_event
The leak was introduced by
29448498c724da7ade1b5efb20d7472c1b128d2c.
Yu Watanabe [Wed, 24 Oct 2018 22:02:03 +0000 (07:02 +0900)]
udev-event: use structured initializer at one more place
Yu Watanabe [Wed, 24 Oct 2018 21:39:48 +0000 (06:39 +0900)]
udev-event: add more assert()
Yu Watanabe [Wed, 24 Oct 2018 21:35:16 +0000 (06:35 +0900)]
udev-event: check command is not empty before executing
Yu Watanabe [Wed, 24 Oct 2018 21:33:26 +0000 (06:33 +0900)]
udev-event: include device name in error message one more place
Yu Watanabe [Thu, 25 Oct 2018 01:09:19 +0000 (10:09 +0900)]
network,udev: drop unnecessary check whether ifindex is positive
As sd_device_get_ifindex() now returns positive ifindex when it
succeeds.
Yu Watanabe [Thu, 25 Oct 2018 01:04:19 +0000 (10:04 +0900)]
test: check sd_device_get_ifindex() returns positive ifindex when it succeeds
Yu Watanabe [Thu, 25 Oct 2018 00:56:15 +0000 (09:56 +0900)]
sd-device: return positive ifindex when sd_device_get_ifindex() succeeds
As valid ifindex is positive value, not non-negative value.
Follow-up for
dcfbde3a43d632ff6e286c77e1081087eca59d8e.
Lennart Poettering [Fri, 26 Oct 2018 18:16:50 +0000 (20:16 +0200)]
Merge pull request #10506 from poettering/cgroup-mini-fixes
various cgroups mini fixes
Lennart Poettering [Fri, 26 Oct 2018 17:33:10 +0000 (19:33 +0200)]
core: add free_and_replace() at one more place
Lennart Poettering [Fri, 26 Oct 2018 17:32:43 +0000 (19:32 +0200)]
tree-wide: add a few missing _sentinel_ decorators
Lennart Poettering [Fri, 26 Oct 2018 13:31:30 +0000 (15:31 +0200)]
cgroup-util: make definition of CGROUP_CONTROLLER_TO_MASK() unsigned
Otherwise doing comparing a CGroupMask (which is unsigned in effect)
with the result of CGROUP_CONTROLLER_TO_MASK() will result in warnings
about signedness differences.
Lennart Poettering [Fri, 26 Oct 2018 13:25:21 +0000 (15:25 +0200)]
cgroup-util: FLAGS_SET()ify all things
Lennart Poettering [Wed, 24 Oct 2018 15:35:19 +0000 (17:35 +0200)]
cgroup: when discovering which controllers the kernel supports mask with what we support
Let's use our new CGROUP_MASK_V1 and CGROUP_MASK_V2 definitions for
this.
Lennart Poettering [Wed, 24 Oct 2018 15:31:51 +0000 (17:31 +0200)]
cgroup-util: before operating on a mounted cgroup controller check if it actually can be mounted
We now have the "BPF" pseudo-controllers. These should never be assumed
to be accessible as /sys/fs/cgroup/<controller> and not through
"cgroup.subtree_control" either, hence always check explicitly before we
go to the file system. We do this through our new CGROUP_MASK_V1 and
CGROUP_MASK_V2 definitions.
Lennart Poettering [Wed, 24 Oct 2018 15:30:46 +0000 (17:30 +0200)]
cgroup-util: add mask definitions for sets of controllers supported by cgroupsv1 vs. cgroupsv2
Lennart Poettering [Wed, 24 Oct 2018 15:28:17 +0000 (17:28 +0200)]
cgroup-util: disable buffering for cg_enable_everywhere() when writing to cgroup attributes
Let's better be safe than sorry.
Lennart Poettering [Wed, 24 Oct 2018 15:25:51 +0000 (17:25 +0200)]
cgroup-util: don't expect cg_mask_from_string()'s return value to be initialized
Also, when we fail, don't clobber the return value.
This brings the call more in-line with our usual coding style, and
removes surprises.
None of the callers seemed to care about this behaviour.
Lennart Poettering [Wed, 24 Oct 2018 15:25:11 +0000 (17:25 +0200)]
cgroup-util: debug log if /proc/self/ns/cgroup is not available for unexpected reasons
Lennart Poettering [Fri, 26 Oct 2018 15:56:43 +0000 (17:56 +0200)]
Merge pull request #10536 from keszybz/serialize-fixes
Tests for the new serialization functions
Lennart Poettering [Fri, 26 Oct 2018 14:26:20 +0000 (16:26 +0200)]
Merge pull request #10517 from poettering/chown-rec-fixes
recursive chowning fixes
Lennart Poettering [Fri, 19 Oct 2018 09:31:37 +0000 (11:31 +0200)]
test: add test case for recursive chown()ing
Lennart Poettering [Fri, 19 Oct 2018 09:42:11 +0000 (11:42 +0200)]
chown-recursive: TAKE_FD() is your friend
Lennart Poettering [Fri, 19 Oct 2018 09:28:40 +0000 (11:28 +0200)]
chown-recursive: also drop ACLs when recursively chown()ing
Let's better be safe than sorry and also drop ACLs.
Lennart Poettering [Fri, 19 Oct 2018 09:26:59 +0000 (11:26 +0200)]
chown-recursive: let's rework the recursive logic to use O_PATH
That way we can pin a specific inode and analyze it and manipulate it
without it being swapped out beneath our hands.
Fixes a vulnerability originally found by Jann Horn from Google.
CVE-2018-15687
LP: #1796692
https://bugzilla.redhat.com/show_bug.cgi?id=1639076
Evgeny Vereshchagin [Fri, 26 Oct 2018 10:25:36 +0000 (10:25 +0000)]
lgtm: drop redundant newlines
Lennart Poettering [Fri, 26 Oct 2018 12:50:17 +0000 (14:50 +0200)]
Merge pull request #10508 from poettering/watchdog-original-fix
various service watchdog fixes
Lennart Poettering [Fri, 26 Oct 2018 12:49:53 +0000 (14:49 +0200)]
Merge pull request #10534 from poettering/cmdline-fixlets
proc-cmdline.c fixlets
Zbigniew Jędrzejewski-Szmek [Fri, 26 Oct 2018 10:30:04 +0000 (12:30 +0200)]
Move tests for *serialize_environment into test-serialize.c
The implementation is in serialize.c.
Zbigniew Jędrzejewski-Szmek [Fri, 26 Oct 2018 11:17:44 +0000 (13:17 +0200)]
test-serialize: allocate long_string dynamically
Lennart Poettering [Wed, 24 Oct 2018 17:04:41 +0000 (19:04 +0200)]
service: when starting a service make a copy of the watchdog timeout and use that
When we start a service process we pass the selected watchdog timeout to
it with the $WATCHDOG_USEC environment variable. If the unit file is
reconfigured later, we need to make sure to continue to honour the
original timeout, i.e. watch $WATCHDOG_USEC was set to, otherwise we'll
expect the ping at a different time as the service process is sending it
to us.
Hence, whenever we start a unit, save the watchdog timeout, and stick to
that for everything we do.
Fixes: #9467
Lennart Poettering [Wed, 24 Oct 2018 17:03:41 +0000 (19:03 +0200)]
service: continue to use the overriden timeout when forking off again
Let's make sure we always use the right watchdog timeout: when a service
has overwritten it, then stick to it, also for follow-up processes of
the same service.
Lennart Poettering [Wed, 24 Oct 2018 17:03:04 +0000 (19:03 +0200)]
service: rename service_reset_watchdog_timeout() → service_override_watchdog_timeout()
This is what the function really does, hence name it that way.
Lennart Poettering [Wed, 24 Oct 2018 17:02:13 +0000 (19:02 +0200)]
service: rework service_extend_timeout()
Let's unify common code: let's extend the watchdog timeout and the
regular timeout with the same helper function.
Zbigniew Jędrzejewski-Szmek [Tue, 23 Oct 2018 10:00:31 +0000 (12:00 +0200)]
test-serialize: a smoke test for the serialization functions
Zbigniew Jędrzejewski-Szmek [Tue, 23 Oct 2018 08:50:38 +0000 (10:50 +0200)]
test: _cleanup_(unlink_tempfilep) in two more places