Commit graph

11248 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 2e8522767e generators: rename add_{root,usr}_mount to add_{sysroot,sysroot_usr}_mount
This makes it obvious that those functions are only usable in the
initramfs.

Also, add a warning when noauto, nofail, or automount is used for the
root fs, instead of silently ignoring. Using those options would be a
sign of significant misconfiguration, and if we bother to check for
them, than let's go all the way and complain.

Other various small cleanups and reformattings elsewhere.
2015-05-04 08:45:07 -04:00
Patrik Flykt be3a09b7ff network: Implement fallback DHCPv6 prefix handling for older kernels
When setting IPv6 addresses acquired by DHCPv6, systemd-networkd sets
the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. As
the flag and the attribute are present starting with Linux 3.14, older
kernels will need systemd-network to manage prefix route expiry.

By default, DHCPv6 addresses are first assigned setting the
IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. Should
the address assignment fail, the same assignment is tried without
the IFA_FLAGS attribute. Should also the second attempt fail, an error
is printed and address assignment ends with failure. As successful use
of the IFA_FLAGS netlink attribute is recorded in the Link structure,
the DHCPv6 code will know if the kernel or systemd-network fallback
code handles expiring prefixes.

The prefix expiration and IPv6 address updating fallback code is
resurrected from the parts deleted with commit
47d45d3cde.

This patch can be removed once the minimum kernel requirements are
greater than or equal to 3.14.
2015-05-04 09:42:37 +03:00
Zbigniew Jędrzejewski-Szmek 336b5c615e fstab-generator: fix memleak
filtered was used to store an allocated string twice. The first allocation was
thus lost. The string is not needed for anything, so simply skip the allocation.

Fixup for deb0a77cf0.
2015-05-02 13:01:28 -04:00
Thomas Hindoe Paaboel Andersen 470d7e17f9 terminal: update for simpler sd-bus api's 2015-04-30 20:12:48 +02:00
Lennart Poettering 696fd1ef4f core: simplify %r and %R logic a bit
Do not calculate the cgroup path manually, just use normal unit fields
and calls for that.
2015-04-30 12:33:54 +02:00
Lennart Poettering c96cc5822c core: catch some special cases in cg_slice_to_path() 2015-04-30 12:33:35 +02:00
Lennart Poettering 6bd68a1aa2 sym: adding missing symbols to .sym file 2015-04-30 12:01:19 +02:00
Lennart Poettering 329ac4bc54 sd-bus,sd-login: add api for querying the slice within the the user systemd instance of a process
units are organized in slice trees, not only for the system instance,
but also for user systemd instances, expose this properly.
2015-04-30 11:58:06 +02:00
Lennart Poettering 1c2e9646e4 core: simplify unit type detection logic
Introduce a new call unit_type_supported() and make use of it
everywhere.

Also, drop Manager parameter from per-type supported method prototype.
2015-04-30 01:29:00 +02:00
Lennart Poettering 524d896ac1 sd-bus: when we get ENOTTY on the HELLO ioctl assume incompatible API version
As perparation for future incompatible kdbus kernel API changes.
2015-04-30 01:24:48 +02:00
Lennart Poettering 8b0849e971 core: rework cgroup path parse logic
Various cleanups, be stricter when parsing unit paths.

Most importantly: return the root slice "-.slice" when asked for slice
of paths that contain no slice component.
2015-04-30 00:49:41 +02:00
Susant Sahani 9011ce771f networkd: introduce vti6 tunnel
This patch add support to create vti6 tunnel

test:

vt6.network
[Match]
Name=wlan0

[Network]
Tunnel=ip6vti

vti6.netdev
[NetDev]
Name=ip6vti
Kind=vti6

[Tunnel]
Local=2a00:ffde:4567:edde::4987
Remote=2001:473:fece:cafe::5179

ip link

11: ip6_vti0@NONE: <NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT
group default
    link/tunnel6 :: brd ::
12: ip6vti@wlan0: <POINTOPOINT,NOARP> mtu 1500 qdisc noop state DOWN
mode DEFAULT group default
    link/tunnel6 2a00:ffde:4567:edde::4987 peer 2001:473:fece:cafe::5179
