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

15184 Commits

Author SHA1 Message Date
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
574634bcac core: close socket fds asynchronously
http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html
2014-05-15 15:30:00 +02:00
Zbigniew Jędrzejewski-Szmek
05cae7f343 systemctl: small cleanup 2014-05-15 15:30:00 +02:00
Zbigniew Jędrzejewski-Szmek
058fb31996 readahead: add test to show fs_on_ssd() result 2014-05-15 15:29:59 +02:00
Zbigniew Jędrzejewski-Szmek
5ea846cc51 networkd, build-sys: spelling fix 2014-05-15 15:29:59 +02:00
Zbigniew Jędrzejewski-Szmek
4e595329a9 Make sure that keys are properly removed from hashmap
This is a speculative fix for https://bugzilla.redhat.com/show_bug.cgi?id=1088865.
Even though I cannot find a code path that where this would be
an issue, for consistency, if we assume that cgroup_path might have
been set before we got to unit_deserialize, we should make sure that
the unit is removed from the hashmap before we free the key. This seems
to be the only place where the key could be prematurely freed, leading to
hashmap corruption.
2014-05-15 15:29:58 +02:00
Zbigniew Jędrzejewski-Szmek
de0671ee7f Remove unnecessary casts in printfs
No functional change expected :)
2014-05-15 15:29:58 +02:00
Zbigniew Jędrzejewski-Szmek
12ed81d9c8 Make systemctl --root look for files in the proper places
Running systemctl enable/disable/set-default/... with the --root
option under strace reveals that it accessed various files and
directories in the main fs, and not underneath the specified root.
This can lead to correct results only when the layout and
configuration in the container are identical, which often is not the
case. Fix this by adding the specified root to all file access
operations.

This patch does not handle some corner cases: symlinks which point
outside of the specified root might be interpreted differently than
they would be by the kernel if the specified root was the real root.
But systemctl does not create such symlinks by itself, and I think
this is enough of a corner case not to be worth the additional
complexity of reimplementing link chasing in systemd.

Also, simplify the code in a few places and remove an hypothetical
memory leak on error.
2014-05-15 15:29:58 +02:00
Zbigniew Jędrzejewski-Szmek
62b0023377 shared/install: do not prefix created symlink with root path
Before: /var/tmp/inst1//etc/systemd/system/default.target -> /var/tmp/inst1//usr/lib/systemd/system/graphical.target
After: /var/tmp/inst1/etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target
2014-05-15 15:29:57 +02:00
Eelco Dolstra
1e89266b76 Fix typos in systemctl manpage 2014-05-15 13:23:55 +02:00
Kay Sievers
1ea972174b udev: do not skip the execution of RUN when renaming a network device fails 2014-05-15 10:32:26 +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
9a78148e40 sd-event: reorder header slightly 2014-05-15 00:44:29 +02:00
Lennart Poettering
c582a3b3e8 hashmap: add hashmap_remove2() to remove item from hashtable and return both value and key 2014-05-15 00:43:44 +02:00
Lennart Poettering
4f4f70361a core: no need to pass bus object to selinux access check calls anymore 2014-05-14 22:58:43 +02:00
Lennart Poettering
04552566fa bus: add userdata API for bus name tracker objects 2014-05-14 22:58:43 +02:00
Tom Gundersen
e30bb6b53b core: sysvcompat - avoid repeated function call 2014-05-14 22:03:14 +02:00
Tom Gundersen
0404c609f3 core: sysvcompat - $network should be equivalent to network-online, rather than network target
Most likely the  facility needed is actual connectivity, rather than whether or not the
network managment daemon is running.

We also need to explicitly pull in the network-online.target, as it is not active by
default.

This means {systemd-networkd,NetworkManager}-wait-online.service, can be enabled by default
as part of network-online.target, and only delay boot when some service actively pulls it in.

See: <https://bugzilla.gnome.org/show_bug.cgi?id=728965>

Cc: Pavel Šimerda <psimerda@redhat.com>
Cc: Michal Sekletar <msekleta@redhat.com>
2014-05-14 12:45:12 +02:00
David Herrmann
e0dd92729e shared: add ring buffer
New "struct ring" object that implements a basic ring buffer for arbitrary
byte-streams. A new basic runtime test is also added.

This will be needed for our pty helpers for systemd-console and friends.
2014-05-13 22:08:13 +02:00
David Herrmann
625e870b4f shared: add ALIGN_POWER2 macro
Sounds easy, turns out to be horrible to implement: ALIGN_POWER2 returns
the next higher power of 2. clz(0) is undefined, same is true for
left-shift-overflows, yey, C rocks!
2014-05-13 22:05:32 +02:00
Lennart Poettering
ead349509e replace more dup() by F_DUPFD_CLOEXEC 2014-05-13 16:40:53 +02:00
Lennart Poettering
85c08dc013 pam_systemd: use F_DUPFD_CLOEXEC when dupping session fds
http://lists.freedesktop.org/archives/systemd-devel/2014-May/019034.html
2014-05-13 16:35:34 +02:00
Tom Gundersen
1514d70819 udev: rename netif - properly break lines in kmsg
Before:

