1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00
Commit Graph

10839 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
0e72da6fe8 journal-remote: downgrade routine messages to debug
https://bugs.freedesktop.org/show_bug.cgi?id=89486
2015-03-13 00:26:02 -04:00
Zbigniew Jędrzejewski-Szmek
c066b4746b sd-pppoe: workaround for incomplete include in old kernels 2015-03-12 20:50:08 -04:00
Richard Maw
d422e52a35 networkd: Begin with serial number 1 for netlink requests
"Notifications are of informal nature and no reply is expected, therefore the
sequence number is typically set to 0."[1]

If networkd is started soon after recent netlink activity, then there
will be messages with sequence number 0 in the buffer.

The first thing networkd does is to request a dump of all the links. If
it uses sequence number 0 for this, then it may confuse the dump request's
response with that of a notification.

This will result in it failing to properly enumerate all the links,
but more importantly, when it comes to enumerate all the addresses, it
will still have the link dump in progress, so the address enumeration
will fail with -EBUSY.

[1]: http://www.infradead.org/~tgr/libnl/doc/core.html#core_msg_types

[tomegun: sequence -> serial]
2015-03-12 19:34:35 +01:00
Tom Gundersen
103635db51 core: add missing words to my fix of explanation of associativity 2015-03-12 12:23:59 +01:00
Tom Gundersen
6969c349df udevd: improve handling of failed worker
The information in the db is stale, so it does not make sense to
expose it any longer. Also, don't drop the kernel event, but simply
pass it on to userspace without ammending it.
2015-03-12 12:03:50 +01:00
Tom Gundersen
090b6bc520 udevd: don't free event when killing the worker, wait until it has been reaped
This will allow us to clean up the device when we are notified about the worker being killed.
2015-03-12 12:03:50 +01:00
Tom Gundersen
8f0f13f045 libudev: introduce clone_with_db()
This allows us to move the db reading from udevd to libudev.
2015-03-12 12:03:50 +01:00
Tom Gundersen
a4445e88ce libudev: monitor - fix error path in send_device
Return -errno rather than -1 in case sendmsg() fails.
2015-03-12 12:03:50 +01:00
Tom Gundersen
3c0bab4aaf udevd: event - make db loading lazy in REMOVE event handling
We were explicitly eagerly loading the db, then deletenig the backing file and then processing the
rules/symlinks. Instead we delete the backnig db file as the last step and let the db loading be
lazy as everywhere else.

This may save us a bit of work in casese where the db is not needed, but more importantly it hides
some implementation details of libudev-device form udevd.
2015-03-12 12:03:50 +01:00
Tom Gundersen
1cd0a77022 libudev: introduce udev_device_properties_copy()
To copy properties from one device to another. Drop the equivalent functionality from udevd.
2015-03-12 11:59:04 +01:00
Kay Sievers
4db7e6d781 boot: efi - add config option to disable the command line editor 2015-03-11 23:33:53 +01:00
Umut Tezduyar Lindskog
510c4a0f1e cgtop: fix assert when not on tty
systemd-cgtop --dept=1 -b -n 10 -d 0.1 | cat

Assertion 'new_length >= 3' failed at src/shared/util.c:3 \
595, function ellipsize_mem(). Aborting.
Aborted (core dumped)

(David: add comment)
2015-03-11 16:59:53 +01:00
David Herrmann
f5b51ea7fc core: fix cgroups-agent match for kdbus
On kdbus, we get cgroups-agent messages via the system bus, not the
private systemd socket. Therefore, we must install the match properly or
we will never receive cgroup notifications.
2015-03-11 16:36:41 +01:00
David Herrmann
39881ed299 core: rewind message before forwarding it
Forwarding messages that are not rewinded will drop data. Fix this for
cgroups-agent messages that we might remarshal before forwarding to the
system bus.
2015-03-11 16:36:41 +01:00
David Herrmann
908b8a42e6 bus: remarshal kdbus messages received from the kernel
If we receive an sd_bus_message from the kernel, m->kdbus will contain
additional items that cannot be used when sending a message. Therefore,
always remarshal the message if it is used again.
2015-03-11 16:36:41 +01:00
David Herrmann
8b9972db83 bus: drop redundant assignment
This assignment is already done in the parent context, no need to do it
again.
2015-03-11 16:36:41 +01:00
Zbigniew Jędrzejewski-Szmek
fc25ad25e0 socket-util: refactor error handling in sockaddr_pretty 2015-03-11 10:08:12 -04:00
Tom Gundersen
48b4eab497 core: fix explanation of associativity 2015-03-11 14:55:18 +01:00
David Herrmann
ec2c7b5659 bus-proxy: complain only once about queue overflows
If the local peer does not dispatch its incoming queue, the bus-proxy will
slowly fill its outgoing queue. Once its full, it will continously
complain that it cannot forward its messages.

