Commit graph

268 commits

Author SHA1 Message Date
Lennart Poettering 92daebc0d0 sd-event: don't require a signal event source to be enabled for the child event source to work 2014-07-11 16:50:10 +02:00
David Herrmann b63c8d4f03 sd-event: always call epoll_ctl() on mask-updates if edge-triggered
A call to sd_event_source_set_io_events() skipps calling into the kernel
if the new event-mask matches the old one. This is safe for
level-triggered sources as the kernel moves them onto the ready-list
automatically if events change. However, edge-triggered sources might not
be on the ready-list even though events are present.

A call to sd_event_source_set_io_events() with EPOLLET set might thus be
used to just move the io-source onto the ready-list so the next poll
will return it again. This is very useful to avoid starvation in
priority-based event queues.

Imagine a read() loop on an edge-triggered fd. If we cannot read data fast
enough to drain the receive queue, we might decide to skip reading for now
and schedule it for later. On edge-triggered io-sources we have to make
sure it's put on the ready-list so the next dispatch-round will return it
again if it's still the highest priority task. We could make sd-event
handle edge-triggered sources directly and allow marking them ready again.
However, it's much simpler to let the kernel do that for now via
EPOLL_CTL_MOD.
2014-07-11 16:43:53 +02:00
Lennart Poettering 6017365a1d endian: explicitly include endian.h wherever we want to use __BYTE_ORDER 2014-07-11 16:13:13 +02:00
Lennart Poettering cabb0bc6b1 nss-mymachines: add new NSS module for automatically resolving addresses of all local containers 2014-07-11 03:15:21 +02:00
Lennart Poettering 2de30868ed build-sys: export sd_path APIs 2014-07-11 03:13:24 +02:00
Lennart Poettering 3cb4674019 libsystemd: make use of our common sockaddr_union everywhere 2014-07-10 21:16:40 +02:00
Lennart Poettering 3b653205cf shared: split out in_addr related calls from socket-util.[ch] into its private in-addr-util.[ch]
These are enough calls for a new file, and they are sufficiently
different from the sockaddr-related calls, hence let's split this out.
2014-07-10 21:15:26 +02:00
Lennart Poettering e80af1bddd nss-myhostname: move local address listing logic into shared, so that we can make use of it from machined 2014-07-10 21:01:25 +02:00
Lennart Poettering 1389925348 event: pull in sd-event.h from event-util.h 2014-07-10 20:12:34 +02:00
Umut Tezduyar Lindskog 0c74488672 sd-path: add missing header 2014-07-03 16:41:52 -04:00
Lennart Poettering 613e3a26c1 shared: rename ARCH_TUPLE to LIB_ARCH_TUPLE
This is really just about library locations, hence clarify that we don't
assume this to be anything but that.
2014-07-03 15:40:14 +02:00
Lennart Poettering 620a687cd2 sd-login: use the same code for verfiying machine names everywhere 2014-07-03 01:19:26 +02:00
Lennart Poettering db9bb83fa5 bus: close a bus that failed to connect 2014-07-03 01:19:21 +02:00
Lennart Poettering 7f0d207d2c sd-bus: support connecting to remote hosts, directly into containers
systemctl -H root@foobar:waldi

will now show a list of services running on container "waldi" on host
"foobar", using "root" for authenticating at "foobar".

Since entereing a container requires priviliges, this will only work
correctly for root logins.
2014-07-03 01:17:26 +02:00
Lennart Poettering 7bb4d371af sd-bus: when an event loop terminates, explicitly close the bus
This makes sure we actually release the bus and all the messages it
references.
2014-07-02 17:36:47 +02:00
Lennart Poettering b5eca3a205 bus: drop bus/message GC logic
When a caller drops all references to a bus and its messages while the
messages where still queue, this causes the bus to reference the
messages, and the messages to reference the bus, without anybody else
keeping a reference, which is something we so far considered a leak, and
tried to fix with a GC logic that would recognize cases like this, and
drop the reference.