2015-04-29 21:54:00 +02:00
Susant Sahani 5289f3ff07 networkd: tunnel improve logging
Replaces a lof ot strerror() usage with log_netdev_error_errno()
2015-04-29 21:54:00 +02:00
Lennart Poettering cfeaa44a09 sd-bus: properly handle creds that are known but undefined for a process
A number of fields do not apply to all processes, including: there a
processes without a controlling tty, without parent process, without
service, user services or session. To distuingish these cases from the
case where we simply don't have the data, always return ENXIO for them,
while returning ENODATA for the case where we really lack the
information.

Also update the credentials dumping code to show this properly. Fields
that are known but do not apply are now shown as "n/a".

Note that this also changes some of the calls in process-util.c and
cgroup-util.c to return ENXIO for these cases.
2015-04-29 21:45:58 +02:00
Mantas Mikulėnas cfa9677bd1 core: fix event source annotations
These looked like a mass-replace gone slightly wrong – two statements
with no { }'s, and no error checking.
2015-04-29 20:38:48 +02:00
Lennart Poettering 966c66e349 tree-wide: get rid of a few more explicit bus parameters 2015-04-29 19:10:09 +02:00
Lennart Poettering 8f88ecf623 core: for queued reload message there is no need to store the bus explicitly
After all it can be derived from the message directly, and already is.
2015-04-29 19:02:08 +02:00
Lennart Poettering 9030ca462b sd-bus: allow passing NULL as bus parameter to sd_bus_send()
If NULL is specified for the bus it is now automatically derived from
the passed in message.

This commit also changes a number of invocations of sd_bus_send() to
make use of this.
2015-04-29 18:58:30 +02:00
Lennart Poettering 190700621f sd-bus: drop bus parameter from message callback prototype
This should simplify the prototype a bit. The bus parameter is redundant
in most cases, and in the few where it matters it can be derived from
the message via sd_bus_message_get_bus().
2015-04-29 18:36:25 +02:00
Tom Gundersen a9beb123d1 test: rename test-bus-kernel-benchmark to test-bus-benchmark
This can now benchmark more than just kdbus.
2015-04-29 17:08:31 +02:00
Tom Gundersen 7dfbe2e3fc core: annotate event sources 2015-04-29 17:08:31 +02:00
Tom Gundersen 77cfd1139c sd-bus: benchmark - also support testing non-kdbus transports
We introduce two news types of benchmarks in chart-mode:
 - 'legacy' connects using the session bus
 - 'direct' connects using a peer-to-peer socket

We should probably also introduce a mode for testing the dbus1-kdbus proxy.
2015-04-29 17:08:31 +02:00
Tom Gundersen 7800bf7169 libudev: monitor - fix typo in log message 2015-04-29 17:00:16 +02:00
Lennart Poettering 11b90e69e5 machined: make PropertiesChanged match more strict 2015-04-28 21:34:23 +02:00
Lennart Poettering 9b420b3cfb machined: make sure to track machine unit states properly
If a unit is stopped for a moment, we need to invalidate our knowledge
of it, otherwise we might be confused by automatic restarts

This makes reboots for nspawn containers run as service work correctly.

https://bugs.freedesktop.org/show_bug.cgi?id=87428
2015-04-28 21:34:23 +02:00
Lennart Poettering fe506d569d bus-util: drop redundant bus argument from bus_message_map_all_properties() and related calls 2015-04-28 21:34:23 +02:00
Lennart Poettering 1a2399e57d nspawn: when run as a service, don't ask machined for terminatin of ourselves 2015-04-28 21:34:23 +02:00
Lennart Poettering 773ce3d89c nspawn: make sure we install the device policy if nspawn is run as unit as on the command line 2015-04-28 21:34:23 +02:00
Lennart Poettering a509f0e631 service: make restart logic a bit easier to understand 2015-04-28 21:34:23 +02:00
Lennart Poettering 597466f497 exit-status: introduce common exit_status_set_test() call for testing exit status set membership 2015-04-28 21:34:23 +02:00
Thomas Hindoe Paaboel Andersen 68a01fb658 scope: use correct enum type 2015-04-28 19:03:11 +02:00
Lennart Poettering 96d9117ad2 fsck: remove fsckd again, but keep the door open for external replacement
For a longer discussion see this:

http://lists.freedesktop.org/archives/systemd-devel/2015-April/030175.html

This introduces /run/systemd/fsck.progress as a simply
AF_UNIX/SOCK_STREAM socket. If it exists and is connectable we'll
connect fsck's -c switch with it. If external programs want to get
progress data they should hence listen on this socket and will get
all they need via that socket. To get information about the connecting
fsck client they should use SO_PEERCRED.