As it turns out, pulseaudio does have an idle background dbus connection
that is not integrated into any mainloop (and given that gdbus and
libdbus1 both support background shared connections, PA is probably not
the only example), therefore, the bus-proxy will loudly complain if it
cannot forward NameOwnerChanged events once the queue is full.

This commit makes the proxy track queue-state and complain only once the
queue runs full, not if it is already full.

A PA bug-report (and patch) has been filed, and other applications should
be fixed similarly. Hence, lets keep the error message, instead of
dropping it. It's unused resources we really want to get rid of, so
silencing the message does not really help (which is actually what
dbus-daemon does).
2015-03-11 13:57:38 +01:00
David Herrmann
b2068772f5 terminal/sysview: introduce SETTLE events
This introduces a new SYSVIEW_EVENT_SETTLE notification that is sent after
initial scanning via sysview is done. This is very handy to let the
application raise warnings in case requested resources are not found
during startup.

The SETTLE event is sent after systemd-logind and udev enumerations are
done. This event does in no way guarantee that a given resource is
available. All it does is notify the application that scanning is done!
You must not react to SETTLE if you don't have external synchronization
with the resource you're waiting for.

The main use-case for SETTLE is to run applications _inside_ of logind
sessions and startup sysview. You really want to make sure that the own
session you're running in was found during enumeration. If not, something
is seriously wrong.
2015-03-11 12:32:48 +01:00
David Herrmann
84c3561c58 console: fix error-code inversion
The error-code propagated via sysview is always negative. Avoid
multiplying by -1 before returning it. Otherwise, we will return >0
instead of <0, which will not be detected as error by sysview-core.
2015-03-11 12:32:48 +01:00
Kay Sievers
f4cf2e5b2f udev: add SYSCTL{} support 2015-03-11 11:15:53 +01:00
Kay Sievers
88a60da054 sysctl: move property handling to shared/ 2015-03-11 10:37:45 +01:00
Lennart Poettering
c6ac7e4b98 machine-id-setup: simplifications 2015-03-10 19:09:38 +01:00
Lennart Poettering
d9dde2bb03 machine-id-commit: simplifications 2015-03-10 18:56:56 +01:00
Alban Crequy
f85ef957e6 util: add rename_noreplace
renameat2() exists since Linux 3.15 but btrfs support for the flag
RENAME_NOREPLACE was added later.

This patch implements a fallback when renameat2() returns EINVAL.
EINVAL is the error returned when the filesystem does not support one of
the flags.
2015-03-10 18:23:46 +01:00
Harald Hoyer
27cc6f166b path-util: fix path_is_mount_point() for symlinks
path_is_mount_point() compares the mount_id of a directory and the
mount_id of the parent directory. When following symlinks, the function
to get the parent directory does not take the symlink into account.

