Lennart Poettering [Thu, 5 May 2016 11:45:18 +0000 (13:45 +0200)]
core: fix owner user/group output in socket dump
The unit file settings are called SocketUser= and SocketGroup= hence name these
fields that way in the "systemd-analyze dump" output too.
https://github.com/systemd/systemd/issues/3171#issuecomment-
216216995
Lennart Poettering [Thu, 5 May 2016 11:39:31 +0000 (13:39 +0200)]
core: change default trigger limits for socket units
Let's lower the default values a bit, and pick different defaults for
Accept=yes and Accept=no sockets.
Fixes: #3167
Thomas H. P. Andersen [Thu, 5 May 2016 09:15:46 +0000 (11:15 +0200)]
Trivial network cleanup (#3196)
* gitignore: typo fix for test-networkd-conf
* networkd: fix double include
Lennart Poettering [Wed, 4 May 2016 09:31:59 +0000 (11:31 +0200)]
Merge pull request #3156 from keszybz/duid-settings
Rework DUID setting
Torstein Husebø [Wed, 4 May 2016 09:26:17 +0000 (11:26 +0200)]
treewide: fix typos (#3187)
Lennart Poettering [Wed, 4 May 2016 08:46:13 +0000 (10:46 +0200)]
Merge pull request #3170 from poettering/v230-preparation-fixes
make virtualization detection quieter, rework unit start limit logic, detect unit file drop-in changes correctly, fix autofs state propagation
Franck Bui [Tue, 3 May 2016 23:29:11 +0000 (01:29 +0200)]
tmpfiles: don't set the x bit for volatile system journal when ACL support is enabled (#3079)
When ACL support is enabled, systemd-tmpfiles-setup service sets the following
ACL entries to the volatile system journal:
$ getfacl /run/log/journal/*/system.journal
getfacl: Removing leading '/' from absolute path names
# file: run/log/journal/xxx/system.journal
# owner: root
# group: systemd-journal
user::rwx
group::r--
group:wheel:r-x
group:adm:r-x
mask::r-x
other::---
This patch makes sure that the exec bit is not set anymore for the volatile
system journals.
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 23:22:22 +0000 (19:22 -0400)]
Merge pull request #3185 from NetworkManager/lr/unhappy-trie
Fix incorrect string deduplication in udev
Lubomir Rintel [Tue, 3 May 2016 20:15:49 +0000 (22:15 +0200)]
strbuf: set the proper character when creating new nodes
Commit
82501b3fc added an early break when a terminal node is found to
incorrect place -- before setting c. This caused trie to be built that
does not correspond to what it points to in buffer, causing incorrect
deduplications:
# cat /etc/udev/rules.d/99-bug.rules
ENV{FOO}=="0"
ENV{xx0}=="BAR"
ENV{BAZ}=="00"
# udevadm test
* RULE /etc/udev/rules.d/99-bug.rules:1, token: 0, count: 2, label: ''
M ENV match 'FOO' '0'(plain)
* RULE /etc/udev/rules.d/99-bug.rules:2, token: 2, count: 2, label: ''
M ENV match 'xx0' 'BAR'(plain)
* RULE /etc/udev/rules.d/99-bug.rules:3, token: 4, count: 2, label: ''
M ENV match 'BAZ' 'x0'(plain)
* END
The addition of "xx0" following "0" will cause a trie like this to be
created:
c=\0
c=0 "0"
c=0 "xx0" <-- note the c is incorrect here, causing "00" to be
c=O "FOO" deduplicated to it
c=R "BAR"
This in effect caused the usb_modeswitch rule for Huawei modems to never
match and this never be switched to serial mode from mass storage.
Lubomir Rintel [Tue, 3 May 2016 20:29:03 +0000 (22:29 +0200)]
udev: fix build with DEBUG=1
Alternatively, this could perhaps be removed since it was broken for a
long time and noone seemed to care.
But it was helpful for me today.
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 20:24:09 +0000 (16:24 -0400)]
Merge pull request #3183 from crawford/preset-array
install: cache the presets before evaluating
Susant Sahani [Tue, 3 May 2016 19:54:26 +0000 (01:24 +0530)]
networkd: Add support to configure IPv6 preferred lifetime (#3102)
Closes #2166.
We only allow 0, infinity and forever.
infinity and forever is same.
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 19:50:21 +0000 (15:50 -0400)]
Merge pull request #3132 from ssahani/route-table
networkd: add support to set route table
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:50:43 +0000 (14:50 -0400)]
Merge pull request #3173 from poettering/dnssec-incapdns-fix
Dnssec incapdns fix
Alex Crawford [Thu, 28 Apr 2016 06:59:20 +0000 (23:59 -0700)]
install: cache the presets before evaluating
The previous implementation traversed the various config directories,
walking the preset files and parsing each line to determine if a service
should be enabled or disabled. It did this for every service which
resulted in many more file operations than neccessary.
This approach parses each of the preset entries into an array which is
then used to check if each service should be enabled or disabled.
Lennart Poettering [Tue, 12 Apr 2016 11:51:28 +0000 (13:51 +0200)]
test-dnssec: drop unused variable
(zjs: the tree is now back to
0b2abe0f034f7f2d8654adb11b516d1090ec9a9c.)
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:08:39 +0000 (14:08 -0400)]
Merge pull request #2921 from keszybz/do-not-report-masked-units-as-changed
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:08:23 +0000 (14:08 -0400)]
Revert "Do not report masked units as changed (#2921)"
This reverts commit
6d10d308c6cd16528ef58fa4f5822aef936862d3.
It got squashed by mistake.
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:08:16 +0000 (14:08 -0400)]
Revert "test-dnssec: drop unused variable"
This reverts commit
0bed31c1038c439cc5956fb44017ba28e503095b.
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 17:49:20 +0000 (13:49 -0400)]
Merge pull request #3111 from poettering/nspawn-remove-veth
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 17:46:40 +0000 (13:46 -0400)]
Revert "nspawn: explicitly remove veth links after use (#3111)"
This reverts commit
d2773e59de3dd970d861e9f996bc48de20ef4314.
Merge got squashed by mistake.
Susant Sahani [Tue, 3 May 2016 17:48:21 +0000 (23:18 +0530)]
networkd: add support to set route table
networkd: add support to set route table
1. add support to configure the table id.
if id is less than 256 we can fit this in the header of route as
netlink property is a char. But in kernel this proepty is a
unsigned 32. Hence if greater that 256 add this as RTA_TABLE
attribute.
2. we are not setting the address family now. Now set this property.
Susant Sahani [Tue, 3 May 2016 17:17:48 +0000 (22:47 +0530)]
sd-netlink: introduce route attribute set API
Introduce
1. sd_rtnl_message_route_set_table to set table ID
2. sd_rtnl_message_route_set_family to set family
Both required to configure route properties.
Susant Sahani [Tue, 3 May 2016 17:16:50 +0000 (22:46 +0530)]
sd-netlink: fix sd_netlink_message_append_data
Also remove the braces add_rtattr not required.
Zbigniew Jędrzejewski-Szmek [Sun, 1 May 2016 04:59:49 +0000 (00:59 -0400)]
network: get rid of DUID_TYPE_RAW
It wasn't used for anything after the recent changes.
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 00:16:55 +0000 (20:16 -0400)]
man: add a description of DUIDType and DUIDRawData
This is essentially a revert of
f38e0cce75ff2ffbd99f7e382ed39c160bb7d799 (which
removed the documentation of DUIDType on purpose). The description is heavily
updated for the new semantics.
This addresses #3127 § 4.
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 23:08:37 +0000 (19:08 -0400)]
man: s/similar/similarly/
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 22:46:53 +0000 (18:46 -0400)]
test-networkd-conf: add tests for the parsing functions
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 03:23:45 +0000 (23:23 -0400)]
networkd: rework duid_{type,duid_type,duid,duid_len} setting
Separate fields are replaced with a struct.
Second second duid type field is removed. The first field was used to carry
the result of DUIDType= configuration, and the second was either a copy of
this, or contained the type extracted from DuidRawData. The semantics are changed
so that the type specified in DUIDType is always used. DUIDRawData= no longer
overrides the type setting.
The networkd code is now more constrained than the sd-dhcp code:
DUIDRawData cannot have 0 length, length 0 is treated the same as unsetting.
Likewise, it is not possible to set a DUIDType=0. If it ever becomes necessary
to set type=0 or a zero-length duid, the code can be changed to support that.
Nevertheless, I think that's unlikely.
This addresses #3127 § 1 and 3.
v2:
- rename DUID.duid, DUID.duid_len to DUID.raw_data, DUID.raw_data_len
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 01:18:11 +0000 (21:18 -0400)]
dh-dhcp{,6}-client: change the semantics of DUID setting
Both versions of the code are changed to allow the caller to override
DUID using simple rules: duid type and value may be specified, in
which case the caller is responsible to providing the contents,
or just duid type may be specified as DUID_TYPE_EN, in which case we
we fill in the values. In the future more support for other types may
be added, e.g. DUID_TYPE_LLT.
There still remains and ugly discrepancy between dhcp4 and dhcp6 code:
dhcp6 has sd_dhcp6_client_set_duid and sd_dhcp6_client_set_iaid and
requires client->state to be DHCP6_STATE_STOPPED, while dhcp4 has
sd_dhcp_client_set_iaid_duid and will reconfigure the client if it
is not stopped. This commit doesn't touch that part.
This addresses #3127 § 2.
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 01:18:02 +0000 (21:18 -0400)]
dhcp-identifier: un-inline dhcp_validate_duid_len
After all it is used in more than one place and is not that short.
Also tweak the test a bit:
- do not check that duid_len > 0, because we want to allow unknown
duid types, and there might be some which are fine with 0 length data,
(also assert should not be called from library code),
- always check that duid_len <= MAX_DUID_LEN, because we could overwrite
available buffer space otherwise.
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 16:08:56 +0000 (12:08 -0400)]
sd-dhcp: change uint8_t *duid to const void*
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 15:52:44 +0000 (11:52 -0400)]
sd-dhcp{,6}-client: use standard indentation for functions args
Evgeny Vereshchagin [Tue, 3 May 2016 09:43:22 +0000 (12:43 +0300)]
tests: add test for #3166 (#3180)
Evgeny Vereshchagin [Tue, 3 May 2016 09:33:38 +0000 (12:33 +0300)]
man: rename TriggerLimitIntervalBurst to TriggerLimitBurst (#3181)
[/etc/systemd/system/test.socket:2] Unknown lvalue 'TriggerLimitIntervalBurst' in section 'Socket'
Follow-up for
8b26cdbd2a94
Sylvain Plantefève [Mon, 2 May 2016 23:43:37 +0000 (01:43 +0200)]
locale: Language fallbacks for fr_(BE|CA|CH|LU) to fr_FR (#3178)
Lennart Poettering [Mon, 2 May 2016 18:40:54 +0000 (20:40 +0200)]
Merge pull request #3162 from keszybz/alias-refusal
Refuse Alias, DefaultInstance, templated units in install (as appropriate)
Zbigniew Jędrzejewski-Szmek [Mon, 2 May 2016 17:56:07 +0000 (13:56 -0400)]
Merge pull request #3153 from poettering/async-clone
machined: make "clone" asynchronous, and support copy-based fall-back
Lennart Poettering [Mon, 2 May 2016 16:35:09 +0000 (18:35 +0200)]
update TODO
Lennart Poettering [Mon, 2 May 2016 16:29:28 +0000 (18:29 +0200)]
resolved: work around broken DNS zones set up by incapdns.net
incapdns.net returns NXDOMAIN for the SOA of the zone itself but is not a
terminal. This is against the specs, but we really should be able to deal with
this.
Previously, when verifying whether an NXDOMAIN response for a SOA/NS lookup is
rightfully unsigned we'd issue a SOA lookup for the parent's domain, to derive
the state from that. If the parent SOA would get an NXDOMAIN, we'd continue
upwards, until we hit a signed top-level domain, which suggests that the domain
actually exists.
With this change whenver we need to authenticate an NXDOMAIN SOA reply, we'll
request the DS RR for the zone first, and use for validation, since that this
must be from the parent's zone, not the incorrect lower zone.
Fixes: #2894
Lennart Poettering [Mon, 2 May 2016 15:12:35 +0000 (17:12 +0200)]
automount: move resetting of expiry timeout to automount_set_state()
that way we can be sure that there's no expiry timeout in place at any time
when we aren't in the RUNNING state.
Lennart Poettering [Mon, 2 May 2016 14:51:45 +0000 (16:51 +0200)]
automount: rework propagation between automount and mount units
Port the progagation logic to the generic Unit->trigger_notify() callback logic
in the unit vtable, that is called for a unit not only when the triggered unit
of it changes state but also when a job for that unit finishes. This, firstly
allows us to make the code a bit cleaner and more generic, but more
importantly, allows us to notice correctly when a mount job fails, and
propagate that back to autofs client processes.
Fixes: #2181
Lennart Poettering [Mon, 2 May 2016 14:41:41 +0000 (16:41 +0200)]
core: don't propagate service state to sockets as long as there's still a job for the service queued
Lennart Poettering [Mon, 2 May 2016 14:02:02 +0000 (16:02 +0200)]
fstab-generator: add newline before we start a new unit file section
We already did this for the [Mount] section, let's do the same for [Automount].
Lennart Poettering [Mon, 2 May 2016 14:01:39 +0000 (16:01 +0200)]
automount: add debug message when we get notified about mount state changes
Lennart Poettering [Mon, 2 May 2016 14:01:16 +0000 (16:01 +0200)]
core: remove duplicate code in automount_update_mount()
Also, fix indentation.
Lennart Poettering [Mon, 2 May 2016 13:07:40 +0000 (15:07 +0200)]
core: simplify unit_need_daemon_reload() a bit
And let's make it more accurate: if we have acquire the list of unit drop-ins,
then let's do a full comparison against the old list we already have, and if
things differ in any way, we know we have to reload.
This makes sure we detect changes to drop-in directories in more cases.
Lennart Poettering [Mon, 2 May 2016 12:50:27 +0000 (14:50 +0200)]
core: fix detection whether per-unit drop-ins changed
This fixes fall-out from
6d10d308c6cd16528ef58fa4f5822aef936862d3.
Until that commit, do determine whether a daemon reload was required we compare
the mtime of the main unit file we loaded with the mtime of it on disk for
equality, but for drop-ins we only stored the newest mtime of all of them and
then did a "newer-than" comparison. This was brokeni with the above commit,
when all checks where changed to be for equality.
With this change all checks are now done as "newer-than", fixing the drop-in
mtime case. Strictly speaking this will not detect a number of changes that the
code before above commit detected, but given that the mtime is unlikely to go
backwards, and this is just intended to be a helpful hint anyway, this looks OK
in order to keep things simple.
Fixes: #3123
Lennart Poettering [Mon, 2 May 2016 11:01:26 +0000 (13:01 +0200)]
core: move enforcement of the start limit into per-unit-type code again
Let's move the enforcement of the per-unit start limit from unit.c into the
type-specific files again. For unit types that know a concept of "result" codes
this allows us to hook up the start limit condition to it with an explicit
result code. Also, this makes sure that the state checks in clal like
service_start() may be done before the start limit is checked, as the start
limit really should be checked last, right before everything has been verified
to be in order.
The generic start limit logic is left in unit.c, but the invocation of it is
moved into the per-type files, in the various xyz_start() functions, so that
they may place the check at the right location.
Note that this change drops the enforcement entirely from device, slice, target
and scope units, since these unit types generally may not fail activation, or
may only be activated a single time. This is also documented now.
Note that restores the "start-limit-hit" result code that existed before
6bf0f408e4833152197fb38fb10a9989c89f3a59 already in the service code. However,
it's not introduced for all units that have a result code concept.
Fixes #3166.
Lennart Poettering [Mon, 2 May 2016 09:26:40 +0000 (11:26 +0200)]
util: don't dump /proc/cpuinfo contents in debug info
This is hardly useful, it's trivial for developers to get that info by running
cat /proc/cpuinfo.
Fixes #3155
Lennart Poettering [Mon, 2 May 2016 09:14:46 +0000 (11:14 +0200)]
man: slightly extend the machinectl clone documentation
Lennart Poettering [Mon, 2 May 2016 09:14:13 +0000 (11:14 +0200)]
minor CODING_STYLE clarification
Lennart Poettering [Fri, 29 Apr 2016 18:35:14 +0000 (20:35 +0200)]
update TODO
Lennart Poettering [Fri, 29 Apr 2016 18:57:39 +0000 (20:57 +0200)]
machinectl: since clone/remove/copy verbs are possibly slow, turn off bus call timeout
By default we timeout all bus calls, but if we know that these bus calls might
be slow, let's explicitly turn the timeouts off.
Lennart Poettering [Fri, 29 Apr 2016 18:32:56 +0000 (20:32 +0200)]
machined: rework copy-from/copy-to operation to use generic Operation object
With this all potentially slow operations are done out-of-process,
asynchronously, using the same "Operation" object.
Lennart Poettering [Fri, 29 Apr 2016 18:17:55 +0000 (20:17 +0200)]
machined: also make image removal operation asynchronous
If we remove a directory image (i.e. not a btrfs snapshot) then things might
get quite expensive, hence run this asynchronous in a forked off process, too.
Lennart Poettering [Fri, 29 Apr 2016 18:06:20 +0000 (20:06 +0200)]
machined: support non-btrfs file systems with "machinectl clone"
Fall back to a normal copy operation when the backing file system isn't btrfs,
and hence doesn't support cheap snapshotting. Of course, this will be slow, but
given that the execution is asynchronous now, this should be OK.
Fixes: #1308
Lennart Poettering [Fri, 29 Apr 2016 18:05:44 +0000 (20:05 +0200)]
tree-wide: fix invocations of chattr_path()
chattr_path() takes two bitmasks, and no booleans. Fix the various invocations
to do this properly.
Lennart Poettering [Fri, 29 Apr 2016 17:44:59 +0000 (19:44 +0200)]
copy: adjust directory times after writing to the directory
When recursively copying a directory tree, fix up the file times after having
created all contents in it, so that our changes don't end up altering any of
the directory times.
Lennart Poettering [Fri, 29 Apr 2016 17:42:07 +0000 (19:42 +0200)]
copy: return the right error when we can't open a file
Lennart Poettering [Fri, 29 Apr 2016 17:26:54 +0000 (19:26 +0200)]
image: enable btrfs quotas on the clone destination, not the source
Lennart Poettering [Fri, 29 Apr 2016 17:23:23 +0000 (19:23 +0200)]
util: rework sigkill_wait() to not require pid_t pointer
Let's make sigkill_wait() take a normal pid_t, and add sigkill_waitp() that
takes a pointer (which is useful for usage in _cleanup_), following the usual
logic we have for this.
Lennart Poettering [Fri, 29 Apr 2016 17:14:52 +0000 (19:14 +0200)]
machined: run clone operation asynchronously in the background
Cloning an image can be slow, if the image is not on a btrfs subvolume, hence
let's make sure we do this asynchronously in a child process, so that machined
isn't blocked as long as we process the client request.
This adds a new, generic "Operation" object to machined, that is used to track
these kind of background processes.
This is inspired by the MachineOperation object that already exists to make
copy operations asynchronous. A later patch will rework the MachineOperation
logic to use the generic Operation instead.
Evgeny Vereshchagin [Mon, 2 May 2016 08:57:19 +0000 (11:57 +0300)]
tests: add test for https://github.com/systemd/systemd/issues/2467 (#3168)
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 21:52:19 +0000 (17:52 -0400)]
shared/install: refuse template files for non-templateable units
$ systemctl --root=/ enable templated@bar.mount
Unit type mount cannot be templated.
Failed to enable: Invalid argument.
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 21:08:38 +0000 (17:08 -0400)]
shared/install: warn about DefaultInstance in non-template units
[/etc/systemd/system/mnt-test.mount:6] DefaultInstance only makes sense for template units, ignoring.
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 22:34:13 +0000 (18:34 -0400)]
Move no_instances information to shared/
This way it can be used in install.c in subsequent commit.
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 20:54:37 +0000 (16:54 -0400)]
shared/install: ignore Alias in [Install] of units which don't allow aliases
A downside is that a warning about missing [Install] is printed:
$ systemctl --root=/ enable mnt-test.mount
[/etc/systemd/system/mnt-test.mount:5] Aliases are not allowed for mount units, ignoring.
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
instance name specified.
That's a bit misleading, but I don't see an easy way to fix this. But
the situation is similar for many other parsing errors, so maybe that's
OK.
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 20:21:41 +0000 (16:21 -0400)]
Move no_alias information to shared/
This way it can be used in install.c in subsequent commit.
Lennart Poettering [Sun, 1 May 2016 19:06:41 +0000 (21:06 +0200)]
Merge pull request #3165 from evverx/tests-cleanups
tests,build-sys: some cleanups
Evgeny Vereshchagin [Sun, 1 May 2016 17:15:21 +0000 (17:15 +0000)]
catalog: rename RateLimitInterval= to RateLimitIntervalSec=
Follow-up for
f0367da7d1a61
Closes #3158
Alex Crawford [Sun, 1 May 2016 16:32:17 +0000 (09:32 -0700)]
test: ensure presets are evaluated in order
This tests to make sure that preset patterns are checked in the order
they were declared. Both "prefix-1.service" and "prefix-2.service" match
against two rules: their exact name (which enables the service) and
"prefix-*.service" (which disables the service). Because of the
ordering, only "prefix-1.service" should be enabled.
Evgeny Vereshchagin [Sun, 1 May 2016 16:31:36 +0000 (16:31 +0000)]
tests: use symlink to Makefile
Evgeny Vereshchagin [Sun, 1 May 2016 16:30:53 +0000 (16:30 +0000)]
build-sys: add TEST-0[89]-* to dist
Follow-up for
91f9f8f1bae and
4f4d6ee4be1c
Franck Bui [Sun, 1 May 2016 04:02:17 +0000 (06:02 +0200)]
build-sys: allow references to adm group to be omitted (#3150)
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 22:00:46 +0000 (18:00 -0400)]
Merge pull request #3152 from poettering/aliasfix
Refuse aliases to non-aliasable units in more places
Fixes #2730.
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 21:07:34 +0000 (17:07 -0400)]
architecture: Add nios2 (#3159)
Add nios2 architecture support. The nios2 is a softcore by Altera.
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 02:52:04 +0000 (22:52 -0400)]
networkd: rework headers to avoid circular includes
Header files were organized in a way where the includer would add various
typedefs used by the includee before including it, resulting in a tangled
web of dependencies between files.
Replace this with the following logic:
networkd.h
/ \
networkd-link.h \
networkd-ipv4ll.h--\__\
networkd-fdb.h \
networkd-network.h netword-netdev-*.h
networkd-route.h \
networkd-netdev.h
If a pointer to a structure defined in a different header file is needed,
use a typedef line instead of including the whole header.
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 18:27:23 +0000 (14:27 -0400)]
Merge pull request #3151 from keszybz/pr3149-2
Assorted fixes #3149 + one commit tacked on top
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 18:27:04 +0000 (14:27 -0400)]
Merge pull request #3148 from poettering/trigger
core: introduce activation rate limit and parse nice levels and close sockets properly
Lennart Poettering [Fri, 29 Apr 2016 15:48:07 +0000 (17:48 +0200)]
man: document that some unit types do not support unit aliases via symlinks
Lennart Poettering [Fri, 29 Apr 2016 15:37:33 +0000 (17:37 +0200)]
core: when encountering a symlink alias for non-aliasable units warn nicely
If the user defines a symlink alias for a unit whose type does not support
aliasing, detect this early and print a nice warning.
Fixe: #2730
Lennart Poettering [Fri, 29 Apr 2016 15:33:29 +0000 (17:33 +0200)]
hashmap: optimize set_put_strdup() a bit
Hashing should be quicker than allocating, hence let's first check if the
string already exists and only then allocate a new copy for it.
Lennart Poettering [Fri, 29 Apr 2016 15:31:02 +0000 (17:31 +0200)]
core: refuse merging on units when the unit type does not support alias
The concept of merging units exists so that we can create Unit objects for a
number of names early, and then load them only later, possibly merging units
which then turn out to be symlinked to other names. This of course only makes
sense for unit types where multiple names per unit are supported. For all
others, let's refuse the merge operation early.
Lennart Poettering [Thu, 28 Apr 2016 19:02:11 +0000 (21:02 +0200)]
update TODO
Lennart Poettering [Fri, 29 Apr 2016 09:36:00 +0000 (11:36 +0200)]
core: merge service_connection_unref() into service_close_socket_fd()
We always call one after the other anyway, and this way service_set_socket_fd()
and service_close_socket_fd() nicely match each other as one undoes the effect
of the other.
Lennart Poettering [Fri, 29 Apr 2016 09:18:53 +0000 (11:18 +0200)]
core: rerun GC logic for a unit that loses a reference
Let's make sure when we drop a reference to a unit, that we run the GC queue on
it again.
This (together with the previous commit) should deal with the GC issues pointed
out in:
https://github.com/systemd/systemd/pull/2993#issuecomment-
215331189
Lennart Poettering [Fri, 29 Apr 2016 09:14:03 +0000 (11:14 +0200)]
core: rework socket/service GC logic
There's no need to set the no_gc bit for service units that socket units
prepare, as we always keep a proper reference (as maintained by unit_ref_set())
on them, and such references are honoured by the GC logic anyway. Moreover,
explicitly setting the no_gc bit is problematic if the socket gets GC'ed for a
reason, as the service might then leak with the bit set.
Lennart Poettering [Fri, 29 Apr 2016 08:46:56 +0000 (10:46 +0200)]
hwdb: add missing newline so the hwdb buils correctly again
Lennart Poettering [Thu, 28 Apr 2016 19:47:20 +0000 (21:47 +0200)]
socket: really always close auxiliary fds when closing socket fds
Lennart Poettering [Thu, 28 Apr 2016 19:00:28 +0000 (21:00 +0200)]
core: make parsing of RLIMIT_NICE aware of actual nice levels
Lennart Poettering [Thu, 28 Apr 2016 15:09:50 +0000 (17:09 +0200)]
core: make sure to close connection fd when we fail to activate a per-connection service
Fixes: #2993 #2691
Lennart Poettering [Thu, 28 Apr 2016 14:51:30 +0000 (16:51 +0200)]
core: minor error path fix
In service_set_socket_fd(), let's make sure that if we can't add the requested
dependencies we take no possession of the passed connection fd.
This way, we follow the strict rule: we take possession of the passed fd on
success, but on failure we don't, and the fd remains in possession of the
caller.
Lennart Poettering [Tue, 26 Apr 2016 18:46:20 +0000 (20:46 +0200)]
core: rename StartLimitInterval= to StartLimitIntervalSec=
We generally follow the rule that for time settings we suffix the setting name
with "Sec" to indicate the default unit if none is specified. The only
exception was the rate limiting interval settings. Fix this, and keep the old
names for compatibility.
Do the same for journald's RateLimitInterval= setting
Lennart Poettering [Tue, 26 Apr 2016 18:34:33 +0000 (20:34 +0200)]
core: move start ratelimiting check after condition checks
With #2564 unit start rate limiting was moved from after the condition checks
are to before they are made, in an attempt to fix #2467. This however resulted
in #2684. However, with a previous commit a concept of per socket unit trigger
rate limiting has been added, to fix #2467 more comprehensively, hence the
start limit can be moved after the condition checks again, thus fixing #2684.
Fixes: #2684
Lennart Poettering [Tue, 26 Apr 2016 18:26:15 +0000 (20:26 +0200)]
core: introduce activation rate limiting for socket units
This adds two new settings TriggerLimitIntervalSec= and TriggerLimitBurst= that
define a rate limit for activation of socket units. When the limit is hit, the
socket is is put into a failure mode. This is an alternative fix for #2467,
since the original fix resulted in issue #2684.
In a later commit the StartLimitInterval=/StartLimitBurst= rate limiter will be
changed to be applied after any start conditions checks are made. This way,
there are two separate rate limiters enforced: one at triggering time, before
any jobs are queued with this patch, as well as the start limit that is moved
again to be run immediately before the unit is activated. Condition checks are
done in between the two, and thus no longer affect the start limit.
Lennart Poettering [Wed, 27 Apr 2016 07:44:49 +0000 (09:44 +0200)]
build-sys: improve compat with older kernel headers
In 4.2 kernel headers, some netlink defines are missing that we need. missing.h
already can add them in, but currently makes this dependent on a definition
that these kernels already have. Change the check hence to check for the newest
definition in the table, so that the whole bunch of definitions as added in on
all kernels lacking this.
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 14:17:43 +0000 (10:17 -0400)]
path-util: also support ".old" and ".new" suffixes and recommend them
~ suffix works fine, but looks to much like it the file is supposed to be
automatically cleaned up. For new versions of configuration files installers
might want to using something that looks more permanent like foobar.new.
So let's add treat ".old" and ".new" as special.
Update test to match.
kayrus [Fri, 29 Apr 2016 13:59:51 +0000 (15:59 +0200)]
core: Filter by unit name behind the D-Bus, instead on the client side (#3142)
This commit improves systemd performance on the systems which have
thousands of units.
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 13:16:45 +0000 (09:16 -0400)]
Merge pull request #3126 from poettering/small-fixes
fsync directory when creating or rotating journal files and other small fixes,
most importantly for the DHCP DUID code.