This GC logic has been broken sofar, and remained unfixed. This commit
removes it altogther, replacing it with nothing. The rationale is that
simply because all refs to the bus have been dropped its queued messages
should *still* be written to the bus, even if the caller doesn't retain
any reference to either bus nor message. This means it was actually
wrong to attempt to clean up the bus in this case.

The proper way how applications should handle this is by explicitly
invoking sd_bus_close(), when they want busses to go away. This is
probably want they want to do anyway to avoid getting spurious
callbacks after they stopped using a bus.
2014-07-02 17:29:09 +02:00
Lennart Poettering 9a00f57a5b path: add new "systemd-path" utility for querying paths described in file-hierarchy(7)
This new tool is based on "sd-path", a new (so far unexported) API for
libsystemd, that can hopefully grow into a workable API covering /opt
and more one day.
2014-07-02 12:23:36 +02:00
Tom Gundersen 9e358851b4 networkd: netdev - add dummy support 2014-07-01 22:10:07 +02:00
Lennart Poettering 5d3de3fe9c socket-util: introduce in_addr_union similar to sockaddr_union and make use of it everywhere 2014-06-18 18:28:29 +02:00
Susant Sahani 6ef8147700 sd-rtnl: add support for vxlan rtnl attributes
This patch adds vxlan rtnl attributes to sd-rtnl
2014-06-16 20:38:22 +02:00
Lennart Poettering 42a04ee69c build-sys: update library versions 2014-06-11 15:30:28 +02:00
Lennart Poettering 2a0958d2d0 sd-bus: don't allow creating message objects that are not attached to a bus
It seems unnecessary to support this, and we rather should avoid
allowing this at all, so that people don't program against this
sloppily and we end up remarshalling all the time...
2014-06-06 18:30:01 +02:00
Lennart Poettering be8f4e9e8e sd-daemon: introduce sd_pid_notify() and sd_pid_notifyf()
sd_pid_notify() operates like sd_notify(), however operates on a
different PID (for example the parent PID of a process).

Make use of this in systemd-notify, so that message are sent from the
PID specified with --pid= rather than the usually shortlived PID of
systemd-notify itself.

This should increase the likelyhood that PID 1 can identify the cgroup
that the notification message was sent from properly.
2014-06-05 17:05:18 +02:00
Lennart Poettering b27adf354a bus: make use of sd_bus_try_close() in exit-on-idle services 2014-06-05 13:50:35 +02:00
Lennart Poettering eec6022cf0 sd-event: restore correct timeout behaviour 2014-06-05 13:50:35 +02:00
Lennart Poettering a4152e3fe2 kdbus: when uploading bus name policy, resolve users/groups out-of-process
It's not safe invoking NSS from PID 1, hence fork off worker processes
that upload the policy into the kernel for busnames.
2014-06-05 13:09:46 +02:00
Susant Sahani a613382bbf networkd: introduce vti tunnel
This patch enables vti tunnel support.

example conf:

file : vti.netdev
[NetDev]
Name=vti-tun
Kind=vti
MTUBytes=1480

[Tunnel]
Local=X.X.X.X
Remote=X.X.X.X

file: vti.network
[Match]
Name=em1

[Network]
Tunnel=vti-tun

TODO:

Add more attributes for vti tunnel
IFLA_VTI_IKEY
IFLA_VTI_OKEY
2014-06-02 16:20:44 +02:00
Susant Sahani 8bb088c5d4 networkd: introduce gre tunnel
This patch enables gre tunnel support.

example conf:

file : gre.netdev
[NetDev]
Name=gre-tun
Kind=gre
MTUBytes=1480

[Tunnel]
Local=X.X.X.X
Remote=X.X.X.X

file: gre.network
[Match]
Name=em1

[Network]
Tunnel=gre-tun

TODO:

Add more attributes for gre tunnel
IFLA_GRE_IFLAGS
IFLA_GRE_IFLAGS
IFLA_GRE_IKEY
IFLA_GRE_OKEY
2014-06-02 16:13:00 +02:00
Kay Sievers 82d115d9ab timedated: refuse manual system time updates when automatic timesync is enabled 2014-05-24 10:45:44 +08:00
Lennart Poettering 9a05490933 cgroups: simplify CPUQuota= logic
Only accept cpu quota values in percentages, get rid of period
definition.

