Commit graph

1207 commits

Author SHA1 Message Date
Tom Gundersen a1da85830b machinectl: port to sd-bus 2013-10-30 03:40:23 +01:00
Kay Sievers 77632684f3 build-sys: remove default CFLAGS assignment 2013-10-30 02:39:32 +01:00
Lennart Poettering c335068380 machined: port over to libsystemd-bus 2013-10-30 02:08:57 +01:00
Tom Gundersen 3aeb37bc4f rtnl: move set_link_properties to rtnl-utils 2013-10-29 21:26:22 +01:00
Tom Gundersen 5fde13d748 udev: link-config - add proper parsing 2013-10-29 14:17:57 +01:00
Tom Gundersen 0b99c9f8f0 udev: builtin - rename net_link to net_setup_link
Also add shell completions.
2013-10-29 14:17:57 +01:00
Tom Gundersen 9dc670ea76 network: move configuration to /etc/systemd/network
This is private configuraiton, so let's not pollute the namespace (and hence make Debian happy :) ).
2013-10-29 14:17:57 +01:00
Tom Gundersen 3716e8c99c udev: don't mix static and dynamic libs 2013-10-28 18:58:19 +01:00
Tom Gundersen 16b9b87aee udev: link-config - add mac address policy
This introduces a new key MACAddressPolicy.

The possible policies are 'persistent' and 'random'.

'persistent' will do nothing if the current address is the hardware address,
but if the hardware does not have an address (or another address is set for
whatever reason), we will generate an address which will be random, but
persistent between boots (based on machineid and persistent netif name).

'random' will do nothing if the kernel already set a random address, otherwise
it will generate a random one and use that instead.

This patch sets MACAddressPolicy=persistent in the default .link file.
2013-10-28 18:10:23 +01:00
Tom Gundersen daeb71a36a udev: link-config - move naming policy from udev rules
This introduces a new key NamePolicy, which takes an ordered list of naming
policies. The first successful one is applide. If all fail the value of Name
(if any) is used.

The possible policies are 'onboard', 'slot', 'path' and 'mac'.

This patch introduces a default link file, which replaces the equivalent udev
rule.
2013-10-28 01:18:04 +01:00
Tom Gundersen 43b3a5ef61 udev: link-config: add rtnl support
This adds support for setting the mac address, name and mtu.

Example:

[Link]
MTU=1450
MACAddress=98:76:54:32:10:ab
Name=wireless0
2013-10-27 22:23:58 +01:00
Tom Gundersen 65f568bbeb libsystemd-rtnl: add a rtnetlink library
This is intentionally as similar to sd-bus as possible. While it
would be simple to export it, the intentions is to keep this
internal (at least for the forseeable future).

Currently only synchronous communication is implemented
2013-10-27 22:18:34 +01:00
Tom Gundersen a501033335 udev: link-config: add ethtool support
This adds support for setting the link speed, duplex and WakeOnLan
settings.

Example:

[Link]
SpeedMBytes=100
Duplex=half
WakeOnLan=magic
2013-10-26 22:09:20 +02:00
Tom Gundersen af6f0d422c udev: add network link configuration tool
This tool applies hardware specific settings to network devices before they
are announced via libudev.

Settings that will probably eventually be supported are MTU, Speed,
DuplexMode, WakeOnLan, MACAddress, MACAddressPolicy (e.g., 'hardware',
'synthetic' or 'random'), Name and NamePolicy (replacing our current
interface naming logic). This patch only introduces support for
Description, as a proof of concept.

Some of these settings may later be overriden by a network management
daemon/script. However, these tools should always listen and wait on libudev
before touching a device (listening on netlink is not enough). This is no
different from how things used to be, as we always supported changing the
network interface name from udev rules, which does not work if someone
has already started using it.

The tool is configured by .link files in /etc/net/links/ (with the usual
overriding logic in /run and /lib). The first (in lexicographical order)
matching .link file is applied to a given device, and all others are ignored.

The .link files contain a [Match] section with (currently) the keys
MACAddress, Driver, Type (see DEVTYPE in udevadm info) and Path (this
matches on the stable device path as exposed as ID_PATH, and not the
unstable DEVPATH). A .link file matches a given device if all of the
specified keys do. Currently the keys are treated as plain strings,
but some limited globbing may later be added to the keys where it
makes sense.

Example:

