1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

18827 Commits

Author SHA1 Message Date
Lennart Poettering
aceac2f0b6 import: rename "gpt" disk image type to "raw"
After all, nspawn can now dissect MBR partition levels, too, hence
".gpt" appears a misnomer. Moreover, the the .raw suffix for these files
is already pretty popular (the Fedora disk images use it for example),
hence sounds like an OK scheme to adopt.
2015-01-15 01:47:21 +01:00
Moez Bouhlel
d31f44e281 fix zsh completion typo
json-see => json-sse
2015-01-15 00:57:45 +01:00
Ronny Chevalier
78a8e158da test-path: do not skip tests if we are not root
We can properly run the tests without being root
2015-01-15 00:57:44 +01:00
Ronny Chevalier
68e68ca810 test-exec: do not skip all the tests
Only 5 tests cannot be executed if we are not root, so just skip them
but not the whole set.
2015-01-15 00:57:44 +01:00
Lennart Poettering
5e4074aa31 spawn: downgrade loopback detach errors to debug
Sometimes udev or some other background daemon might keep the loopback
devices busy while we already want to detach them. Downgrade the warning
about it.

Given that we use autodetach downgrading these messages should be with
little risk.
2015-01-15 00:51:56 +01:00
Lennart Poettering
ada4799ac5 nspawn: add support for limited dissecting of MBR disk images with nspawn
With this change nspawn's -i switch now can now make sense of MBR disk
images too - however only if there's only a single, bootable partition
of type 0x83 on the image. For all other cases we cannot really make
sense from the partition table alone.

The big benefit of this change is that upstream Fedora Cloud Images can
now be booted unmodified with systemd-nspawn:

 # wget http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
 # unxz Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
 # systemd-nspawn -i Fedora-Cloud-Base-20141203-21.x86_64.raw -b

Next stop: teach the import logic to automatically download these
images, uncompress and verify them.
2015-01-15 00:47:10 +01:00
Lennart Poettering
733d15ac7a nspawn: pass the container's init PID out via sd_notify()
This is useful for nspawn managers that want to learn when nspawn is
finished with initialiuzation, as well what the PID of the init system
in the container is.
2015-01-14 23:29:01 +01:00
Lennart Poettering
435fdcef52 update TODO 2015-01-14 23:18:33 +01:00
Lennart Poettering
657bdca9e4 nspawn: fix an incorrect assert comparison 2015-01-14 23:18:33 +01:00
Lennart Poettering
2fbcde7402 loginctl: fix misuse compound literals
The lifetime of compound literals is bound to the local scope, we hence
cannot refernce them outside of it.
2015-01-14 23:18:33 +01:00
Lennart Poettering
c7fbd99660 sd-bus: tell Coverity that it's OK not to care for return values in some cases 2015-01-14 23:18:33 +01:00
Lennart Poettering
30535c1692 nspawn: add file system locks for controlling access to container images
This adds three kinds of file system locks for container images:

a) a file system lock next to the actual image, in a .lck file in the
   same directory the image is located. This lock has the benefit of
   usually being located on the same NFS share as the image itself, and
   thus allows locking container images across NFS shares.

b) a file system lock in /run, named after st_dev and st_ino of the
   root of the image. This lock has the advantage that it is unique even
   if the same image is bind mounted to two different places at the same
   time, as the ino/dev stays constant for them.

c) a file system lock that is only taken when a new disk image is about
   to be created, that ensures that checking whether the name is already
   used across the search path, and actually placing the image is not
   interrupted by other code taking the name.

a + b are read-write locks. When a container is booted in read-only mode
a read lock is taken, otherwise a write lock.

Lock b is always taken after a, to avoid ABBA problems.

Lock c is mostly relevant when renaming or cloning images.
2015-01-14 23:18:33 +01:00
Lennart Poettering
805e5dda0a sysv-generator: always use fstatat() if we can 2015-01-14 23:18:33 +01:00
Lennart Poettering
b3fae863ef sysv-generator: fix memory leak on failure
This fixes a memory leak introduced by
1ed0c19f81
2015-01-14 23:18:33 +01:00
Lennart Poettering
bb4a228207 machinectl: fix minor memory leak 2015-01-14 23:18:33 +01:00
Lennart Poettering
aa0fff7f9c pty: minor modernization
We initialize structs during declartion if possible
2015-01-14 23:18:33 +01:00
Lennart Poettering
01b725684f machined: use the FS_IMMUTABLE_FL file flag, if available, to implement a "read-only" concept for raw disk images, too 2015-01-14 23:18:33 +01:00
Lennart Poettering
45030287af util: the chattr flags field is actually unsigned, judging by kernel sources
Unlike some client code suggests...
2015-01-14 23:18:33 +01:00
Lennart Poettering
679bc6cb90 ptyfw: add missing error check 2015-01-14 23:18:33 +01:00
Lennart Poettering
8937422f3b nspawn: remove the right propagation directory 2015-01-14 23:18:33 +01:00
Martin Pitt
435fc31765 test: hashmap_put behaviour for equal keys
Check string ops hashmap_put() for keys with a different pointer but the same
value.
2015-01-14 08:05:16 +01:00
Zbigniew Jędrzejewski-Szmek
b50191c23f man: remove "nofail" from systemd.swap(5)
As suggested by Marcos Felipe Rasia de Mello <marcosfrm@gmail.com>.
2015-01-13 20:05:42 -05:00
Cristian Rodríguez
d538bfc713 machinectl: use GNU basename, not the XPG version 2015-01-13 18:27:49 -05:00
Tom Gundersen
f0c4b1c3fd refcnt: refcnt is unsigned, fix comparisons
This does not make a difference, but the code was confusing.
2015-01-13 23:03:11 +01:00
Lennart Poettering
ab5e3a1bcc nspawn: --help typo fix 2015-01-13 20:59:07 +01:00
Lennart Poettering
02c74033ed update TODO 2015-01-13 20:55:13 +01:00
Lennart Poettering
43c6d5abac networkd: propagate IPFoward= per-interface setting also to /proc/sys/net/ipv4/ip_forward
We need to turn on /proc/sys/net/ipv4/ip_forward before the
per-interface forwarding setting is useful, hence let's propagate the
per-interface setting once to the system-wide setting.

