1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00
Commit Graph

1310 Commits

Author SHA1 Message Date
Lennart Poettering
baabc57764 build-sys: move more files from core/ to share/ that are generic enough 2013-11-22 16:31:40 +01:00
Lennart Poettering
780896a4f1 bus: rework sd_bus_error APIs
All calls that set a sd_bus_error structure will now return the same
error converted to a negative errno. This may be used as syntactic sugar
to return from a function and setting a bus_error structure in one go.

Also, translate all Linux Exyz (EIO, EINVAL, EUCLEAN, EPIPE, ...)
automatically into counterparts in the (new) "Posix.Error." namespace.

If we fail to allocate memory for the components of a sd_bus_error
automatically reset it to an OOM error which we always can write.
2013-11-22 04:23:22 +01:00
David Strauss
6414b7c981 cgroups: Cache controller masks and optimize queues. 2013-11-22 11:22:47 +10:00
Lennart Poettering
718db96199 core: convert PID 1 to libsystemd-bus
This patch converts PID 1 to libsystemd-bus and thus drops the
dependency on libdbus. The only remaining code using libdbus is a test
case that validates our bus marshalling against libdbus' marshalling,
and this dependency can be turned off.

This patch also adds a couple of things to libsystem-bus, that are
necessary to make the port work:

- Synthesizing of "Disconnected" messages when bus connections are
  severed.

- Support for attaching multiple vtables for the same interface on the
  same path.

This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus
calls which used an inappropriate signature.

As a side effect we will now generate PropertiesChanged messages which
carry property contents, rather than just invalidation information.
2013-11-20 20:52:36 +01:00
Sylvain Plantefeve
0571a6b0a9 catalog: add French translation 2013-11-17 11:56:19 -05:00
Zbigniew Jędrzejewski-Szmek
952d97ed2b random-seed: improve debugging messages a bit 2013-11-15 22:53:14 -05:00
Dave Reisner
4e1b76c214 build: use printf to generate symbol tests
echo is basically unportable, so use printf instead.
2013-11-15 22:44:02 -05:00
Tom Gundersen
b5643a8b1b build-sys: don't mix dynamic and static libs 2013-11-15 14:00:24 +01:00
Tom Gundersen
b4f2a5b197 rtnl: add event loop integration 2013-11-14 23:22:58 +01:00
Tom Gundersen
81eca919f7 loopback-setup: move to rtnl
This should be equivalent to the old behavior.
2013-11-14 15:11:15 +01:00
Marko Myllynen
51d0f1c9f6 zsh-completion: add bootctl 2013-11-13 23:02:23 -05:00
Kay Sievers
64a9e4d763 libsystemd-id128: statically include sd_listen_fds() 2013-11-13 02:47:25 +01:00
Zbigniew Jędrzejewski-Szmek
9173a3082f build-sys: parallelize 'exported' target 2013-11-12 19:02:28 -05:00
Zbigniew Jędrzejewski-Szmek
dc579853d4 build-sys: make public libraries depend on .sym files
This way modyfing the .sym file causes a rebuild.
2013-11-12 19:00:23 -05:00
Zbigniew Jędrzejewski-Szmek
f1e0c18340 build-sys: add a link test for exported symbols
I know that this is a pretty big net to catch some small fish,
but we *do* regularly forget to properly export symbols that
were supposed to be exported.

This time sd_bus_get_current and some renamed symbols are caught.
2013-11-12 18:58:34 -05:00
Colin Walters
3c9317d2d9 build-sys: Add --disable-networkd option
For GNOME (Continuous), we are unlikely to require or want
systemd-networkd in the near term future; all of the tools and code
are targeting NetworkManager.

The long term story is still an open question of course, but for now,
there's no reason for gnome-continuous to build or ship this.
2013-11-12 22:38:08 +01:00
Lennart Poettering
2b5c5383e4 bus: beautify bus_message_dump() output a bit 2013-11-12 00:12:44 +01:00
Lennart Poettering
d23284faa9 build-sys: subtract list of exported symbols from "check-api-unused" list 2013-11-10 23:54:55 +01:00
Zbigniew Jędrzejewski-Szmek
39da205fbb build-sys: simplify defined/undefined definition 2013-11-09 19:02:53 -05:00
Tom Gundersen
f579559b3a networkd: add a basic network daemon
This daemon listens for and configures network devices tagged with
'systemd-networkd'. By default, no devices are tagged so this daemon
can safely run in parallel with existing network daemons/scripts.