/etc/net/links/50-wireless.link
[Match]
MACAddress=98:f2:e4:42:c6:92
Path=pci-0000:02:00.0-bcma-0
Type=wlan

[Link]
Description=The wireless link
2013-10-26 22:09:20 +02:00
Thomas Hindoe Paaboel Andersen 048ecf5b84 analyze: port to sd-bus 2013-10-25 20:59:01 +02:00
Zbigniew Jędrzejewski-Szmek d8c9d3a468 systemd: use unit name in PrivateTmp directories
Unit name is used whole in the directory name, so that the unit name
can be easily extracted from it, e.g. "/tmp/systemd-abcd.service-DEDBIF1".

https://bugzilla.redhat.com/show_bug.cgi?id=957439
2013-10-22 22:54:09 -04:00
Tom Gundersen 0fb0c56f52 inhibit: port to sd-bus 2013-10-22 13:00:54 +01:00
Kay Sievers b0770377ab analyze: systemd-analyze.c -> analyze.c 2013-10-22 13:55:50 +02:00
Kay Sievers 8d45130966 localed: port from libdbus to libsystemd-bus 2013-10-22 13:25:17 +02:00
Kay Sievers ca2871d9b0 bus: remove static introspection file export 2013-10-21 00:41:26 +02:00
Kay Sievers 145d22584f build-sys: unify foo_CFLAGS = usage and add explaining comments
Always add the default AM_CFLAGS first.

If variables are used in conditionals, the default assignment
of AM variables is disabled, even when the conditional is not
in use; foo_CFLAGS = $(AM_CFLAGS) is needed, even when it looks
like a no-op.
2013-10-20 17:34:15 +02:00
Colin Walters a54156a297 Revert "build-sys: move journalctl CFLAGS= to one line"
This reverts commit e5d5aa1d0f4e143f12f5e00ca072547369d37e53; it
breaks if !HAVE_QRENCODE since then we aren't using $(AM_CFLAGS) for
journalctl.
2013-10-20 09:53:05 -04:00
Kay Sievers e5d5aa1d0f build-sys: move journalctl CFLAGS= to one line 2013-10-20 01:00:23 +02:00
Tom Gundersen a7623afb7a fsck-root: only run when requested in fstab
fsck-root is redundant in case an initrd is used, or in case the rootfs
is never remounted 'rw', so the new default is the correct behavior for
most users. For the rest, they should enable it in fstab.
2013-10-19 12:23:17 +02:00
Colin Walters 4ca302b967 build-sys: Honor CFLAGS for journalctl again
Regression from e905a45681.
2013-10-18 10:13:52 -04:00
Lennart Poettering 58c5d4215a build-sys: fix += vs = in Makefile 2013-10-18 14:21:36 +02:00
Tom Gundersen 89456fcee4 update-utmp: port to sd-bus
Change from GetUnit to LoadUnit to make sure we can detect the current legacy
runlevel, even if nothing loaded the legacy target files yet.
2013-10-18 06:21:26 +02:00
Lennart Poettering 96c374d0a5 socket-proxyd: rename from saproxy
The thing is a daemon, hence needs a "d" prefix. Also, we tend to not
abbreviate names of background components unnecessarily, since they are
not primary commands people type. Then, the fact that this thing does
socket actviation is mostly in implementationd detail for the proxy.

Also, do some minor indenting clean-ups and other code updates.
2013-10-18 02:58:47 +02:00
Lennart Poettering e905a45681 build-sys: drop a number CFLAGS assignments in Makefile that are pointless 2013-10-18 02:37:38 +02:00
Tom Gundersen b75b4db0af initctl: port to sd-bus 2013-10-18 01:34:55 +02:00
Tom Gundersen d05f1cae2f cgroup-agent: port to sd-bus 2013-10-18 00:55:24 +02:00
Tom Gundersen 0c842e0ac0 fsck: port to sd-bus 2013-10-18 00:55:24 +02:00
Lennart Poettering 66a4c743c0 hostnamed: port over from libdbus to libsystemd-bus 2013-10-18 00:49:01 +02:00
Lennart Poettering aacf3b483b api: unify some common bits used by public systemd APIs 2013-10-16 17:01:26 +02:00
Lennart Poettering 40ca29a137 timedated: use libsystemd-bus instead of libdbus for bus communication
Among other things this also adds a few things necessary for the change:

- Considerably more powerful error returning APIs in libsystemd-bus

- Adapter for connecting an sd_bus to an sd_event