30,997,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6systemd-udevd[439]: renamed network interface wlan0 to wlp3s0
30,998,1175077801,c;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6

After:

30,834,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6
30,835,4732949,-;systemd-udevd[439]: renamed network interface wlan0 to wlp3s0
30,988,1175077801,-;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6
2014-05-13 12:44:22 +02:00
Tom Gundersen
0968137439 timesyncd: start after networkd
This is needed for the network monitor to work (as it requires networkd to set up the correct directories first).
2014-05-13 12:44:22 +02:00
Susant Sahani
9ae7021104 networkd-ipip-tunnel: add support ttl
Add support for ipip tunnel ttl.
2014-05-12 18:15:31 +02:00
Susant Sahani
3eb94c9e9e networkd: Add todo patch kernel for tunnel module alias
Add to todo :

1. Patch kernel to support module alias for tunnel device
2. Remove libkmod dependency from networkd
2014-05-12 17:53:18 +02:00
Tom Gundersen
0b44d8c3d7 networkd: manager - don't leak kmod context
Also, keep the kmod_new internal to networkd-manager.c
2014-05-12 17:37:58 +02:00
Tom Gundersen
7c8ec321e7 networkd: unit - add cap to load modules
Remember to drop this when the kernel gains autoloading for all netdev kinds.
2014-05-12 17:37:52 +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
Michael Marineau
1727a59522 job: always add waiting jobs to run queue during coldplug
commit 20a83d7bf was not equivalent to the original bug fix proposed by
Michal Sekletar <msekleta@redhat.com>. The committed version only added
the job to the run queue if the job had a timeout, which most jobs do
not have. Just re-ordering the code gets us the intended functionality
2014-05-12 09:32:06 +02:00
Tom Gundersen
fbbeb65a93 networkd: get preexiting addresses when a link is added 2014-05-11 14:26:10 +02:00
Tom Gundersen
2e9f08eaf1 networkd: listen for address changes
This is proof-of-concept only, as we only log the changes but don't do anything
with it.
2014-05-10 20:56:37 +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
389cc5f743 networkd: link - redo flag change logging
Make the logging less verbose by only printing all the changed flags on one line,
at the same time make it more complete by supporting all flags currently supported
by the kernel.

We still fall back to printing the raw flags in case we get something we do not recognize
This may be useful when running on new kernels.
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
Tom Gundersen
31d0ac36c6 networkd: network - fix leak 2014-05-10 20:56:37 +02:00
Tom Gundersen
86e6e5d1b4 networkd: manager - initialize variables 2014-05-10 20:56:37 +02:00
Tom Gundersen
5e273efec5 networkd: netdev - rephrase logging message a bit
Make it fit with what is logged from the link.
2014-05-10 20:56:37 +02:00
Tom Gundersen
4d473d5dde networkd: manager - refactor link tracking a bit 2014-05-10 20:56:37 +02:00
Zbigniew Jędrzejewski-Szmek
5bb75bc745 systemctl: return an error code is status fails
This got lost in the refactoring in f74294c1da.

Also make sure that the return code corresponds to the *first* failure,
not the last.

https://lists.fedoraproject.org/pipermail/devel/2014-May/199080.html
2014-05-10 03:44:41 +02:00
Tom Gundersen
b90b025af1 networkd: link - don't log errors when missing routes/addresses are dropped
We were ignoring the wrong errno.
2014-05-09 14:41:27 +02:00
Tom Gundersen
7619683b46 networkd: link - handle links coming back to life
When enslaving devices, we may receieve DELLINK/NEWLINK for the same ifindex,
let's not be confused by this.
2014-05-09 14:41:27 +02:00
Tom Gundersen
d9c67ea112 networkd: reorder bonding and bridging
A link should only ever be part of one, but if we accidentally do both, let's do it
in the right order so the failure is more obvious in the logs.
2014-05-09 14:41:27 +02:00
Tom Gundersen
699370c98d sd-dhcp-client: improve logging when stopping client
'Requested by user' was confusing, just drop it.
2014-05-09 14:41:27 +02:00
Tom Gundersen
f22364691b networkd: manager - drop links and netdevs when we receive DELLINK 2014-05-09 14:41:27 +02:00
Tom Gundersen
37ebeb77cf networkd: netdev - drop if creation fails
This ensures that all links waiting to be enslaved are notified that the netdev does not exist.
2014-05-09 14:41:27 +02:00