Networks are configured in /etc/systemd/network/*.network. The first .network
file that matches a given link is applied. The matching logic is similar to
the one for .link files, but additionally supports matching on interface name.

The mid-term aim is to provide an alternative to ad-hoc scripts currently used
in initrd's and for wired setups that don't change much (e.g., as seen on
servers/and some embedded systems).

Currently, static addresses and a gateway can be configured.

Example .network file:

[Match]
Name=wlp2s0

[Network]
Description=My Network
Gateway=192.168.1.1
Address=192.168.1.23/24
Address=fe80::9aee:94ff:fe3f:c618/64
2013-11-09 23:41:17 +01:00
Lennart Poettering
f842cd74ea build-sys: fix rule for generating undefined list 2013-11-08 18:12:45 +01:00
Lennart Poettering
9070a9c103 build-sys: add make check-api-unused 2013-11-08 16:53:29 +01:00
Lennart Poettering
862e8bf8c6 build-sys: install busctl 2013-11-08 16:53:28 +01:00
Marc-Antoine Perennou
f459b6025f systemctl: port to libsystemd-bus 2013-11-08 14:07:27 +01:00
Simon Peeters
f8f14b3654 loginctl: convert to sd-bus
NOTE: the show-* subcommands do not print some properties:
  this are those with types like (so), a(so), (uo),...
  we need to fix this, but I'm not sure how
2013-11-07 21:01:48 +01:00
Lennart Poettering
fa57130d35 man: add docs for sd_is_special() and some man page symlinks 2013-11-07 17:51:09 +01:00
Lennart Poettering
a27e222b58 build-sys: add a make target to look for undocumented symbols
With super-pretty output!
2013-11-07 17:26:01 +01:00
Lennart Poettering
aac6ad0d2f build-sys: don't install sd-shutdown.h, it is a drop-in header like sd-readahead.h 2013-11-07 16:53:25 +01:00
Kay Sievers
48d7417d3e build-sys: link most internal libraries statically
Libraries and tools, both use shared symbols wich have global state
and should only exist once in the final image.
2013-11-07 14:59:16 +01:00
Lennart Poettering
c3b8df24a9 build-sys: add .pc file for libsystemd-bus 2013-11-07 03:27:58 +01:00
Lennart Poettering
c8a8806e77 build-sys: merge sd-event into sd-bus
The sd-event APIs should be available only as part of libsystemd-bus so
that the utility calls are not linked into each independently and we can
minimize the number of libraries we have.
2013-11-07 03:20:40 +01:00
Lennart Poettering
faaa5728d9 utf8: export utf8 validation functions as part of sd-bus
To write useful bus code clients need to validate utf8 frequently since
the bus reacts allergic to it. Since glibc does not provide any calls
for this, let's provide it as part of libsystemd-bus.
2013-11-07 03:07:40 +01:00
Kay Sievers
7b14798286 build-sys: distribute libsystemd-*.sym 2013-11-07 01:43:33 +01:00
Kay Sievers
7c693da9df build-sys: remove no longer needed DBUS_CFLAGS 2013-11-07 01:33:07 +01:00
Kay Sievers
fdd6816f7d build-sys: add sd-event to socket-proxyd 2013-11-06 23:28:07 +01:00
Lennart Poettering
175a3d25d0 active: rework make_socket_fd() to be based on socket_address_listen()
Among other things this makes sure we set SO_REUSEADDR which is
immensely useful.
2013-11-06 23:03:12 +01:00
Zbigniew Jędrzejewski-Szmek
ffcfcb6b2c pam_systemd: port to libsystemd-bus 2013-11-06 14:56:47 -05:00
Zbigniew Jędrzejewski-Szmek
f7262a9f28 bus: add public libsystemd-event 2013-11-06 14:56:47 -05:00
Zbigniew Jędrzejewski-Szmek
d9f644e2cd bus: export libsystemd-bus as a public library
Old static libsystemd-bus.la becomes libsystemd-bus-internal.la.
memfd functions are also exported in the same library.

(Best viewed with --color-words -U0).
2013-11-06 14:56:47 -05:00
Kay Sievers
d91ed6423b build-sys: remove CFLAGS default assignment 2013-11-05 21:35:20 +01:00
Kay Sievers
997d4ae7f2 login: port test-inhibit to libsystemd-bus 2013-11-05 21:34:42 +01:00
Lennart Poettering
b8b7e4060f bus: delete some now used dbus1 code 2013-11-05 03:07:39 +01:00
Lennart Poettering
cc37738108 logind: port logind to libsystemd-bus 2013-11-05 01:13:05 +01:00
Tom Gundersen
be32eb9b7f net-config: start split out matching and parsing logic
Move this to src/share/net-util.c, so it can be used elsewhere.
2013-11-04 23:00:12 +01:00
David Herrmann
0a8da8305a rules: load path_id on DRM devices
The path_id-builtin provides useful unique aliases for DRM devices. If we
want to configure DRM render-nodes for compositors, we want to avoid
storing the whole sys-path in configuration files. Hence, allow users to
store the short PATH_ID instead.

Load path_id-builtin unconditionally on DRM devices now to always provide
this alias.
2013-11-03 13:12:13 +01:00
Simon Peeters
b028f3e410 hostnamectl: port to sd-bus
Kay:
 - rebase to new transport logic
 - replaced iteration macro with property map
2013-11-02 02:15:54 +01:00
Ronny Chevalier
d74ab85216 zsh-completion: add systemd-run 2013-10-30 22:45:18 -04:00
Lennart Poettering
04d3927924 machinectl: add new command to spawn a getty inside a container 2013-10-31 01:43:38 +01:00
Lennart Poettering
4ba9328022 nspawn: split out pty forwaring logic into ptyfwd.c 2013-10-31 01:43:38 +01:00
Kay Sievers
4d7859d173 localectl: port to libsystemd-bus 2013-10-30 22:50:09 +01:00
Thomas Hindoe Paaboel Andersen
a281d9c785 timedatectl: port to sd-bus 2013-10-30 21:13:46 +01:00
Lennart Poettering
a7893c6b28 bus: add API call to create bus connection to the system bus of local containers
Also, add support for this to machinectl, so that we can enumerate the
machines that run inside a container. We must go deeper!
2013-10-30 15:37:02 +01:00
Tom Gundersen
3e137a1b9a udev: link-config - let udevd set the ifname 2013-10-30 15:36:04 +01:00
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