- As I reworked the PolicyKit logic to the new library I also made it
  asynchronous, so that PolicyKit requests of one user cannot block out
  another user anymore.

- We always use the macro names for common bus error. That way it is
  harder to mistype them since the compiler will notice
2013-10-16 06:15:02 +02:00
David Strauss d1b38fac57 Rename sabridge to saproxy to be less cryptic 2013-10-15 17:00:18 -07:00
David Strauss 912b54ad47 Add sabridge for socket activation of traditional daemons 2013-10-15 16:13:30 -07:00
Kay Sievers b0130bf608 build-sys: libsystemd-id128 - get rid of the needless selinux linking (again)
$ ldd libsystemd-id128.so
        linux-vdso.so.1 =>  (0x00007fffce377000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f4de1fc1000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f4de1db9000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f4de1bb4000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f4de17f5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4de2406000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f4de158f000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4de1371000)

$ ldd libsystemd-id128.so
        linux-vdso.so.1 =>  (0x00007fff25187000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f41a3964000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f41a35a5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f41a3d89000)
2013-10-15 02:29:29 +02:00
Kay Sievers 9cada1952a build-sys: libudev - get rid of the needless selinux linking (again) 2013-10-15 02:11:56 +02:00
Lennart Poettering 3990f24765 rfkill: add new rfkill tool to save/restore rfkill state across reboots
This works analogous to the existing backlight and random seed services
2013-10-14 04:31:49 +02:00
Zbigniew Jędrzejewski-Szmek 1ca208fb4f Introduce udev object cleanup functions 2013-10-13 17:56:55 -04:00
Shawn Landden 35d811f521 test: test for ellipsize 2013-10-13 17:56:54 -04:00
Shawn Landden f405e86de3 util, utf8: make ellipsize take multi-byte characters into account
rename old versions to ascii_*

Do not take into account zerowidth characters, but do consider double-wide characters.
Import needed utf8 helper code from glib.

v3: rebase ontop of utf8 restructuring work

[zj: tweak the algorithm a bit, move new code to separate file]
2013-10-13 17:56:54 -04:00
Lennart Poettering 992c052c34 bus: split up overly long sd-bus.c into three files 2013-10-11 20:18:10 +02:00
Lennart Poettering d682b3a7e7 security: rework selinux, smack, ima, apparmor detection logic
Always cache the results, and bypass low-level security calls when the
respective subsystem is not enabled.
2013-10-10 16:35:44 +02:00
Lennart Poettering fd38203a2a bus: add minimal event loop API
So far we tried to use epoll directly wherever we needed an event loop.
However, that has various shortcomings, such as the inability to handle
larger amounts of timers (since each timerfd costs one fd, which is a
very limited resource, usually bounded to 1024), and inability to do
priorisation between multiple queued events.

Let's add a minimal event loop API around epoll that is suitable for
implementation of our own daemons and maybe one day can become public
API for those who desire it.

This loop is part of libsystemd-bus, but may be used independently of
it.
2013-10-10 04:44:48 +02:00
Auke Kok 8552b17660 Smack: Test if smack is enabled before mounting
Since on most systems with xattr systemd will compile with Smack
support enabled, we still attempt to mount various fs's with
Smack-only options.

Before mounting any of these Smack-related filesystems with
Smack specific mount options, check if Smack is functionally
active on the running kernel.

If Smack is really enabled in the kernel, all these Smack mounts
are now *fatal*, as they should be.

We no longer mount smackfs if systemd was compiled without
Smack support. This makes it easier to make smackfs mount
failures a critical error when Smack is enabled.

We no longer mount these filesystems with their Smack specific
options inside containers. There these filesystems will be
mounted with there non-mount smack options for now.
2013-10-09 15:06:17 -07:00
Lennart Poettering cac914e643 build-sys: add a makefile target to run all tests through valgrind 2013-10-09 04:08:00 +02:00
Kay Sievers 87b20a8118 build-sys: add sd-bus-vtable.h header 2013-10-09 03:39:57 +02:00
Lennart Poettering 29ddb38fea libsystemd-bus: add lightweight object vtable implementation for exposing objects on the bus
This adds a lightweight scheme how to define interfaces in static fixed
arrays which then can be easily registered on a bus connection. This
makes it much easier to write bus services.

This automatically handles implementation of the Properties,
ObjectManager, and Introspection bus interfaces.
2013-10-09 02:40:07 +02:00