It's not clear whether the CFS period controllable per-cgroup even has a
future in the kernel, hence let's simplify all this, hardcode the period
to 100ms and only accept percentage based quota values.
2014-05-22 11:53:12 +09:00
Lennart Poettering a077b666cb sd-login: add C API to query primary session of a user 2014-05-19 09:33:20 +09:00
Lennart Poettering 878cd7e95c machined: add logic to query IP addresses of containers 2014-05-18 20:52:49 +09:00
Zbigniew Jędrzejewski-Szmek 2915234da0 bus: fix unitialized variable access in error path 2014-05-16 18:03:00 -04:00
Lennart Poettering 7e28adeb63 sd-bus: make sure we properly handle NULL callback functions 2014-05-15 18:09:20 +02:00
Lennart Poettering b98490f7dc sd-bus: fix an assert when running in kdbus mode 2014-05-15 17:42:39 +02:00
Lennart Poettering f2e2415d69 resolve: fix copy/paste error 2014-05-15 17:31:14 +02:00
Lennart Poettering 9e7e9a6524 sd-bus: don't hit assert when installing match 2014-05-15 17:26:02 +02:00
Lennart Poettering 1b64f83829 sd-bus: always keep slot reference while dispatching callback
Also, make sure we automatically destroy reply callbacks that are
floating.
2014-05-15 17:13:05 +02:00
Lennart Poettering 4a134c4903 sd-resolve: add "floating" resolve queries
Same story as for sd-bus and sd-event: allow passing NULL to store query
in in which case the query is freed automatically.
2014-05-15 17:13:05 +02:00
Lennart Poettering a71fe8b8ae sd-event: introduce concept of "floating" event sources
These are the counterpart of "floating" bus slots, i.e. event sources
that are bound to the lifetime of the event object itself, and thus
don't require an explicit reference to be kept.
2014-05-15 17:13:04 +02:00
Zbigniew Jędrzejewski-Szmek de0671ee7f Remove unnecessary casts in printfs
No functional change expected :)
2014-05-15 15:29:58 +02:00
Lennart Poettering 19befb2d5f sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached to a bus connection
This makes callback behaviour more like sd-event or sd-resolve, and
creates proper object for unregistering callbacks.

Taking the refernce to the slot is optional. If not taken life time of
the slot will be bound to the underlying bus object (or in the case of
an async call until the reply has been recieved).
2014-05-15 01:15:30 +02:00
Lennart Poettering 04552566fa bus: add userdata API for bus name tracker objects 2014-05-14 22:58:43 +02:00
Susant Sahani 7951dea209 networkd: introduce ipip tunnel
This patch enables basic ipip tunnel support.
It works with kernel module ipip

example conf:

file: ipip.netdev

[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480

[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64

file: ipip.network

[Match]
Name=em1

[Network]
Tunnel=ipip-tun

[tomegun:
         - drop unused variable
         - take ref when enslaving]
2014-05-12 17:37:12 +02:00
Tom Gundersen 8fe65c03fc rtnl: message - fix check for broadcast messages 2014-05-10 20:56:37 +02:00
Tom Gundersen 66269b05cf rtnl: message - read group membership of incoming messages 2014-05-10 20:56:37 +02:00
Tom Gundersen 26349add97 rtnl: message - verify that we read the pending message size from the kernel
Reuse the auth-checking for both the peek and the real read.
2014-05-10 20:56:37 +02:00
Tom Gundersen 127dc4ea94 rtnl: message - move code around
No functional change.
2014-05-10 20:56:37 +02:00
Tom Gundersen 897e184c7d rtnl: change from bitmask to enum for rtnl groups
The bitmask is deprecated in the kernel, so move to the new interface. At the moment
this does not make a difference for us, but it avoids having to change the API in the future.
2014-05-10 20:56:37 +02:00
Tom Gundersen f4e884dd1c sd-rtnl: message - add support for getting prefixlen from address messages 2014-05-10 20:56:37 +02:00