Evgeny Vereshchagin [Sat, 24 Oct 2015 20:55:56 +0000 (20:55 +0000)]
core: various small fixes to unit-printf
* check memory allocation errors in specifier_cgroup_slice
* %I doesn't fail for non-instantiated units (%i doesn't fail too)
* EOPNOTSUPP for consistency
Lennart Poettering [Sat, 24 Oct 2015 12:58:51 +0000 (14:58 +0200)]
Merge pull request #1664 from again4you/devel/tmp-smack_#5
mount: add new SmackFileSystemRoot= setting for mount unit (v4)
Sangjung Woo [Wed, 21 Oct 2015 12:48:13 +0000 (21:48 +0900)]
units: add 'SmackFileSystemRoot=*' option into tmp.mount
If SMACK is enabled, 'smackfsroot=*' option should be specified when
/tmp is mounted since many non-root processes use /tmp for temporary
usage. If not, /tmp is labeled as '_' and smack denial occurs when
writing.
In order to do that, 'SmackFileSystemRoot=*' is newly added into
tmp.mount.
Sangjung Woo [Wed, 21 Oct 2015 08:42:34 +0000 (17:42 +0900)]
mount: add new SmackFileSystemRoot= setting for mount unit
This option specifies the label to assign the root of the file system if
it lacks the Smack extended attribute. Note that this option will be
ignored if kernel does not support the Smack feature by runtime
checking.
Lennart Poettering [Sat, 24 Oct 2015 10:17:41 +0000 (12:17 +0200)]
Merge pull request #1657 from phomes/tmpfiles-simplification
tmpfiles: simplify mountpoint detection
Lennart Poettering [Sat, 24 Oct 2015 09:52:52 +0000 (11:52 +0200)]
Merge pull request #1659 from vcaputo/journal_verify_envalid
journal: s/Envalid/Invalid/
Vito Caputo [Fri, 23 Oct 2015 23:12:31 +0000 (16:12 -0700)]
journal: s/Envalid/Invalid/
Thomas Hindoe Paaboel Andersen [Fri, 23 Oct 2015 18:15:17 +0000 (20:15 +0200)]
tmpfiles: simplify mountpoint detection
No functional change. Just a simplification. A || (!A && B) is
the same as A || B
Introduced in
78a92a5a2306709e4587e332728a76901323ade9
Lennart Poettering [Fri, 23 Oct 2015 15:42:24 +0000 (17:42 +0200)]
Merge pull request #1653 from keszybz/lz4-compress-time
Limit test-compress-benchmark to approx. 12 s of runtime
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2015 21:59:40 +0000 (17:59 -0400)]
test-compress-benchmark: properly initialize buffer
We were compressing unitialized memory, which should not result in
any problems, but is inelegant.
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2015 21:10:51 +0000 (17:10 -0400)]
test-compress-benchmark: limit default runtime to 2 seconds per subtest
If both lz4 and xz are enabled, this results in a limit of
2×3×2 s ~= 12 s runtime.
Previous implementation started with really small buffer sizes. When
combined with a short time limit this resulteded in abysmal results for xz.
It seems that the initialization overead is really significant for small
buffers. Since xz will not be used by default anymore, this does not
seem worth fixing. Instead buffer sizes are changed to run a
pseudo-random non-repeating pattern. This should allow reasonable testing
for all buffer sizes. For testing, both runtime and the buffer size seed
can be specified on the command line. Sufficiently large runtime allows
all buffer sizes up to 1MB to be tested.
Lennart Poettering [Fri, 23 Oct 2015 11:46:03 +0000 (13:46 +0200)]
Merge pull request #1652 from filbranden/extract1
util: Replace state with separate booleans in extract_first_word
Lennart Poettering [Fri, 23 Oct 2015 11:18:55 +0000 (13:18 +0200)]
Merge pull request #1647 from evverx/use-extract-in-namespace-parsing
core: use extract_first_word for namespace parsing
Lennart Poettering [Fri, 23 Oct 2015 10:47:07 +0000 (12:47 +0200)]
Merge pull request #1648 from evverx/clarify-journalctl-quiet-option
journalctl: clarify -q option
Daniel Mack [Fri, 23 Oct 2015 08:50:53 +0000 (10:50 +0200)]
Merge pull request #1641 from poettering/btrfs-quota
btrfs quota beef up and various other unrelated changes
Filipe Brandenburger [Fri, 23 Oct 2015 06:12:31 +0000 (23:12 -0700)]
util: Replace state with separate booleans in extract_first_word
This simplifies the logic and uniformizes the way single and double
quotes are handled. In the end, the code is about 40 lines shorter.
Tested by running the excellent test cases from test-util. Also
installed the systemd binaries including this patch and booted a
system with it, everything looked normal.
Evgeny Vereshchagin [Thu, 22 Oct 2015 23:18:17 +0000 (23:18 +0000)]
journalctl: clarify -q option
-q suppresses info messages too
Evgeny Vereshchagin [Thu, 22 Oct 2015 20:28:28 +0000 (20:28 +0000)]
core: use extract_first_word for namespace parsing
see https://github.com/systemd/systemd/pull/1632#issuecomment-
149903791
We should port this loop over to extract_first_word(), too.
Lennart Poettering [Thu, 22 Oct 2015 18:28:50 +0000 (20:28 +0200)]
Merge pull request #1646 from keszybz/man-dnf-install
dnf install command update
Zbigniew Jędrzejewski-Szmek [Thu, 22 Oct 2015 18:11:22 +0000 (14:11 -0400)]
man: also add --enablerepo=updates to dnf invocation
Without the updates repo, we are installing packages from the time
that that version of Fedora was released. Normally, during the
lifetime of the release most packages are updated, so most of the
packages installed would be outdated, and the first update after
installation would update a massive set of packages. Avoid all this
by installing from the updates repo from the start.
Patrik Flykt [Thu, 22 Oct 2015 17:41:50 +0000 (20:41 +0300)]
Merge pull request #1625 from teg/ndisc
sd-ndisc: Rename (from sd-icmp6-nd) and prepare for handling SLAAC and router discovery
Zbigniew Jędrzejewski-Szmek [Thu, 22 Oct 2015 17:34:46 +0000 (13:34 -0400)]
man: remove --nogpg from dnf install command line
Keys for previous and future Fedora distributions were added
for the fedora-repos package recently:
https://bugzilla.redhat.com/show_bug.cgi?id=1246701.
There is no need to skip signature checking.
Also, update to the latest and greatest and remove unnecessary quotes.
Tom Gundersen [Thu, 22 Oct 2015 15:34:58 +0000 (17:34 +0200)]
sd-ndisc: reduce callbacks
Only callback on error when the statemachine is in a truly broken state. This
is now only the case when we fail to rearm a timer.
Tom Gundersen [Wed, 21 Oct 2015 00:14:24 +0000 (02:14 +0200)]
sd-ndisc: drop sd_ndisc_get_prefixlen()
This is unused, and in the future we will pass prefixes and prefixlengths directly
to the callbacks when needed rather than having to search for them.
Tom Gundersen [Mon, 19 Oct 2015 13:04:22 +0000 (15:04 +0200)]
sd-ndisc: drop sd_ndisc_prefix_match()
This is no longer used.
Tom Gundersen [Sun, 18 Oct 2015 15:45:22 +0000 (17:45 +0200)]
sd-ndisc: don't trigger timeout on prefix expiry
The caller of the library is no longer notified, so triggering a timer
just to clean up is not necessary. Instead check for and clean up
invalid prefixes lazily.
Tom Gundersen [Sun, 18 Oct 2015 15:27:10 +0000 (17:27 +0200)]
sd-ndisc: remove a prefix from the ndisc object when freeing it
This follows the coding style, and allows some simplification to the rest of the code.
Tom Gundersen [Sun, 18 Oct 2015 15:19:29 +0000 (17:19 +0200)]
sd-ndisc: don't inform the caller of expired prefixes
The caller should push any lifetime information into the kernel and let the kernel handle
prefix expiration.
Tom Gundersen [Sun, 18 Oct 2015 15:13:03 +0000 (17:13 +0200)]
sd-ndisc: clean up state enum
There is no need to assign valuse to the states. Also add _INVALID and _MAX,
even though these are not used, it keeps it consistent.
Tom Gundersen [Sun, 18 Oct 2015 15:06:31 +0000 (17:06 +0200)]
networkd: dhcp6 - do not handle prefix expiration
This ressurects
47d45d3cde45d6545367570264e4e3636bc9e345. We now always use /128 prefixes,
so there is no need for the DHCPv6 code to know about prefixes expiring.
Tom Gundersen [Sun, 18 Oct 2015 14:59:21 +0000 (16:59 +0200)]
networkd: dhcp6 - DHCPv6 addresses should always be /128
The routing information should be configured separately by ND, there is no need to
indicate the prefix again in the DHCPv6 addresses.
See discussion and related links at issue #1520.
Tom Gundersen [Fri, 16 Oct 2015 19:09:15 +0000 (21:09 +0200)]
networkd: ndisc - split out from dhcp6 code
Tom Gundersen [Fri, 16 Oct 2015 17:28:27 +0000 (19:28 +0200)]
networkd: ndisc - make logging messages uniform
Refer to Router Discovery rather than ICMPv6.
Tom Gundersen [Fri, 16 Oct 2015 17:17:50 +0000 (19:17 +0200)]
sd-ndisc: rename icmp6 to ndisc throughout the code
Tom Gundersen [Fri, 16 Oct 2015 16:09:10 +0000 (18:09 +0200)]
libsystemd-network: split icm6-util.[ch] out of dhcp6 code
Tom Gundersen [Fri, 16 Oct 2015 15:34:58 +0000 (17:34 +0200)]
networkd: rename icmp6 to ndisc
Tom Gundersen [Fri, 16 Oct 2015 15:07:47 +0000 (17:07 +0200)]
sd-ndisc: rename API from sd-icmp6-nd
Tom Gundersen [Thu, 15 Oct 2015 17:25:31 +0000 (19:25 +0200)]
sd-icmp6-nd: rename files to sd-ndisc
The actual code rename will follow. The reason for the change of name is to make it
simpler and more uniform with how we name other libraries (we don't include the
underlying protocol). The new name also matches the naming in the kernel (which
is particularly relevent here as we expect to let the kernel do some parts of
the protocol and we do others).
Tom Gundersen [Thu, 22 Oct 2015 15:02:54 +0000 (17:02 +0200)]
Merge pull request #1644 from reverendhomer/patch-1
networkd-manager: fix swapped arguments
Lennart Poettering [Thu, 22 Oct 2015 10:20:12 +0000 (12:20 +0200)]
Merge pull request #1642 from evverx/allow-unbalanced-double-quote-in-relax-mode
util: allow unbalanced double quote in EXTRACT_QUOTES|EXTRACT_RELAX mode
reverendhomer [Thu, 22 Oct 2015 07:36:07 +0000 (10:36 +0300)]
networkd-manager: fix swapped arguments
fixes Coverity #1328493
Evgeny Vereshchagin [Thu, 22 Oct 2015 00:37:32 +0000 (00:37 +0000)]
util: allow unbalanced double quote in EXTRACT_QUOTES|EXTRACT_RELAX mode
extract_first_word understands "\'string" but doesn't understand "\"string"
fixed this inconsistency.
Lennart Poettering [Thu, 22 Oct 2015 00:02:17 +0000 (02:02 +0200)]
core: check parsed bus msg in full before applying it
Lennart Poettering [Wed, 21 Oct 2015 23:33:06 +0000 (01:33 +0200)]
nspawn: don't try to resolve passed binary before entering namespace
Othewise we might follow the symlinks on the host, instead of the
container.
Fixes #1400
Lennart Poettering [Wed, 21 Oct 2015 22:59:18 +0000 (00:59 +0200)]
nspawn: rework how we determine private networking settings
Make sure we acquire CAP_NET_ADMIN if we require virtual networking.
Make sure we imply virtual ethernet correctly when bridge is request.
Fixes: #1511
Fixes: #1554
Fixes: #1590
Lennart Poettering [Wed, 21 Oct 2015 22:39:57 +0000 (00:39 +0200)]
units: also whitelist "blkext" block devices for nspawn service
/dev/loop*p* block devices are of the "blkext" subsystem, not of loop,
hence whitelist this too.
Fixes #1446
Lennart Poettering [Wed, 21 Oct 2015 22:39:27 +0000 (00:39 +0200)]
import: don't claim we moved .nspawn file into place when in fact we did not
Lennart Poettering [Wed, 21 Oct 2015 22:39:09 +0000 (00:39 +0200)]
import: correct handling if .nspawn file could not be downloaded
Lennart Poettering [Wed, 21 Oct 2015 20:41:31 +0000 (22:41 +0200)]
machinectl: accept "none" and "infinity" as specifier when dropping quotas using "machinectl set-limit"
Previously, we already accepted "-" as special value for dropping
limits. Add "infinity", as that's what we support for RLIMITs and hence
should support here to. Also add "none" as that's what the btrfs tools
use.
Lennart Poettering [Wed, 21 Oct 2015 17:48:07 +0000 (19:48 +0200)]
update TODO
Lennart Poettering [Wed, 21 Oct 2015 17:47:28 +0000 (19:47 +0200)]
tmpfiles.d: change all subvolumes to use quota
Let's make sure the subvolumes we create fit into a sensible definition
of a quota tree.
Lennart Poettering [Wed, 21 Oct 2015 17:46:23 +0000 (19:46 +0200)]
tmpfiles: introduce "q" and "Q" for creating quota-enabled btrfs subvolumes
This allows us to set up the quota group hierarchy in a reasonable way
on btrfs file systems.
Lennart Poettering [Wed, 21 Oct 2015 17:45:44 +0000 (19:45 +0200)]
import: when downloading images, create a subtree quota group for them
Lennart Poettering [Wed, 21 Oct 2015 17:38:21 +0000 (19:38 +0200)]
btrfs: beef-up btrfs support with a limited understanding of quota
With this change we understand more than just leaf quota groups for
btrfs file systems. Specifically:
- When we create a subvolume we can now optionally add the new subvolume
to all qgroups its parent subvolume was member of too. Alternatively
it is also possible to insert an intermediary quota group between the
parent's qgroups and the subvolume's leaf qgroup, which is useful for
a concept of "subtree" qgroups, that contain a subvolume and all its
children.
- The remove logic for subvolumes has been updated to optionally remove
any leaf qgroups or "subtree" qgroups, following the logic above.
- The snapshot logic for subvolumes has been updated to replicate the
original qgroup setup of the source, if it follows the "subtree"
design described above. It will not cover qgroup setups that introduce
arbitrary qgroups, especially those orthogonal to the subvolume
hierarchy.
This also tries to be more graceful when setting up /var/lib/machines as
btrfs. For example, if mkfs.btrfs is missing we don't even try to set it
up as loopback device.
Fixes #1559
Fixes #1129
Lennart Poettering [Wed, 21 Oct 2015 17:36:22 +0000 (19:36 +0200)]
logind: minor clean-ups
Lennart Poettering [Wed, 21 Oct 2015 17:34:52 +0000 (19:34 +0200)]
systemctl: the various list commands actually can take any number of arguments
I accidentally broke this a while back when I ported systemctl to the
verbs logic.
Add support for this back.
Lennart Poettering [Mon, 19 Oct 2015 21:58:17 +0000 (23:58 +0200)]
util: improve dir_is_empty() call
Simplify the call, and add dir_is_populated() as inverse call, in order
to make some checks easier to read.
Lennart Poettering [Wed, 21 Oct 2015 19:01:21 +0000 (21:01 +0200)]
Merge pull request #1639 from alkino/master
core dbus: Check that flush works with memstream
Nicolas Cornu [Wed, 21 Oct 2015 16:17:12 +0000 (18:17 +0200)]
core dbus: Check that flush works with memstream
Lennart Poettering [Wed, 21 Oct 2015 14:38:35 +0000 (16:38 +0200)]
Merge pull request #1637 from alkino/master
shell-completion: systemd-run: add new property EnvironmentFile
Nicolas Cornu [Wed, 21 Oct 2015 14:18:59 +0000 (16:18 +0200)]
shell-completion: systemd-run: add new property EnvironmentFile
Lennart Poettering [Wed, 21 Oct 2015 13:56:48 +0000 (15:56 +0200)]
Merge pull request #1632 from evverx/fix-namespace-parsing
core: fix namespace parsing
Lennart Poettering [Wed, 21 Oct 2015 13:55:31 +0000 (15:55 +0200)]
Merge pull request #1636 from alkino/master
Add zsh completion on systemd-run's properties
Nicolas Cornu [Wed, 21 Oct 2015 13:51:09 +0000 (15:51 +0200)]
Add zsh completion on systemd-run's properties
Evgeny Vereshchagin [Wed, 21 Oct 2015 11:49:36 +0000 (11:49 +0000)]
core: fix namespace parsing
ReadOnlyDirectories=-/ works fine
Lennart Poettering [Wed, 21 Oct 2015 10:08:44 +0000 (12:08 +0200)]
Merge pull request #1623 from evverx/run-rw-ro-ia-dirs
systemd-run can launch units with ReadWriteDirectories, ReadOnlyDirectories, InaccessibleDirectories
Lennart Poettering [Wed, 21 Oct 2015 10:07:08 +0000 (12:07 +0200)]
Merge pull request #1626 from teg/networkd
networkd: assorted fixes
Tom Gundersen [Wed, 30 Sep 2015 16:17:43 +0000 (18:17 +0200)]
networkd: manager/link - only serialize once per event-loop iteration
Every time the state is written out we may trigger third-party apps, so
let's be a bit more careful about writing this out unnecessarily.
Tom Gundersen [Wed, 30 Sep 2015 13:32:16 +0000 (15:32 +0200)]
networkd: link - serialize addresses
Tom Gundersen [Sat, 3 Oct 2015 16:40:28 +0000 (18:40 +0200)]
networkd: route - add hash_ops
Tom Gundersen [Fri, 9 Oct 2015 21:43:52 +0000 (23:43 +0200)]
networkd: route - simplify route_new()
Tom Gundersen [Wed, 30 Sep 2015 12:01:44 +0000 (14:01 +0200)]
networkd: address - distinguish between addresses added by us and by others
We only keep the addresses that we added ourselves in link->addresses, and
introduce a new set link->addresses_foreign to keep addresses of unknown
origin.
Only functional change is that "foreign" addresses no longer prevent a link
from entering "configured" state.
Tom Gundersen [Wed, 30 Sep 2015 12:07:12 +0000 (14:07 +0200)]
networkd: address - rework firewall rules lifetime
Establish the firewall rule before creating the address, and do not create the address
if the firewall rule could not be created. Also, only drop the firewall rule once
the address has been removed from the kernel.
Tom Gundersen [Thu, 1 Oct 2015 15:31:14 +0000 (17:31 +0200)]
networkd: address - merge _change() into _configure()
These functions are almost entirely the same, so avoid duplication.
Tom Gundersen [Mon, 28 Sep 2015 15:16:12 +0000 (17:16 +0200)]
networkd: address - factor out address_update()
Call back into link_check_ready() whenever an address state change may have
made a link ready.
Tom Gundersen [Mon, 28 Sep 2015 11:38:43 +0000 (13:38 +0200)]
networkd: link - only consider configured when all addresses are ready
We were considering a link configured whilst its IPv6 addresses were still
tentative.
Fixes issue #650.
Evgeny Vereshchagin [Tue, 20 Oct 2015 19:59:43 +0000 (19:59 +0000)]
shell-completion: systemd-run: add new properties
"ReadWriteDirectories", "ReadOnlyDirectories", "InaccessibleDirectories"
Evgeny Vereshchagin [Tue, 20 Oct 2015 19:57:04 +0000 (19:57 +0000)]
run: can launch units with ReadWriteDirectories, ReadOnlyDirectories, InaccessibleDirectories
Ronny Chevalier [Tue, 20 Oct 2015 17:48:27 +0000 (19:48 +0200)]
Merge pull request #1622 from phomes/unused-variable
dbus-execute: remove unused variable
Thomas Hindoe Paaboel Andersen [Tue, 20 Oct 2015 17:36:54 +0000 (19:36 +0200)]
dbus-execute: remove unused variable
from
ceb728cf
Lennart Poettering [Tue, 20 Oct 2015 13:26:19 +0000 (15:26 +0200)]
Merge pull request #1616 from evverx/run-fix-environment-parsing
run: fix Environment parsing
Tom Gundersen [Tue, 20 Oct 2015 12:59:27 +0000 (14:59 +0200)]
Merge pull request #1538 from ssahani/ipv62
networkd: add support to configure IPv6 DAD
Evgeny Vereshchagin [Tue, 20 Oct 2015 02:04:10 +0000 (02:04 +0000)]
run: fix Environment parsing
* `Environment=` resets previous assignments
* `Environment='a=1 b=2'` sets `a` to `1` and `b` to `2`
* `Environment='"a=1 2" b=2"'` sets `a` to `1 2` and `b` to `2`
Lennart Poettering [Tue, 20 Oct 2015 10:22:32 +0000 (12:22 +0200)]
Merge pull request #1619 from iaguis/nspawn-sysfs-netns-3
nspawn: skip /sys-as-tmpfs if we don't use private-network
Daniel Mack [Tue, 20 Oct 2015 08:31:38 +0000 (10:31 +0200)]
Merge pull request #1568 from poettering/netclass
various fixes, for various things
Iago López Galeiras [Thu, 15 Oct 2015 10:13:13 +0000 (12:13 +0200)]
nspawn: skip /sys-as-tmpfs if we don't use private-network
Since v3.11/7dc5dbc ("sysfs: Restrict mounting sysfs"), the kernel
doesn't allow mounting sysfs if you don't have CAP_SYS_ADMIN rights over
the network namespace.
So the mounting /sys as a tmpfs code introduced in
d8fc6a000fe21b0c1ba27fbfed8b42d00b349a4b doesn't work with user
namespaces if we don't use private-net. The reason is that we mount
sysfs inside the container and we're in the network namespace of the host
but we don't have CAP_SYS_ADMIN over that namespace.
To fix that, we mount /sys as a sysfs (instead of tmpfs) if we don't use
private network and ignore the /sys-as-a-tmpfs code if we find that /sys
is already mounted as sysfs.
Fixes #1555
Lennart Poettering [Mon, 19 Oct 2015 21:43:19 +0000 (23:43 +0200)]
dbus-execute: some cleanups when parsing EnvironmentFiles= for transient units
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2015 14:02:35 +0000 (10:02 -0400)]
strv: Add _cleanup_strv_free_erase_ and _cleanup_string_free_erase_
Lennart Poettering [Wed, 14 Oct 2015 20:40:23 +0000 (22:40 +0200)]
tree-wide: whenever we deal with passwords, erase them from memory after use
A bit snake-oilish, but can't hurt.
Lennart Poettering [Wed, 14 Oct 2015 20:41:25 +0000 (22:41 +0200)]
core: actually set pids_max field after parsing it
Fixes one of the issues pointed out in #1522.
Lennart Poettering [Wed, 14 Oct 2015 17:33:20 +0000 (19:33 +0200)]
journald: make sure r is always initialized
Lennart Poettering [Wed, 14 Oct 2015 17:33:01 +0000 (19:33 +0200)]
journal: fix bad memory freeing
Lennart Poettering [Wed, 14 Oct 2015 17:32:46 +0000 (19:32 +0200)]
tree-wide: add more void casts for various syscall invocations
Lennart Poettering [Wed, 14 Oct 2015 17:31:42 +0000 (19:31 +0200)]
core: fix type of NetClass dbus property
it's exposed as uint32_t and it is internally an uint32_t, hence no need
to treat it as an unsigned.
Lennart Poettering [Wed, 14 Oct 2015 17:30:40 +0000 (19:30 +0200)]
man: move documentation about NetClass from systemd.unit(5) to systemd.resource-control(5)
This is after all where we expose all the other cgroup props, especially
those that can be adjusted dynamically.
Lennart Poettering [Mon, 19 Oct 2015 20:31:58 +0000 (22:31 +0200)]
update CODING_STYLE
Lennart Poettering [Mon, 19 Oct 2015 20:30:11 +0000 (22:30 +0200)]
update TODO
Lennart Poettering [Mon, 19 Oct 2015 20:09:10 +0000 (22:09 +0200)]
Merge pull request #1614 from alkino/master
Hook more properties for transient units
Lennart Poettering [Mon, 19 Oct 2015 20:06:06 +0000 (22:06 +0200)]
Merge pull request #1613 from phomes/unused-functions-2
tree-wide: remove unused functions
Nicolas Cornu [Mon, 19 Oct 2015 19:57:01 +0000 (21:57 +0200)]
Hook more properties for transient units
systemd-run can now launch units with EnvironmentFile set.