Due to the unclear ownership rules of that flag, and the fact that
turning it on also has effects on other sysctl flags we try to minimize
changes to the flag, and only turn it on once. There's no logic to
turning it off again, but this should be fairly unproblematic as the
per-interface setting defaults to off anyway.
2015-01-13 20:55:13 +01:00
Lennart Poettering
cd1ddd5421 udev: make use of new one_zero() helper where appropriate 2015-01-13 20:55:13 +01:00
Lennart Poettering
769d324c99 networkd: make IP forwarding for IPv4 and IPv6 individually configurable 2015-01-13 20:17:07 +01:00
Lennart Poettering
db9fd84944 network: IPMasquerade= implies IPForward=, hence remove it 2015-01-13 20:17:07 +01:00
Lennart Poettering
fd6d906cf4 networkd: rename misnamed boolean 2015-01-13 20:17:07 +01:00
Lennart Poettering
cb9fc36a12 networkd: introduce an AddressFamilyBoolean enum type
This introduces am AddressFamilyBoolean type that works more or less
like a booleaan, but can optionally turn on/off things for ipv4 and ipv6
independently. THis also ports the DHCP field over to it.
2015-01-13 20:17:06 +01:00
Lennart Poettering
66518acd40 journald: allow zero length datagrams again
This undoes a small part of 13790add4b
which was erroneously added, given that zero length datagrams are OK,
and hence zero length reads on a SOCK_DGRAM be no means mean EOF.
2015-01-13 20:17:06 +01:00
Lennart Poettering
0dfaa00607 nspawn: add "-n" shortcut for "--network-veth"
Now that networkd's IP masquerading support means that running
containers with "--network-veth" will provide network access out of the
box for the container, let's add a shortcut "-n" for it, to make it
easily accessible.
2015-01-13 20:17:06 +01:00
Jan Engelhardt
bd763d350c doc: add cross-references between systemd.{link, netdev, network} 2015-01-13 18:27:33 +01:00
Tom Gundersen
2f6379a9ac doc: network - add comment about default prefix size
Should hopefully make it clear that this is not some magic value, just the default we picked.

Suggested by Jan Engelhardt.
2015-01-13 18:23:59 +01:00
Daniel Mack
07bde8c0ff fw-util: fix errno typo for !HAVE_LIBIPTC 2015-01-13 15:50:36 +01:00
Patrik Flykt
ec767e6836 TODO: DHCPv6 Information Request has been implemented 2015-01-13 15:09:09 +02:00
Lennart Poettering
c14db9b32a update TODO 2015-01-13 13:55:15 +01:00
Lennart Poettering
b4d8ef7c99 machined: refuse certain operation on non-container machines, since they cannot work elsewhere 2015-01-13 13:55:15 +01:00
Lennart Poettering
6da023a048 import: make sure we don't mangle file ownerships with the local passwd database when untarring 2015-01-13 13:55:15 +01:00
Lennart Poettering
6d0b55c272 nspawn: add new option "--port=" for exposing container ports on the local host
This exposes an IP port on the container as local port using DNAT.
2015-01-13 13:55:15 +01:00
Lennart Poettering
5a8bcb674f networkd: add minimal IP forwarding and masquerading support to .network files
This adds two new settings to networkd's .network files:
IPForwarding=yes and IPMasquerade=yes. The former controls the
"forwarding" sysctl setting of the interface, thus controlling whether
IP forwarding shall be enabled on the specific interface. The latter
controls whether a firewall rule shall be installed that exposes traffic
coming from the interface as coming from the local host to all other
interfaces.

This also enables both options by default for container network
interfaces, thus making "systemd-nspawn --network-veth" have network
connectivity out of the box.
2015-01-13 13:55:15 +01:00
Lennart Poettering
76917807eb shared: add minimal firewall manipulation helpers for establishing NAT rules, using libiptc 2015-01-13 13:55:15 +01:00
Martin Pitt
6cb7fa17b3 core: Fix EACCES check for OOM adjustments
Commit 3bd5c3 added a check for EACCES, but missed the minus sign.
2015-01-13 07:06:31 +01:00
Zbigniew Jędrzejewski-Szmek
038cf33420 Remove some fixed items from TODO 2015-01-12 19:15:02 -05:00
Ronny Chevalier
ee14023fd5 zsh-completion: add missing completions for systemd-tmpfiles 2015-01-12 22:19:34 +01:00
Ronny Chevalier
a80cea6861 zsh-completion: add missing completions for systemd-run 2015-01-12 22:13:33 +01:00
Ronny Chevalier
26bd71f06c zsh-completion: add missing completions for systemd-analyze 2015-01-12 22:13:18 +01:00
Ronny Chevalier
c285cb5c55 zsh-completion: add missing -M completion for timedatectl 2015-01-12 21:31:45 +01:00