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

20862 Commits

Author SHA1 Message Date
Tom Gundersen
4f1b306169 hashmap: debug - lock access to the global hashmap list
This may be used from multi-threaded programs (say through nss-resolve),
so we must protect the global list.

This is still only relevant for debug builds, so we do not try to handle
cases where the locking fail, but simply assert.
2015-06-18 21:35:18 +02:00
David Herrmann
fd23f9c9a7 test: disable test-barrier by default
The test-barrier binary uses real-time alarms and timeouts to test for
races in the thread-barrier implementation. Hence, if your system is under
high load and your scheduler decides to not run test-barrier for
>BASE_TIME, then the tests are likely to fail.

Two options:
 1) Increase BASE_TIME. This will make the test take significantly longer
    for no real good. Furthermore, it is still not guaranteed that the
    task is scheduled.
 2) Don't rely on real-time timers, but use explicit synchronization. This
    would basically test one barrier implementation with another.. kinda
    ironic.. but maybe something worth looking into.
 3) Disable test-barrier by default.

This patch chooses option 3) and makes sure test-barrier only runs if you
pass any argument.

Side note:
        test-barrier is written in a way that if it fails under load, but
        does not on idle systems, then it is very _unlikely_ that the
        barrier implementation is the culprit. Hence, it makes little
        sense to run it under load, anyway. It will not improve the test
        coverage of barrier.c, but rather the coverage of the test itself.
2015-06-18 10:25:08 +02:00
Daniel Mack
575ee5e4f7 Merge pull request #281 from michaelolbrich/glibc-2.16-fix
exit-status: add missing include for SIG* defines
2015-06-18 10:18:28 +02:00
Michael Olbrich
c43516e075 exit-status: add missing include for SIG* defines
Otherwise building fails with glibc 2.16. It works with glibc >= 2.17
because it is implicitly included via macro.h -> sys/param.h -> signal.h
2015-06-18 09:04:43 +02:00
Kay Sievers
b34503a7fd Merge pull request #269 from teg/udev-docs-1
man: libudev - add description to udev_device_*
2015-06-18 00:45:51 +02:00
Daniel Mack
867a99b406 Merge pull request #272 from poettering/nspawn-flush-copy-fd
nspawn: when exiting, flush all remaining bytes from the pty to stdout
2015-06-18 00:34:22 +02:00
Lennart Poettering
561471314c build-sys: bump versions and sonames 2015-06-18 00:28:41 +02:00
Kay Sievers
bcf1097553 Merge pull request #276 from poettering/dbus-search-path
bus-proxy: add new dbus policy search paths from /usr
2015-06-18 00:26:46 +02:00
Kay Sievers
5f92d24fa8 NEWS: update 2015-06-18 00:25:43 +02:00
Lennart Poettering
422c759f3f Merge pull request #277 from poettering/journal-interleaving-monotonic
journal: make sure the clock increases strict monotonic
2015-06-18 00:22:22 +02:00
Lennart Poettering
470e72d408 NEWS: prepare for v221 2015-06-18 00:18:49 +02:00
Lennart Poettering
bd4c12ef02 hwdb: update databases from upstream 2015-06-17 23:54:35 +02:00
Lennart Poettering
7128df76f0 man: minor typo fix 2015-06-17 23:50:13 +02:00
Lennart Poettering
1047e12dc1 man: run make update-man-list 2015-06-17 23:50:02 +02:00
Tom Gundersen
7663da324a Merge pull request #270 from phomes/master
udevd: remove dead code
2015-06-17 23:27:39 +02:00
Lennart Poettering
44cf96e33e journal: make sure the clock increases strict monotonic
Let's work around crappy clocks in test-journal-interleaving.c too. This
does the same as 98d2a53417 but for
test-journal-interlaving.c rather than test-journal-stream.c.
2015-06-17 23:26:39 +02:00
Martin Pitt
921ee38ff6 Merge pull request #275 from poettering/acl-fixes
acl-util: various smaller fixes to parse_acl()
2015-06-17 23:10:19 +02:00
Lennart Poettering
de587378ea update TODO 2015-06-17 23:03:27 +02:00
Lennart Poettering
30654aa0d4 Merge pull request #271 from poettering/test-journal-stream-crappy-clock
journal: ensure test-journal-stream doesn't get confused by crappy cl…
2015-06-17 22:56:09 +02:00
Lennart Poettering
97af81cffa bus-proxy: add new dbus policy search paths from /usr
D-Bus upstream is working on extending the configuration/policy search
path, follow this.