/bin -> /usr/bin with /usr being a mountpoint:
mount_id of /bin with AT_SYMLINK_FOLLOW != mount_id of /
2015-03-10 17:46:20 +01:00
Lukasz Skalski
52fa7a3af1 bus-proxy: add support for "GetConnectionCredentials" method
GetConnectionCredentials method was added to dbus-1 specification
more than one year ago. This method should return "[...] as many
credentials as possible for the process connected to the server",
but at this moment only "UnixUserID", "LinuxSecurityLabel" and
"ProcessID" are defined by the specification. We should add support
for next credentials after extending dbus-1 spec.
2015-03-10 16:12:14 +01:00
daurnimator
657cf7f4f8 tmpfiles: port to unquote_many_words() 2015-03-10 16:08:20 +01:00
Lennart Poettering
cb81cd8073 shared: the btrfs quota field is called "referenced" not "referred" 2015-03-10 15:55:58 +01:00
Lennart Poettering
6e9efa5920 man: document "machinectl export-tar" and "export-raw" 2015-03-10 15:48:14 +01:00
Shawn Landden
3b1c524154 add REMOTE_ADDR and REMOTE_PORT for Accept=yes 2015-03-10 09:00:27 -04:00
Didier Roche
54bcf1557c fsckd: clean up log messages
Avoid double logs printing. Not that we don't return
manager_update_global_progress() to the handler callback as if the console or
plymouth isn't available momentarily, we still desire to handle future
fd progress events if those are available again (like cancellation, reports…)
2015-03-10 11:45:54 +01:00
Didier Roche
867ce6a516 fsckd: Reduce the SAK window when writing to console
We don't want to keep /dev/console open all the time, but only open it when
needed, to avoid interfering with SAK.
2015-03-10 11:43:09 +01:00
Thomas Hindoe Paaboel Andersen
0c900704e7 Add type specifier for int 2015-03-10 05:37:01 +01:00
Thomas Hindoe Paaboel Andersen
6c767d1e1a logs-show: fix check of loop_read_exact
just a typo fix
2015-03-10 05:37:01 +01:00
Zbigniew Jędrzejewski-Szmek
a6dcc7e592 Introduce loop_read_exact helper
Usually when using loop_read(), we want to read the full buffer.
Add a helper that mirrors loop_write(), and returns 0 when full buffer
was read, and an error otherwise.

Use -ENODATA for the short read, to distinguish it from a read error.
2015-03-09 22:10:54 -04:00
Zbigniew Jędrzejewski-Szmek
ad7bcf526d efivars: itialize variable
Introduced a few commits ago.
2015-03-09 22:10:54 -04:00
Zbigniew Jędrzejewski-Szmek
d92f98b4f6 bootchart: use _cleanup_ 2015-03-09 22:10:54 -04:00
Zbigniew Jędrzejewski-Szmek
6410074b4f Add missing includes
audit.h uses uint32_t and bool.
log.h uses abs.
2015-03-09 22:10:54 -04:00
Zbigniew Jędrzejewski-Szmek
faf9da01ad journalctl: unlink without checking with access first
It is more elegant to do this in one step.

Coverity complains about the TOCTOU difference, but it is not an
actual problem (CID #1237777).
2015-03-09 22:06:46 -04:00
Zbigniew Jędrzejewski-Szmek
977eaa1eae journal: fix return code
Introduced in fa6ac76083.

Might be related to CID #1261724, but I don't know if coverity can
recurse this deep.
2015-03-09 22:02:25 -04:00
Zbigniew Jędrzejewski-Szmek
d587eca510 journal-file: update format string to remove cast 2015-03-09 22:02:25 -04:00
Zbigniew Jędrzejewski-Szmek
288359dba1 journal: align comments to make them more legible 2015-03-09 22:02:25 -04:00
Tom Gundersen
b94da8cf72 libudev: add missing hunks
This should have been committed with
  udev_device_add_property - implicitly mark properties for saving to db
2015-03-09 23:36:27 +01:00
Tom Gundersen
570b83cc62 libudev: udev_device_read_db - drop unused argument 2015-03-09 23:27:12 +01:00
Tom Gundersen
df546eb56a libudev: udev_device_add_property - implicitly mark properties for saving to db
Properties should only be saved to the db when added to the udev_device by udevd, and only if
the property does not start with a '.'. Make this implicit rather than expose the marking of
properties.
2015-03-09 22:50:44 +01:00
Tom Gundersen
3738cc858d udev/libudev: event - move {OLD_,}INTERFACE handling from udevd to libudev
This should be internal to the library as it is only about reflecting the sysfs state in the udev_device.
2015-03-09 22:50:44 +01:00
Tom Gundersen
bd57b6de74 libudev: private - make property_from_string_parse* static 2015-03-09 22:50:44 +01:00
Tom Gundersen
dfc4b6acf0 udev: simplify event_queue_update() and add debug logging
This essentially replaces
  open("/run/udev/queue", O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444)
with
  open("/run/udev/queue", O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0644),
which is ok for our purposes.
2015-03-09 22:38:51 +01:00