Commit graph

25808 commits

Author SHA1 Message Date
Evgeny Vereshchagin 0b2abe0f03 tests: add test for #3166 (#3180) 2016-05-03 11:43:22 +02:00
Evgeny Vereshchagin db985064b6 man: rename TriggerLimitIntervalBurst to TriggerLimitBurst (#3181)
[/etc/systemd/system/test.socket:2] Unknown lvalue 'TriggerLimitIntervalBurst' in section 'Socket'

Follow-up for 8b26cdbd2a
2016-05-03 11:33:38 +02:00
Sylvain Plantefève 7a40831a8a locale: Language fallbacks for fr_(BE|CA|CH|LU) to fr_FR (#3178) 2016-05-02 19:43:37 -04:00
Lennart Poettering 5c6c275e43 Merge pull request #3162 from keszybz/alias-refusal
Refuse Alias, DefaultInstance, templated units in install (as appropriate)
2016-05-02 20:40:54 +02:00
Zbigniew Jędrzejewski-Szmek 8ad54a0182 Merge pull request #3153 from poettering/async-clone
machined: make "clone" asynchronous, and support copy-based fall-back
2016-05-02 13:56:07 -04:00
Lennart Poettering 9e2db6894f update TODO 2016-05-02 18:35:09 +02:00
Lennart Poettering 4bbc06cc9e 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
2016-05-02 18:29:28 +02:00
Lennart Poettering dbb0578edc 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.
2016-05-02 17:12:35 +02:00
Lennart Poettering fae03ed32a 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
2016-05-02 16:51:45 +02:00
Lennart Poettering d14e3a0de9 core: don't propagate service state to sockets as long as there's still a job for the service queued 2016-05-02 16:41:41 +02:00
Lennart Poettering bd10a84b7f 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].
2016-05-02 16:02:02 +02:00
Lennart Poettering 9703a8adb5 automount: add debug message when we get notified about mount state changes 2016-05-02 16:01:39 +02:00
Lennart Poettering 7b2fd9d512 core: remove duplicate code in automount_update_mount()
Also, fix indentation.
2016-05-02 16:01:16 +02:00
Lennart Poettering ab932a622d 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.
2016-05-02 15:10:35 +02:00
Lennart Poettering 87ec20ef20 core: fix detection whether per-unit drop-ins changed
This fixes fall-out from 6d10d308c6.

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
2016-05-02 15:10:24 +02:00
Lennart Poettering 072993504e 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
6bf0f408e4 already in the service code. However,
it's not introduced for all units that have a result code concept.

Fixes #3166.
2016-05-02 13:08:00 +02:00
Lennart Poettering 82f8bae211 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
2016-05-02 12:08:02 +02:00
Lennart Poettering d13febb1e0 man: slightly extend the machinectl clone documentation 2016-05-02 11:17:07 +02:00
Lennart Poettering 10c6258e32 minor CODING_STYLE clarification 2016-05-02 11:17:07 +02:00
Lennart Poettering 3e8a82dbd0 update TODO 2016-05-02 11:17:07 +02:00
Lennart Poettering 3d87174db4 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.
2016-05-02 11:17:06 +02:00
Lennart Poettering 795c5d31af 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.
2016-05-02 11:17:06 +02:00
Lennart Poettering 5d2036b5f3 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.
2016-05-02 11:17:06 +02:00
Lennart Poettering 9a50e3caab 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
2016-05-02 11:15:30 +02:00
Lennart Poettering a67d68b848 tree-wide: fix invocations of chattr_path()
chattr_path() takes two bitmasks, and no booleans. Fix the various invocations
to do this properly.
2016-05-02 11:15:30 +02:00
Lennart Poettering 3b8483c0a3 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.
2016-05-02 11:15:30 +02:00
Lennart Poettering b498c53d80 copy: return the right error when we can't open a file 2016-05-02 11:15:30 +02:00
Lennart Poettering 8120ee28b8 image: enable btrfs quotas on the clone destination, not the source 2016-05-02 11:15:30 +02:00
Lennart Poettering 89c9030d31 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.
2016-05-02 11:15:30 +02:00
Lennart Poettering 5659958529 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.
2016-05-02 11:15:30 +02:00
Evgeny Vereshchagin 33e40442c6 tests: add test for https://github.com/systemd/systemd/issues/2467 (#3168) 2016-05-02 10:57:19 +02:00
Zbigniew Jędrzejewski-Szmek 133e5b362f 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.
2016-05-01 19:58:59 -04:00
Zbigniew Jędrzejewski-Szmek 6597fa6117 shared/install: warn about DefaultInstance in non-template units
[/etc/systemd/system/mnt-test.mount:6] DefaultInstance only makes sense for template units, ignoring.
2016-05-01 19:58:59 -04:00
Zbigniew Jędrzejewski-Szmek ce99c68a33 Move no_instances information to shared/
This way it can be used in install.c in subsequent commit.
2016-05-01 19:58:59 -04:00
Zbigniew Jędrzejewski-Szmek a772458901 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.
2016-05-01 19:58:51 -04:00
Zbigniew Jędrzejewski-Szmek 8a993b61d1 Move no_alias information to shared/
This way it can be used in install.c in subsequent commit.
2016-05-01 19:40:51 -04:00
Lennart Poettering 6738873efc Merge pull request #3165 from evverx/tests-cleanups
tests,build-sys: some cleanups
2016-05-01 21:06:41 +02:00
Evgeny Vereshchagin a9c76ada08 catalog: rename RateLimitInterval= to RateLimitIntervalSec=
Follow-up for f0367da7d1

Closes #3158
2016-05-01 17:30:06 +00:00
Alex Crawford 622d370584 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.
2016-05-01 09:40:39 -07:00
Evgeny Vereshchagin cd4c260323 tests: use symlink to Makefile 2016-05-01 16:40:21 +00:00
Evgeny Vereshchagin 52c0bed3fb build-sys: add TEST-0[89]-* to dist
Follow-up for 91f9f8f1ba and 4f4d6ee4be
2016-05-01 16:30:53 +00:00
Franck Bui 7178cd76f2 build-sys: allow references to adm group to be omitted (#3150) 2016-05-01 00:02:17 -04:00
Zbigniew Jędrzejewski-Szmek bc1d8669b8 Merge pull request #3152 from poettering/aliasfix
Refuse aliases to non-aliasable units in more places

Fixes #2730.
2016-04-30 18:00:46 -04:00
Zbigniew Jędrzejewski-Szmek b79660e6ac architecture: Add nios2 (#3159)
Add nios2 architecture support. The nios2 is a softcore by Altera.
2016-04-30 17:07:34 -04:00
Zbigniew Jędrzejewski-Szmek 634f0f983c 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.
2016-04-29 19:01:28 -04:00
Zbigniew Jędrzejewski-Szmek 26ccc1d087 Merge pull request #3151 from keszybz/pr3149-2
Assorted fixes #3149 + one commit tacked on top
2016-04-29 14:27:23 -04:00
Zbigniew Jędrzejewski-Szmek 1c5ed0e2b4 Merge pull request #3148 from poettering/trigger
core: introduce activation rate limit and parse nice levels and close sockets properly
2016-04-29 14:27:04 -04:00
Lennart Poettering f4bf8d2f45 man: document that some unit types do not support unit aliases via symlinks 2016-04-29 18:06:12 +02:00
Lennart Poettering a837f08803 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
2016-04-29 18:06:12 +02:00
Lennart Poettering 454f0f8680 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.
2016-04-29 17:35:32 +02:00