See #274 for details.
2015-06-17 22:43:46 +02:00
Martin Pitt
2c8d248c33 Merge pull request #273 from teg/libudev-device-get-sysattrs
libudev: device - fix typo in udev_device_get_sysattr_list_entry()
2015-06-17 22:35:19 +02:00
Lennart Poettering
e738c945ec acl-util: various smaller fixes to parse_acl()
- Make string parameter const

- Don't log some OOM errors, but not others

- Don't eat up errors generated by acl_from_text()

- Make sure check for success of every single strv_push() call
2015-06-17 22:08:21 +02:00
Tom Gundersen
7bb092142e libudev: device - fix typo in udev_device_get_sysattr_list_entry()
We were adding the attributes to the wrong list.
2015-06-17 22:03:34 +02:00
Daniel Mack
d5df0d950f Merge pull request #248 from llua/zsh-completion
zsh-completion: _loginctl - general bug fixes
2015-06-17 21:37:46 +02:00
Lennart Poettering
503546da7c nspawn: when exiting, flush all remaining bytes from the pty to stdout
This is a simpler fix for #210, it simply uses copy_bytes() for the
copying.
2015-06-17 20:54:45 +02:00
Lennart Poettering
7391cb5d58 Merge pull request #44 from filbranden/unquote_first_word1
Replace FOREACH_WORD_QUOTED with a loop using unquote_first_word in config_parse_exec()
2015-06-17 20:41:30 +02:00
Lennart Poettering
98d2a53417 journal: ensure test-journal-stream doesn't get confused by crappy clocks
This ensures that we write strictly monotonic timestamps into the
journal files, to ensure that we can properly interleave everything
correctly.

See #175 for details.
2015-06-17 20:37:19 +02:00
Thomas Hindoe Paaboel Andersen
118786182b udved: remove dead code
Leftover from 6af5e6a4c9
2015-06-17 20:33:25 +02:00
Lennart Poettering
07d210255b logs-show: print a debug message when we skip entries without MESSAGE= fields 2015-06-17 20:28:29 +02:00
Filipe Brandenburger
c83f1f30b8 load-fragment: reset the list on an ExecStart= containing only whitespace
This is consistent with how an empty string works in an ExecStart=
statement.  We should not differentiate between an empty string and
whitespace only (since they look the same.)

Update the test case with whitespace only to reflect that the list is
reset.

Tested that `test-unit-file` passes and other test cases are not
affected.  Installed the patched systemd binaries on a machine, booted
it, looked for out of the usual behavior but did not find any.
2015-06-17 11:12:12 -07:00
Filipe Brandenburger
46a0d98ac0 load-fragment: use unquote_first_word in config_parse_exec
Convert config_parse_exec() from using FOREACH_WORD_QUOTED into a loop
of unquote_first_word.

Loop through the arguments only once (the FOREACH_WORD_QUOTED
implementation did it twice, once to count them and another time to
process and store them.)

Use newly introduced flag UNQUOTE_UNESCAPE_RELAX to preserve
unrecognized escape sequences such as regexps matches such as "\w",
"\d", etc. (Valid escape sequences such as "\s" or "\b" still need an
extra backslash if literals are desired for regexps.)

Differences in behavior:

- Handle ; (command separator) in special, so that only ; on its own is
  valid for that purpose, an quoted semicolon ";" or ';' will now behave
  as a literal semicolon.  This is probably what was initially intended.

- Handle \; (to introduce a literal semicolon) in special, so that only \;
  is turned into a semicolon but not \\; or "\\;" or "\;" which are kept
  as a literal \; in the output.  This is probably what was initially
  intended.

Known issues:

- Using an empty string (for example, ExecStartPre=<empty>) will empty
  the list and remove the existing commands, but using whitespace only
  (for example, ExecStartPre=<spaces>) will not.  This is a pre-existing
  issue and will be dealt with in a follow up commit.

Tested:

- Unit tests passing.  Also `make distcheck` still works as expected.

- Installed it on a local machine and booted with it, checked console
  output, systemctl and journalctl output, did not notice any issues
  running the patched systemd binaries.

Relevant bug: https://bugs.freedesktop.org/show_bug.cgi?id=90794
2015-06-17 11:12:12 -07:00
Filipe Brandenburger
0e9800d5d9 tests: additional cases in test-unit-file
These tests will be useful to check the cases regarding quoted and
escaped semicolon when we switch to using unquote_first_word.

Additionally, convert some of the tests that have semicolons so that the
argument after the semicolon looks like a path (starts with /) so that
we can see the change of behavior when making config_parse_exec more
strict about what it accepts as a command separator.
2015-06-17 11:12:12 -07:00
Filipe Brandenburger
b59292b296 util: Introduce unquote_first_word_and_warn
It will try to unquot_first_word, but if it runs into escaping problems
it will retry it adding UNQUOTE_CUNESCAPE_RELAX to the flags.  If it
succeeds on the second try, it will log a warning about it.  If it fails
both times, it will log an error.

Add test cases to confirm it behaves as expected.
2015-06-17 11:12:12 -07:00
Filipe Brandenburger
d6293c070e util: New flag UNQUOTE_UNESCAPE_RELAX for unquote_first_word
The new flag UNQUOTE_UNESCAPE_RELAX preserves unrecognized escape
sequences verbatim in unquote_first_word, either when it's a trailing
backslash (similar to UNQUOTE_RELAX, but in this case keep the extra
backslash in the output) or in the middle of a sequence string.

Add unit test cases to ensure the new flag works as expected and to
prevent regressions from being introduced.

Tested with a follow up commit converting config_parse_exec() to start
using unquote_first_word, in which case this flags makes it possible to
preserve unrecognized escape sequences.

Relevant bug: https://bugs.freedesktop.org/show_bug.cgi?id=90794
2015-06-17 11:12:11 -07:00
Filipe Brandenburger
05654e712f util: Refactor common cunescape block in unquote_first_word 2015-06-17 11:12:11 -07:00
Tom Gundersen
b3d4ef81f6 Merge pull request #267 from phomes/master
sd-dhcp-client: readd deleted error check
2015-06-17 20:04:17 +02:00
Lennart Poettering
b0fc0763d3 Merge pull request #265 from smcv/logind-runtimedir-race-write-earlier
logind: save /run/systemd/users/UID before starting user@.service
2015-06-17 19:52:04 +02:00
Tom Gundersen
00dbd902e9 man: libudev - add description to udev_device_* 2015-06-17 19:48:15 +02:00
David Herrmann
9ee7a50c0b bus: fix installing DRIVER matches on kdbus
In kdbus we still have to support org.freedesktop.DBus matches even though
there is no real bus driver. The reason is that bus-control.c turns
NameOwnerChanged matches into proper kdbus matches. If we drop DRIVER
matches early, we will never match on name-changes for kdbus.

Two ways to fix this:

 1) Install DRIVER matches on kdbus (which is the simple way our and which
    is what this patch does).

 2) Properly fix the scope-detection to let NameOwnerChanged matches
    through (or better: block anything with Member!=NameOwnerChanged).
