1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 02:57:16 +03:00
Commit Graph

17165 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
ee26bcc038 core/dbus: simplify handling of CPUQuotaPerSecUSec
No functional change intended.
2014-09-29 11:08:12 -04:00
Zbigniew Jędrzejewski-Szmek
4afbccded2 core/swap: advertise Discard over dbus 2014-09-29 11:08:12 -04:00
Zbigniew Jędrzejewski-Szmek
cdc8982030 core/swap: follow the configured unit by default
Phenomenon: parameters configured in /etc/fstab for swap units are
ignored. E.g. pri= settings have no effect when systemd starts swap
units. What is even more confusing, .swap units for the name used in
/etc/fstab initially show proper values for Priority=, but after
starting them, they are re-initalized from /proc/swaps and show the -1
value from /proc/swaps.

Change swap units to follow the original configured unit. This way
proper settings are used when starting the swap.
2014-09-29 11:08:12 -04:00
Zbigniew Jędrzejewski-Szmek
4f52d3fe2d fstab-generator: properly deal with discard as non-last option
Previous code would only return correct results when discard
was the last option.

While at it, avoid incorrect behaviour for (invalid) 'pri' option
not followed by '=...', and also do not return -1 as the error code.
2014-09-29 11:08:12 -04:00
Jan Synacek
86b23b07c9 swap: introduce Discard property
Process possible "discard" values from /etc/fstab.
2014-09-29 11:08:12 -04:00
Zbigniew Jędrzejewski-Szmek
70f1b2ddc6 journal-remote: fix handling of non-blocking sources
In the conversion to sd-event loop, handling of normal files got
broken. We do not want to perform non-blocking reads on them, but
simply do read() in a loop. Install a statically-enabled "source"
to do that.
2014-09-29 11:08:04 -04:00
Zbigniew Jędrzejewski-Szmek
4bed248505 journalctl: do not output --reboot-- markers when running non-interactively
They are not legal in the export format.
2014-09-29 10:57:27 -04:00
David Herrmann
1679ddc460 bus: use 2M as maximum message size in benchmark
The kdbus limit is 2M and we removed the bus-owner override. Therefore,
use at most 2M as message size.
2014-09-29 15:44:44 +02:00
David Herrmann
bfd6d8a322 terminal: add helper to retrieve the seat of a session
Allow sysview users to retrieve the seat that a session is assigned to.
2014-09-29 15:37:32 +02:00
David Herrmann
8bf4a42a2e bus: sync kdbus.h (ABI break!) 2014-09-29 15:37:31 +02:00
David Herrmann
1c7830cc10 terminal: add sysview_seat_switch_to()
Add helper to perform session switches on a specific seat whenever we
retrieve a VT-switch keyboard event.
2014-09-29 15:37:31 +02:00
Daniel Mack
f0c5e28e58 sd-bus: clean up string length calculation
Move the +1 calculus onto the definition of the variable, just to make
the code a little easier to read. No functional change.
2014-09-28 21:22:51 +02:00
Philippe De Swert
c119700c06 bootchart: Do not try to access data for non-existing CPU's
Cpu's are assigned normally, so starting at 0, so the MAX_CPU index will
always be one smaller than the actual number.

Found with Coverity.
2014-09-28 19:35:11 +02:00
Thomas Hindoe Paaboel Andersen
5e90b6a978 test-bus-policy: silence coverity
Check if strjoin worked and also use _cleanup_free_ since we are
here.

Found with Coverity. Fixes CID#1241962
2014-09-28 18:48:33 +02:00
Thomas Hindoe Paaboel Andersen
e931d3f424 bootchart: check return of strftime
Found by coverity. Fixes: CID#996314 and #996312
2014-09-28 14:46:38 +02:00
Thomas Hindoe Paaboel Andersen
9bcf7507fa bootchart: parse userinput with safe_atoi
Found by coverity. Fixes: CID#996409
2014-09-28 14:46:38 +02:00
Koen Kooi
492d7a3038 logind: add support for TPS65217 Power Button
This PMIC is found on TI AM335x based boards like the beaglebone and
beaglebone black.

root@beaglebone-white:~# udevadm info -a /dev/input/event0

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device
'/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024/input/input0/event0':
    KERNEL=="event0"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device
