Commit Graph

29526 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek a132bef023 Drop kdbus bits
Some kdbus_flag and memfd related parts are left behind, because they
are entangled with the "legacy" dbus support.

test-bus-benchmark is switched to "manual". It was already broken before
(in the non-kdbus mode) but apparently nobody noticed. Hopefully it can
be fixed later.
2017-07-23 12:01:54 -04:00
Zbigniew Jędrzejewski-Szmek a6c97fc460 Drop bus-policy bits 2017-07-23 09:29:02 -04:00
Zbigniew Jędrzejewski-Szmek 4bc5d27b94 Drop busname unit type
Since busname units are only useful with kdbus, they weren't actively
used. This was dead code, only compile-tested. If busname units are
ever added back, it'll be cleaner to start from scratch (possibly reverting
parts of this patch).
2017-07-23 09:29:02 -04:00
Yu Watanabe 8ae12e733c core: fix typo (#6417) 2017-07-21 10:36:39 +02:00
Lennart Poettering 4b61c87511 tree-wide: fput[cs]() → fput[cs]_unlocked() wherever that makes sense (#6396)
As a follow-up for db3f45e2d2 let's do the
same for all other cases where we create a FILE* with local scope and
know that no other threads hence can have access to it.

For most cases this shouldn't change much really, but this should speed
dbus introspection and calender time formatting up a bit.
2017-07-21 10:35:45 +02:00
Zbigniew Jędrzejewski-Szmek 52b1478414 Merge pull request #6413 from poettering/getpid
speed up getpid() again
2017-07-20 15:14:13 -04:00
Lennart Poettering 8cb5743079 nspawn: downgrade warning when we get sd_notify() message from unexpected process (#6416)
Given that we set NOTIFY_SOCKET unconditionally it's not surprising that
processes way down the process tree think it's smart to send us a
notification message.

It's still useful to keep this message, for debugging things, but it
shouldn't be generated by default.
2017-07-20 14:46:58 -04:00
Lennart Poettering df0ff12775 tree-wide: make use of getpid_cached() wherever we can
This moves pretty much all uses of getpid() over to getpid_raw(). I
didn't specifically check whether the optimization is worth it for each
replacement, but in order to keep things simple and systematic I
switched over everything at once.
2017-07-20 20:27:24 +02:00
Lennart Poettering 5c30a6d2b8 process-util: add getpid_cached() as a caching wrapper for getpid()
Let's make getpid() fast again.
2017-07-20 20:27:24 +02:00
Lennart Poettering f7a2b4213c Merge pull request #6266 from keszybz/drop-autotools
Drop support for autotools / automake / make
2017-07-20 19:56:07 +02:00
Harald Hoyer 98eda38aed call chase_symlinks without the /sysroot prefix (#6411)
In case fstab-generator is called in the initrd, chase_symlinks()
returns with a canonical path "/sysroot/sysroot/<mountpoint>", if the
"/sysroot" prefix is present in the path.

This patch skips the "/sysroot" prefix for the chase_symlinks() call,
because "/sysroot" is already the root directory and chase_symlinks()
prepends the root directory in the canonical path returned.
2017-07-20 13:13:09 -04:00
Martin Pitt 39bd1fdf7a Merge pull request #6386 from poettering/mkosi-without-tests
mkosi: support mkosi's --without-tests switch
2017-07-20 15:10:49 +02:00
Lennart Poettering 9400405b4a mkosi: use '[' rather than 'test' everywhere 2017-07-20 14:37:05 +02:00
Lennart Poettering a818a2ae60 mkosi: support mkosi's --without-tests switch
This adds support for the mkosi switch --without-tests that is
introduced by:

https://github.com/systemd/mkosi/pull/122

With this in place doing "mkosi -ifT shell" is the fastest way from a
git clone to a shell within a freshly compiled systemd system.
2017-07-20 14:37:05 +02:00
Shengyao Xue f1e52909c8 hwdb: add two more hotkeys to Lenovo IdeaPad (#6410)
Tested on Lenovo IdeaPad E41-15, and both keys work after those two line added.
2017-07-20 14:21:48 +02:00
Lennart Poettering fccb44863b sd-path: make sure to use tmp_dir() and var_tmp_dir() (#6397)
Let's reuse the common code wherever appropriate.
2017-07-20 14:19:57 +02:00
Felipe Sateler 708d423915 test-condition: don't assume that all non-root users are normal users (#6409)
Automated builders may run under a dedicated system user, and this test would fail that

Fixes #6366
2017-07-19 20:48:23 -04:00
Daniel Berrange 5588612e9e virt: enable detecting QEMU (TCG) via CPUID (#6399)
QEMU >= 2.10 will include a CPUID leaf with value "TCGTCGTCGTCG"
on x86 when running with the TCG CPU emulator:

  https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg05231.html

Existing methods of detecting QEMU are left unchanged for sake of
backcompatibility.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-07-19 11:06:07 +02:00
Yu Watanabe a04efff8a7 test-unit-name: setup fake runtime directory before starting manager (#6401)
Since 3536f49e8f, manager_new() in
user mode requires XDG_RUNTIME_DIR is set. So, in this commit,
setup_fake_runtime_directory() is added in the beginning of test.

Fixes an issue comment in #6384.
2017-07-18 20:26:09 +03:00
Yu Watanabe 35aba85a73 core/manager: fix memory leak (#6400)
This fixes the memory leak introduced by 3536f49e8f,
which forgot to free the prefixes in the manager.

Fixes #6398.
2017-07-18 17:30:52 +03:00
Zbigniew Jędrzejewski-Szmek 18b9ad1f61 build-sys: rename SD_BOOT_LOG_TPM to ENABLE_TPM
This makes it more like other configure defines.

Also, it fixes meson status output which was looking for HAVE_ and ENABLE_
prefixes only (the define under meson was OK, just the summary message was
wrong.)
2017-07-18 10:05:06 -04:00
Zbigniew Jędrzejewski-Szmek e7e157032b build-sys: add basic support for ./configure && make && make install
This adds the basic make support required by
https://github.com/cgwalters/build-api. CFLAGS, CXXFLAGS, DESTDIR variables are
supported:
   ./configure CFLAGS=... CXXFLAGS=... && make && make install DESTDIR=
2017-07-18 10:05:06 -04:00
Zbigniew Jędrzejewski-Szmek 02263eb75e HACKING: update for meson 2017-07-18 10:05:06 -04:00
Zbigniew Jędrzejewski-Szmek 26116187dd test: try to guess the build directory
This will work if $(TOP_SRC_DIR) has exactly one subdirectory with
.ninja_deps. Otherwise, BUILD_DIR has to be specified.
2017-07-18 10:05:06 -04:00
Zbigniew Jędrzejewski-Szmek 209f4b9e33 test: convert test/ to use meson install
Automatic rebuilding is removed: it doesn't play well with ninja, because
ninja always writes logs, and even if nothing needs to be built, it will
make the log file owned by root. So let's just remove this, and say that
the user must always do the build first.

I'm also keeping make for the tests, because ninja doesn't play well with
sudo.

Since the build directory is arbitrary, it needs to be specified, e.g.
  sudo make BUILD_DIR=/home/zbyszek/src/systemd/build1 -C test/TEST-01-BASIC/
2017-07-18 10:05:06 -04:00
Zbigniew Jędrzejewski-Szmek e5f752082e build-sys: drop gitignore patterns for in-tree builds
... and other autotools-generated files.
2017-07-18 10:05:06 -04:00
Zbigniew Jędrzejewski-Szmek 1c6c3ef0bf python: remove star imports
Star imports are discouraged and break pyflakes.

I'm happy to report that pyflakes finds no issues ;)
2017-07-18 10:04:44 -04:00
Zbigniew Jędrzejewski-Szmek 0689f766dc build-sys: drop support for generation of Makefile-man.am 2017-07-18 10:04:44 -04:00
Zbigniew Jędrzejewski-Szmek 72cdb3e783 build-sys: drop automake support
v2:
- also mention m4
2017-07-18 10:04:44 -04:00
Zbigniew Jędrzejewski-Szmek 0d372efadf mailmap: add entry 2017-07-18 10:04:44 -04:00
Yu Watanabe 3536f49e8f core: add {State,Cache,Log,Configuration}Directory= (#6384)
This introduces {State,Cache,Log,Configuration}Directory= those are
similar to RuntimeDirectory=. They create the directories under
/var/lib, /var/cache/, /var/log, or /etc, respectively, with the mode
specified in {State,Cache,Log,Configuration}DirectoryMode=.

This also fixes #6391.
2017-07-18 14:34:52 +02:00
Lennart Poettering 5230e31918 Merge pull request #6349 from poettering/mkosi-builddir
mkosi builddir support
2017-07-18 09:46:08 +02:00
Lucas Werkmeister 6253abca7e mkosi: add m4 (#6389)
This seems to be required since the move to meson.
2017-07-17 18:51:14 -04:00
Martin Pitt 23fa427d66 tests: ignore router state in networkd test (#6390)
In networkd-test.py, don't assert that the router state is "routable".
While it should eventually become that, we don't wait for it, and thus
at that point it often is "carrier" or "degrated" still. It is also not
really relevant as this only tests the "client" side interface.
2017-07-18 00:06:35 +02:00
Vito Caputo db3f45e2d2 basic: use _unlocked() stdio in strip_tab_ansi() (#6385)
Trivial performance boost by explicitly bypassing the implicit
locking of stdio.

This significantly affects common cases of `journalctl` usage:

 Before:

  # time ./journalctl -b -1 > /dev/null
   real    0m26.628s
   user    0m26.495s
   sys     0m0.125s

  # time ./journalctl -b -1 > /dev/null
   real    0m27.069s
   user    0m26.936s
   sys     0m0.134s

  # time ./journalctl -b -1 > /dev/null
   real    0m26.727s
   user    0m26.607s
   sys     0m0.119s

 After:

  # time ./journalctl -b -1 > /dev/null
   real    0m23.394s
   user    0m23.244s
   sys     0m0.142s

  # time ./journalctl -b -1 > /dev/null
   real    0m23.283s
   user    0m23.160s
   sys     0m0.121s

  # time ./journalctl -b -1 > /dev/null
   real    0m23.274s
   user    0m23.125s
   sys     0m0.144s

Fixes https://github.com/systemd/systemd/issues/6341
2017-07-18 00:05:52 +02:00
Lennart Poettering e758bc9132 Merge pull request #6387 from keszybz/fix-timeout-0
Fix x-systemd.timeout=0 in fstab
2017-07-18 00:04:24 +02:00
Lucas Werkmeister b071291083 mkosi: roll back to libidn on Arch (#6388)
This reverts the mkosi.arch part of a8a2a0ed64. libidn2 is only
available on AUR, which mkosi doesn’t support.
2017-07-17 22:41:31 +02:00
Zbigniew Jędrzejewski-Szmek 4a06cbf838 Use config_parse_sec_fix_0() also for JobRunningTimeoutSec
2d79a0bbb9 did that for TimeoutSec=,
89beff89ed did that for JobTimeoutSec=,
and 0004f698df did that for
x-systemd.device-timeout=. But after parsing x-systemd.device-timeout=xxx
we write it out as JobRunningTimeoutSec=xxx. Two options:
- write out JobRunningTimeoutSec=<a very big number>,
- change JobRunningTimeoutSec= to behave like the other options.

I think it would be confusing for JobRunningTimeoutSec= to have different
syntax then TimeoutSec= and JobTimeoutSec=, so this patch implements the
second option.

Fixes #6264, https://bugzilla.redhat.com/show_bug.cgi?id=1462378.
2017-07-17 16:03:49 -04:00
Zbigniew Jędrzejewski-Szmek b2a1a5c76c man: make crypttab(5) a bit easier to read 2017-07-17 16:03:24 -04:00
Lennart Poettering 70e760e3a7 mkosi: make use of BUILDDIR if it is set
This way, the new "mkosi.builddir" support proposed in PR:

https://github.com/systemd/mkosi/pull/114

will be made use of automatically.
2017-07-17 18:56:12 +02:00
Lennart Poettering c387cc49d9 gitignore: include mkosi -i files in gitignore
(also: sort the entries again)
2017-07-17 18:03:42 +02:00
Michal Sekletar 3c978aca69 journald: make sure we retain all stream fds across restarts (#6348)
Currently we set 4096 as maximum for number of stream connections that
we accept. However maximum number of file descriptors that systemd is
willing to accept from us is just 1024. This means we can't retain all
stream connections that we accepted. Hence bump the limit of fds in a
unit file so that systemd holds open all stream fds while we are
restarted.

New limit is set to 4224 (4096 + 128).
2017-07-17 10:04:37 +02:00
Lennart Poettering 688230d3a7 Merge pull request #6354 from walyong/smack_process_label_free
core: modify resource leak and missed security context dump
2017-07-17 10:04:12 +02:00
Lennart Poettering ddf1819bc2 Merge pull request #6355 from vcaputo/journal_avoid_mmap_cache_get_calls
journal: avoid unnecessary mmap_cache_get() calls
2017-07-17 10:03:52 +02:00
NeilBrown c67bd1f758 fstab-generator: ignore x-systemd.device-timeout for non-devices (#6368)
If you specify "x-systemd.device-timeout" for an NFS mount
point, you get no warning and a meaningless device unit
dependency created.

Better to have a warning and no dependency.
2017-07-17 10:03:34 +02:00
Lennart Poettering 0b9b1771c6 Merge pull request #6367 from keszybz/enable-tpm
build-sys: enable tpm by default
2017-07-17 10:03:13 +02:00
Lennart Poettering 981778e212 Merge pull request #6324 from keszybz/generator-add-symlink
Add helper function for creation of unit symlinks in generators
2017-07-17 10:02:54 +02:00
Lennart Poettering 7398320f9a Merge pull request #6328 from yuwata/runtime-preserve
core: Allow preserving contents of RuntimeDirectory over process restart
2017-07-17 10:02:19 +02:00
Yu Watanabe 23a7448efa core: support subdirectories in RuntimeDirectory= option 2017-07-17 16:30:53 +09:00
Yu Watanabe 53f47dfc7b core: allow preserving contents of RuntimeDirectory= over process restart
This introduces RuntimeDirectoryPreserve= option which takes a boolean
argument or 'restart'.

Closes #6087.
2017-07-17 16:22:25 +09:00