2015-06-17 19:18:37 +02:00
Thomas Hindoe Paaboel Andersen
144c348883 sd-dhcp-client: readd deleted error check
Seems to have been removed by mistake in:
9021bb9f93
2015-06-17 19:11:18 +02:00
Kay Sievers
79b04ad7d4 Merge pull request #262 from teg/udev-dup-fds-2
udevd: daemon - connect /dev/null to std{in,out,err} in debug mode
2015-06-17 19:06:49 +02:00
Kay Sievers
633f2d59ed Merge pull request #263 from kaysievers/wip
turn kdbus support into a runtime option
2015-06-17 19:06:13 +02:00
Jean Delvare
14f494c710 watchdog: Don't require WDIOC_SETOPTIONS/WDIOS_ENABLECARD
Not all watchdog drivers implement WDIOC_SETOPTIONS. Drivers which do
not implement it have their device always enabled. So it's fine to
report an error if WDIOS_DISABLECARD is passed and the ioctl is not
implemented, however failing when WDIOS_ENABLECARD is passed and the
ioctl is not implemented is not good: if the device was already
enabled then WDIOS_ENABLECARD was a no-op and wasn't needed in the
first place. So we can just ignore the error and continue.
2015-06-17 19:04:10 +02:00
Tom Gundersen
99cfda2f7f Merge pull request #259 from poettering/logind-label-fix
logind: apply selinux label to XDG_RUNTIME_DIR
2015-06-17 19:02:19 +02:00
Tom Gundersen
40e749b59b udevd: daemon - connect /dev/null to std{in,out,err} in debug mode
This is essentially a revert of 5c67cf2 and fixes issue #190.
2015-06-17 18:07:20 +02:00
Simon McVittie
71161305f1 logind: save /run/systemd/users/UID before starting user@.service
Previously, this had a race condition during a user's first login.
Some component calls CreateSession (most likely by a PAM service
other than 'systemd-user' running pam_systemd), with the following
results:

- logind:
  * create the user's XDG_RUNTIME_DIR
  * tell pid 1 to create user-UID.slice
  * tell pid 1 to start user@UID.service

Then these two processes race:

- logind:
  * save information including XDG_RUNTIME_DIR to /run/systemd/users/UID

- the subprocess of pid 1 responsible for user@service:
  * start a 'systemd-user' PAM session, which reads XDG_RUNTIME_DIR
    and puts it in the environment
  * run systemd --user, which requires XDG_RUNTIME_DIR in the
    environment

If logind wins the race, which usually happens, everything is fine;
but if the subprocesses of pid 1 win the race, which can happen
under load, then systemd --user exits unsuccessfully.

To avoid this race, we have to write out /run/systemd/users/UID
even though the service has not "officially" started yet;
previously this did an early-return without saving anything.
Record its state as OPENING in this case.

Bug: https://github.com/systemd/systemd/issues/232
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-06-17 17:04:26 +01:00
Kay Sievers
1b09f548c7 turn kdbus support into a runtime option
./configure --enable/disable-kdbus can be used to set the default
behavior regarding kdbus.

If no kdbus kernel support is available, dbus-dameon will be used.

With --enable-kdbus, the kernel command line option "kdbus=0" can
be used to disable kdbus.

With --disable-kdbus, the kernel command line option "kdbus=1" is
required to enable kdbus support.
2015-06-17 18:01:49 +02:00
Kay Sievers
a54941f1b4 Merge pull request #256 from kaysievers/wip
libsystemd: remove list of symbols to export only in the future
2015-06-17 17:18:10 +02:00
Lennart Poettering
225a833007 Merge pull request #260 from mbiebl/systemshutdowndir-substitution
build-sys: restore systemshutdowndir substitution
2015-06-17 17:11:42 +02:00
Michael Biebl
40af96f692 build-sys: restore systemshutdowndir substitution
This was accidentally removed in d6b07ef.
2015-06-17 16:37:59 +02:00