'/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024/input/input0':
    KERNELS=="input0"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="tps65217_pwr_but"
    ATTRS{phys}==""
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024':
    KERNELS=="0-0024"
    SUBSYSTEMS=="i2c"
    DRIVERS=="tps65217"
    ATTRS{name}=="tps65217"

  looking at parent device '/devices/ocp.3/44e0b000.i2c/i2c-0':
    KERNELS=="i2c-0"
    SUBSYSTEMS=="i2c"
    DRIVERS==""
    ATTRS{name}=="OMAP I2C adapter"

  looking at parent device '/devices/ocp.3/44e0b000.i2c':
    KERNELS=="44e0b000.i2c"
    SUBSYSTEMS=="platform"
    DRIVERS=="omap_i2c"

  looking at parent device '/devices/ocp.3':
    KERNELS=="ocp.3"
    SUBSYSTEMS=="platform"
    DRIVERS==""
2014-09-27 19:29:45 -04:00
Piotr Drąg
d6740361f2 catalog: add Polish translation 2014-09-27 19:14:18 -04:00
Eric Cook
c2026f28bd shell-completion(zsh): journalctl's -b changes
removed pointless index sort of bootids.
use `compadd -a' to add each array, instead of expanding possibly hundreds of words needlessly.
optional completion of -b
2014-09-27 19:57:04 +02:00
Thomas Hindoe Paaboel Andersen
b748c7596f shutdownd: clean up initialization of struct
No functional change. We just don't assign the value twice.

Found by coverity. Fixes: CID#1237616 and #1237617
2014-09-27 00:30:00 +02:00
Daniel Mack
45f1b67a70 test-bus-policy: load policy files from TEST_DIR
'make distcheck' calls test-bus-policy outside of the source tree, so it
must consider the TEST_DIR variable to access its files.
2014-09-26 19:52:08 +02:00
Richard Weinberger
9ed2a35e93 systemd-tmpfiles: Fix IGNORE_DIRECTORY_PATH age handling
If one has a config like:
d /tmp 1777 root root -
X /tmp/important_mount

All files below /tmp/important_mount will be deleted as the
/tmp/important_mount item will spuriously inherit a max age of 0
from /tmp.
/tmp has a max age of 0 but age_set is (of course) false.

This affects also the PrivateTmp feature of systemd.
All tmp files of such services will be deleted unconditionally
and can cause service failures and data loss.

Fix this by checking ->age_set in the IGNORE_DIRECTORY_PATH logic.
2014-09-26 17:38:40 +02:00
Emil Renner Berthing
37161c5148 make utmp/wtmp support configurable
This adds --disable-utmp option to configure. If it is used, all
utmp-related functionality, including querying runlevel support,
is removed.
2014-09-26 07:48:35 -04:00
Zbigniew Jędrzejewski-Szmek
440c61c500 Revert "only build and install systemd-bus-proxyd if --enable-kdbus"
This reverts commit ef99aec4d2.

systemd-stdio-bridge is used on non-kdbus systems.
2014-09-25 19:02:42 -04:00
Gustavo Sverzut Barbieri
2f88c8583a do not install factory/etc/pam.d if --disable-pam 2014-09-25 18:19:04 -04:00
Zbigniew Jędrzejewski-Szmek
0b094b10b4 build-sys: do not distribute make-man-rules.py
It was added to EXTRA_DIST in 3c3e5f4276,
but this script only makes sense for developers.
2014-09-25 18:19:04 -04:00
Gustavo Sverzut Barbieri
ef99aec4d2 only build and install systemd-bus-proxyd if --enable-kdbus 2014-09-25 18:19:04 -04:00
Zbigniew Jędrzejewski-Szmek
8474b70c3a man: use <constant> markup for errno value
We were inconsistent, but marking them up as constants makes more
sense then as variables.
2014-09-25 18:19:03 -04:00
Zbigniew Jędrzejewski-Szmek
4dfefc1914 man: document sd_event_add_{defer,post,exit} 2014-09-25 18:19:03 -04:00
Zbigniew Jędrzejewski-Szmek
edf2573743 man: add sd_event_add_child(3) 2014-09-25 18:19:03 -04:00
Zbigniew Jędrzejewski-Szmek
3144ebcad3 man: add sd_event_add_signal(3) 2014-09-25 18:19:03 -04:00
Zbigniew Jędrzejewski-Szmek
3a17521f59 build-sys: add sd_session_get_desktop to Makefile-man.am
Fixup for c72d5456e2.
2014-09-25 18:19:03 -04:00
Zbigniew Jędrzejewski-Szmek
bfe6c07e1b man/sd_event_new: tweaks 2014-09-25 18:19:03 -04:00
Gustavo Sverzut Barbieri
10893a5cfa journal: build fix when LZ4 is enabled but XZ is not 2014-09-25 18:19:03 -04:00
Zbigniew Jędrzejewski-Szmek
dd87b1840c journal-remote: fix counting of events written
After recent changes the number was always reported as 0, because
the accounting was done server_destroy(), called after the message was
already printed. But even before this change, the counts were wrong
because seqnum start at 0 only for newly created journal files, so when
appending to existing files, the calculated count was wrong anyway.

Also do some variable renaming for consistency and disable some low-level
debug messages.
2014-09-25 18:19:03 -04:00
Jonathan Liu
22259a00fd journal-remote: initialize writer hashmap before use
https://bugs.freedesktop.org/show_bug.cgi?id=83682

[zj: move the initalization even earlier, before any sockets are
     looked at.]
2014-09-25 18:19:03 -04:00
Tom Gundersen
79d80fc146 nspawn: check some more return values
Most of these failures would anyway get caught later on, but now the error messages are a bit more
specific.
2014-09-25 19:10:11 +02:00
Tom Gundersen
3d1b90bd7f delta: warn if diff failed
Found by Coverity. Fixes CID #1237541.
2014-09-25 18:16:04 +02:00
Daniel Buch
d6bc8348d5 readahead: wipe out readahead 2014-09-25 16:39:18 +02:00
Tom Gundersen
4a3bb59960 bus-proxy: drop one wrong assert() 2014-09-25 16:21:36 +02:00
Tom Gundersen
4a690c4726 shared: path-util - try to make PATH_FORECH_PREFIX look less wrong
We replace the idiom "X && !(*foo = 0)" with "X && ((*foo = 0), true)".

This is not a functional change, but should hopefully make it less
likely that people and static analyzers believe there is a typo here
(i.e., to make it clear that the intention was not "X && *foo != 0").

Thanks to David Herrmann for the suggestion.
2014-09-25 16:17:58 +02:00
Tom Gundersen
94a2c2f64a bus-proxyd: add some asserts
Both as documentation, and to make Coverity happy.

Fixes CID #1241495 and #1241496.
2014-09-25 15:59:24 +02:00
Michal Sekletar
a34286684e localectl: print warning when there are options given on kernel cmdline 2014-09-25 09:19:56 +02:00
Michal Sekletar
a5f6c30da3 fileio: make parse_env_file() return number of parsed items
This commit introduces possibility to call parse_env_file_internal() and hand
over extra argument where we will accumulate how many items were successfully
parsed and pushed by callback. We make use of this in parse_env_file() and
return number of parsed items on success instead of always returning zero.

As a side-effect this commit should fix bug that locale settings in
/etc/locale.conf are not overriden by options passed via kernel command line.
2014-09-25 09:19:56 +02:00
Daniel Mack
078ef7b85a bus-policy: split API for bus-proxyd
Instead of operating on an sd_bus_message object, expose an API that has 4
functions:

  policy_check_own()
  policy_check_hello()
  policy_check_recv()
  policy_check_send()

This also allows dropping extra code to parse message contents - the bus
proxy already has dedicated code paths for that, and we can hook into
those later.

Tests amended accordingly.
2014-09-24 17:07:14 +02:00
Thomas Hindoe Paaboel Andersen
04c553e322 bus: remove unused check
strerror_r does not return null here and even if it did we would have
problems already at the preceding strlen call.

Found by coverity. Fixes: CID#1237770
2014-09-23 21:39:36 +02:00
David Herrmann
158c1e3e0c terminal: provide display dimensions to API users
Allow users to query the display dimensions of a grdev_display. This is
required to properly resize the objects to be rendered.
2014-09-23 20:05:45 +02:00
David Herrmann
a908d21355 terminal: verify kernel-returned DRM events are not truncated
Make sure the kernel always returns events properly. This is guaranteed
right now, otherwise, we do something really wrong. But lets be sure and
verify the received values properly. This also silences some coverity
warnings.
2014-09-23 20:05:45 +02:00
David Herrmann
c5e6bfc6bc terminal: verify grdev tiles are correctly linked
We used to set "pipe->tile = tile" inside of the leaf allocation. We no
longer do that. Verify that "out" is non-NULL, otherwise we'd leak memory.

This is currently always given, but make sure to add an assert(), so
coverity does not complain.
2014-09-23 20:05:45 +02:00
David Herrmann
b4170aed36 terminal: fix tile-offset calculation
Binary operators with two pointers as arguments always operate on
object-size, not bytes. That is, "int *a, *b", (a - b) calculates the
number of integers between b and a, not the number of bytes.

Fix our cache-offset calculation to not use sizeof() with full-ptr
arithmetic.
2014-09-23 20:05:44 +02:00