Commit graph

25873 commits

Author SHA1 Message Date
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
Tejun Heo ccf78df1fc core: make unit_has_mask_realized() consider controller enable state
unit_has_mask_realized() determines whether the specified unit has its cgroups
set up properly given the desired target_mask; however, on the unified
hierarchy, controllers need to be enabled explicitly for children and the mask
of enabled controllers can deviate from target_mask.  Only considering
target_mask in unit_has_mask_realized() can lead to false positives and
skipping enabling the requested controllers.

This patch adds unit->cgroup_enabled_mask to track which controllers are
enabled and updates unit_has_mask_realized() to also consider enable_mask.

Signed-off-by: Tejun Heo <htejun@fb.com>
2016-04-30 16:12:54 -04:00
Tejun Heo 3fdf9ad7ad core: bus_append_unit_property_assignment() was using the wrong parse function
It was incorrectly using cg_cpu_weight_parse() to parse BlockIOWeight.  Update
it to use cg_blkio_weight_parse() instead.

Signed-off-by: Tejun Heo <htejun@fb.com>
2016-04-30 16:12:54 -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
Lennart Poettering 934e749e18 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.
2016-04-29 17:31:02 +02:00
Lennart Poettering f9bf1b8fee update TODO 2016-04-29 16:27:49 +02:00
Lennart Poettering 5cc3985ed1 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.
2016-04-29 16:27:49 +02:00
Lennart Poettering b75102e5bf 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
2016-04-29 16:27:49 +02:00
Lennart Poettering e4f673174e 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.
2016-04-29 16:27:49 +02:00
Lennart Poettering bb5049ae24 hwdb: add missing newline so the hwdb buils correctly again 2016-04-29 16:27:49 +02:00
Lennart Poettering 18e854f8e5 socket: really always close auxiliary fds when closing socket fds 2016-04-29 16:27:49 +02:00
Lennart Poettering 2985700185 core: make parsing of RLIMIT_NICE aware of actual nice levels 2016-04-29 16:27:49 +02:00
Lennart Poettering 3e7a1f50e4 core: make sure to close connection fd when we fail to activate a per-connection service
Fixes: #2993 #2691
2016-04-29 16:27:48 +02:00
Lennart Poettering 7f2fbbff06 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.
2016-04-29 16:27:48 +02:00
Lennart Poettering f0367da7d1 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
2016-04-29 16:27:48 +02:00
Lennart Poettering 7629ec4642 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
2016-04-29 16:27:48 +02:00
Lennart Poettering 8b26cdbd2a 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.
2016-04-29 16:27:48 +02:00
Lennart Poettering 3282493ad0 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.
2016-04-29 16:27:48 +02:00
Zbigniew Jędrzejewski-Szmek 94a0ef6e57 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.
2016-04-29 10:21:07 -04:00
kayrus 313fe66fbd 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.
2016-04-29 15:59:51 +02:00
Zbigniew Jędrzejewski-Szmek 3e39355a96 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.
2016-04-29 09:16:45 -04:00
Lennart Poettering 2397bc4312 test-copy: never call alloca() in a loop
That's a total no-no, hence rework this to use malloc()-based memory instead of
alloca()-based memory.

Also see CODING_STYLE about this.
2016-04-29 14:28:04 +02:00
Lennart Poettering 0e2b2caccd copy: also copy AF_UNIX sockets
We previously would fail with EOPNOTSUPP when encountering an AF_UNIX socket in
the directory tree to copy. Fix that, and copy them too (even if they are dead
in the result).

Fixes: #2914
2016-04-29 14:28:03 +02:00
Lennart Poettering 14e2baa369 man: document that RemainAfterExit= doesn't make much sense for repetitive timers
Fixes #3122
2016-04-29 13:37:33 +02:00
Lennart Poettering 941060bf5e path-util: document that we shouldn't add further entries to hidden_or_backup_file()
And let's add ".bak" as a generic suffix for backups, that people can use
without having to register their stuff in our list.
2016-04-29 13:26:12 +02:00
Ming Lin 427a28ecbe rules: add NVMe rules (#3136)
Add NVMe rules using the "wwid" attribute.

root@target:~# cat /sys/block/nvme0n1/wwid
eui.3825004235000591

root@target:~# ls /dev/disk/by-id/ -l |grep nvme
lrwxrwxrwx 1 root root 13 Apr 27 16:08 nvme-eui.3825004235000591 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part2 -> ../../nvme0n1p2
2016-04-29 13:02:57 +02:00
Lennart Poettering 365007369b Merge pull request #3069 from Werkov/fix-dependencies-for-bind-mounts
Always create dependencies for bind mounts
2016-04-29 12:50:29 +02:00
Lennart Poettering 1fcefd8815 journal-file: when rotating a journal file, fsync directory too
As suggested by:

https://github.com/systemd/systemd/pull/3126#discussion_r61125474
2016-04-29 12:24:09 +02:00
Lennart Poettering 076ea6f6d2 networkd: clean up DUID code a bit
Let's move DUID configuration into the [DHCP] section, since it only makes
sense in a DHCP context, and should be close to the configuration of
ClientIdentifier= and suchlike.

This really shouldn't be a section of its own, we don't have any for any of our
other per-protocol specific identifiers...

Follow-up for #2890 #2943
2016-04-29 12:23:34 +02:00
Lennart Poettering a0fe2a2d20 journal: when creating a new journal file, fsync() the directory it is created in too
Fixes: #2831
2016-04-29 12:23:34 +02:00
Lennart Poettering 6809de5bb1 update TODO a bit 2016-04-29 12:23:34 +02:00
Lennart Poettering dfe85b38d2 man: minor wording fixes
As suggested in:

https://github.com/systemd/systemd/pull/3124#discussion_r61068789
2016-04-29 12:23:34 +02:00
Lennart Poettering 1cc457d998 vimrc: fix indentation logic for our docbook xml files
Make sure TAB results in 2ch indenting as we commonly use for our docbook XML
files.
2016-04-29 12:23:34 +02:00
Lubomir Rintel e4196edfbf parse-util: fix conversion from size_t on s390 (#3147)
On s390 size_t is an unsigned long, nor an unsigned int. They both are
of the same size and can be cast to each other safely, but the compiler
still seems unhappy about incompatible pointers.

Fixes: 7c2da2ca8
2016-04-29 11:45:07 +02:00
Lennart Poettering e0a24179c0 Merge pull request #3137 from keszybz/dirent-simplification
Various small cleanups in shared code
2016-04-29 10:40:15 +02:00
Evgeny Vereshchagin e192a2815e nspawn: convert uuid to string (#3146)
Fixes:
cp /etc/machine-id /var/tmp/systemd-test.HccKPa/nspawn-root/etc
systemd-nspawn -D /var/tmp/systemd-test.HccKPa/nspawn-root --link-journal host -b
...
Host and machine ids are equal (P�S!V): refusing to link journals
2016-04-29 10:38:35 +02:00
Susant Sahani 6fc2549711 networkd: reconfigure IPv6 and static address after link up event (#3105)
Now we are not setting static address, start dhcp6 client and
discovering IPv6 routers after link gained carrier.

This fixes #2912.
2016-04-28 19:03:29 -04:00
Alex Crawford d544d1a4d5 install: upgrade message to a warning 2016-04-28 16:01:04 -07:00
Zbigniew Jędrzejewski-Szmek a44cb5cbf7 basic/mount-util: recognize pvfs2 as network fs (#3140)
Added to kernel 4.6.
2016-04-28 19:49:16 +02:00