Unless /run/systemd/fsck.progress is around and connectable this change
reverts back to v219 behaviour where we'd forward fsck output to
/dev/console on our own.
2015-04-28 17:30:00 +02:00
Lennart Poettering e7a3aa3df6 fsck: minor improvements
Among other smaller fixes, explicitly check if we are invoked on a block
device before making use of st.st_rdev.
2015-04-28 17:30:00 +02:00
Lennart Poettering 24b52437dd fsck: parse kernel cmdline booleans the same ways as the rest 2015-04-28 17:30:00 +02:00
Martin Pitt bf74cd6549 unit: Drop unused variables
src/core/unit.c: In function 'unit_coldplug':
src/core/unit.c:2884:18: warning: unused variable 'i' [-Wunused-variable]
         Iterator i;
                  ^
src/core/unit.c:2883:15: warning: unused variable 'other' [-Wunused-variable]
         Unit *other;
               ^
2015-04-28 15:42:18 +02:00
Lennart Poettering 3d161f991e run: by default, wait until the transient unit finished start-up
Make this blocking behaviour optional with --no-block, similar to
systemctl's switch of this name.
2015-04-28 12:33:19 +02:00
Lennart Poettering de158ed22d run: synchronously wait until the scope unit we create is started
Otherwise it might happen that by the time PID 1 adds our process to the
scope unit the process might already have died, if the process is
short-running (such as an invocation to /bin/true).

https://bugs.freedesktop.org/show_bug.cgi?id=86520
2015-04-28 12:21:31 +02:00
Lennart Poettering dd305ec9c6 core: when we cannot add PID to a scope cgroup, log about it
Also, place the scope unit in failed state.
2015-04-28 12:20:57 +02:00
Lennart Poettering 373a99e489 bus-util: print correct warnings for units that fail but for which we have a NULL result only 2015-04-28 12:12:29 +02:00
Ivan Shapovalov 4370633083 core: coldplug all units which participate in jobs during coldplugging
This is yet another attempt to fix coldplugging order (more especially,
the problem which happens when one creates a job during coldplugging and
it references a not-yet-coldplugged unit).

Now we forcibly coldplug all units which participate in jobs. This
is a superset of previously implemented handling of the UNIT_TRIGGERS
dependencies, so that handling is removed.

http://lists.freedesktop.org/archives/systemd-devel/2015-April/031212.html
https://bugs.freedesktop.org/show_bug.cgi?id=88401 (once again)
2015-04-27 21:45:12 +02:00
Lennart Poettering 329c542585 update-done: ignore nanosecond file timestamp components, they are not reliable
https://bugs.freedesktop.org/show_bug.cgi?id=90192
2015-04-27 17:25:57 +02:00
Lennart Poettering 0a2f9085e2 update-done: minor simplification 2015-04-27 17:22:55 +02:00
Thomas Hindoe Paaboel Andersen 8431778882 path-util: fix fstat fallback in fd_is_mount_point 2015-04-26 16:02:21 +02:00
Thomas Hindoe Paaboel Andersen 5921fc3cc3 sysv-generator: avoid freeing uninitialized variable
Would happen if lookup_paths_init returns an error.
2015-04-26 14:45:49 +02:00
Tom Gundersen 965288c5ee libudev: monitor - clarify log messages 2015-04-26 01:30:23 +02:00
Tom Gundersen 7141e4f62c sd-device: don't retry loading uevent/db files more than once
If for whatever reason there was nothing to load or loading failed, don't keep trying.
2015-04-26 01:30:23 +02:00
Tom Gundersen 2a2137401b sd-device: don't complain if the uevent file is missing
Only 'real' devices are required to have an uevent file.
2015-04-26 01:30:23 +02:00
Daniel Mack 5d236c1f42 bootchart: kill newline characters from log_error_errno() calls 2015-04-24 21:51:43 +02:00
Daniel Mack d3a2a05329 systemctl: kill newline characters from log_error_errno() calls
log_error_errno() already adds a newline, so drop them.
2015-04-24 21:50:36 +02:00
Daniel Mack c2a23db0b9 logind: kill newline characters from log_error_errno() calls
log_error_errno() already adds a newline, so drop them.
2015-04-24 21:44:51 +02:00