Commit Graph

29505 Commits

Author SHA1 Message Date
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
Lennart Poettering 6f90962a87 Merge pull request #6380 from keszybz/seccomp-arm64
Seccomp arm64
2017-07-16 16:17:59 +02:00
Zbigniew Jędrzejewski-Szmek f60a865a49 test-seccomp: arm64 does not have access() and poll()
glibc uses faccessat and ppoll, so just add a filters for that.

(cherry picked from commit abc0213839fef92e2e2b98a434914f22ece48490)
2017-07-15 17:18:22 -04:00
Zbigniew Jędrzejewski-Szmek 79873bc850 seccomp: arm64 does not have mmap2
I messed up when adding the definitions in 4278d1f531.
Unfortunately I didn't have the hardware at hand and went by
looking at the kernel headers.

(cherry picked from commit 53196fafcb7b24b45ed4f48ab894d00a24a6d871)
2017-07-15 17:18:22 -04:00
Zbigniew Jędrzejewski-Szmek 2e64e8f46d seccomp: arm64/x32 do not have _sysctl
So don't even try to added the filter to reduce noise.
The test is updated to skip calling _sysctl because the kernel prints
an oops-like message that is confusing and unhelpful:

Jul 15 21:07:01 rpi3 kernel: test-seccomp[8448]: syscall -10080
Jul 15 21:07:01 rpi3 kernel: Code: aa0503e4 aa0603e5 aa0703e6 d4000001 (b13ffc1f)
Jul 15 21:07:01 rpi3 kernel: CPU: 3 PID: 8448 Comm: test-seccomp Tainted: G        W       4.11.8-300.fc26.aarch64 #1
Jul 15 21:07:01 rpi3 kernel: Hardware name: raspberrypi rpi/rpi, BIOS 2017.05 06/24/2017
Jul 15 21:07:01 rpi3 kernel: task: ffff80002bb0bb00 task.stack: ffff800036354000
Jul 15 21:07:01 rpi3 kernel: PC is at 0xffff8669c7c4
Jul 15 21:07:01 rpi3 kernel: LR is at 0xaaaac64b6750
Jul 15 21:07:01 rpi3 kernel: pc : [<0000ffff8669c7c4>] lr : [<0000aaaac64b6750>] pstate: 60000000
Jul 15 21:07:01 rpi3 kernel: sp : 0000ffffdc640fd0
Jul 15 21:07:01 rpi3 kernel: x29: 0000ffffdc640fd0 x28: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x27: 0000000000000000 x26: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x25: 0000000000000000 x24: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x23: 0000000000000000 x22: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x21: 0000aaaac64b4940 x20: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x19: 0000aaaac64b88f8 x18: 0000000000000020
Jul 15 21:07:01 rpi3 kernel: x17: 0000ffff8669c7a0 x16: 0000aaaac64d2ee0
Jul 15 21:07:01 rpi3 kernel: x15: 0000000000000000 x14: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x13: 203a657275746365 x12: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x11: 0000ffffdc640418 x10: 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x9 : 0000000000000005 x8 : 00000000ffffd8a0
Jul 15 21:07:01 rpi3 kernel: x7 : 7f7f7f7f7f7f7f7f x6 : 7f7f7f7f7f7f7f7f
Jul 15 21:07:01 rpi3 kernel: x5 : 65736d68716f7277 x4 : 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x3 : 0000000000000008 x2 : 0000000000000000
Jul 15 21:07:01 rpi3 kernel: x1 : 0000000000000000 x0 : 0000000000000000
Jul 15 21:07:01 rpi3 kernel:

(cherry picked from commit 1e20e640132c700c23494bb9e2619afb83878380)
2017-07-15 17:18:22 -04:00
Zbigniew Jędrzejewski-Szmek e7854c46be shared/seccomp-util: add parentheses and no. after syscall name
"Failed to add rule for system call access, ignoring: Numerical argument out of domain"
is confusing. Make that "... system call access() / 238".

(cherry picked from commit 977dc6ca5acb8069a2966ec63e7378576bc2ca51)
2017-07-15 17:18:22 -04:00
Lucas Werkmeister ceabfb889d Fix spelling (#6378) 2017-07-15 12:29:09 -04:00
Susant Sahani b2392ff31c journald: make reading /dev/kmsg optional (#6362)
Closes #6022
2017-07-15 13:57:52 +02:00
IPv4v6 cb4069d95e add version argument to help function (#6377)
Signed-off-by: Stefan Pietsch <mail.ipv4v6+gh@gmail.com>
2017-07-15 13:53:21 +02:00
Tejun Heo 4095205ecc core: support "nsdelegate" cgroup v2 mount option (#6294)
cgroup namespace wasn't useful for delegation because it allowed resource
control interface files (e.g. memory.high) to be written from inside the
namespace - this allowed the namespace parent's resource distribution to be
disturbed by its namespace-scoped children.

A new mount option, "nsdelegate", was added to cgroup v2 to address this issue.
The flag is meangingful only when mounting cgroup v2 in the init namespace and
makes a cgroup namespace a delegation boundary.  The kernel feature is pending
for v4.13.

This should have been the default behavior on cgroup namespaces and this commit
makes systemd try "nsdelegate" first when trying to mount cgroup v2 and fall
back if the option is not supported.

Note that this has danger of breaking usages which depend on modifying the
parent's resource settings from the namespace root, which isn't a valid thing
to do, but such usages may still exist.
2017-07-14 19:27:13 +02:00
Vito Caputo 8c3d9662ed journal: elide fd matching from window_matches() (#6340)
Introduces window_matches_fd() for the fd matching case in try_context(),

In find_mmap() we're already walking a list of windows by fd, checking
this is pointless work in a potentially hot loop with many windows.
2017-07-14 19:26:01 +02:00
Vito Caputo c7884da9e4 journal: use context_attach_window() in add_mmap() (#6339)
Instead of context_detach_window() and a manual attach of the new
window, simply call context_attach_window() which performs the
detach first if appropriate.
2017-07-14 19:24:46 +02:00
Hans de Goede 7ab6111fdb hwdb: Add ACCEL_MOUNT_MATRIX for a number of Intel Bay Trail based devices (#6357)
This commit adds ACCEL_MOUNT_MATRIX entries for the following devices:
-Acer Iconia Tab8 W1-810
-Asustek T100CHI Transformer 2-in-1
-Asustek T100TA Transformer 2-in-1
-Chuwi Vi8 Plus tablet
-Cube iWork8 Air (i1-TF) tablet
-GP-electronic T701 7" tablet
-HP Stream 7 tablet
-I.T.Works TW891 2-in-1
-Jumper Ezpad mini 3
-Lamina I8270 7" tablet
-Peaq MMC1010 2-in-1
-Pipo W2S 8" tablet
-Ployer Momo7w tablet
-Point of View TAB-P800W 8" tablet
-Trekstor Surftab Wintron 7.0 ST70416-6 7" tablet
2017-07-14 12:29:59 -04:00
Christian Hesse 816be2ba44 build-sys: install udev rule 70-joystick.{rules,hwdb} (#6363)
* meson: install udev files 70-joystick.{rules,hwdb}
* Makefile: install udev file 70-joystick.hwdb
2017-07-14 12:28:28 -04:00
Zbigniew Jędrzejewski-Szmek 7d77b8880d build-sys: enable tpm by default
It's been on in Fedora for ages, and it seems strange to have
a feature that's off by default.
2017-07-13 19:37:07 -04:00
Zbigniew Jędrzejewski-Szmek 1256c4814f meson: hook up sysv-generator-test 2017-07-13 19:21:40 -04:00
Zbigniew Jędrzejewski-Szmek 7f0cc63771 sysv-generator: use generator_add_symlink()
generator_add_symlink() is extended to ignore EEXIST. This should be fine
for all existing callers.

There's a small difference in behaviour when adding symlinks in sysv-generator:
the message is more generic and does not include ", ignored". But creation of
symlinks shouldn't ever fail except if things are very wrong, so in practice
this shouldn't matter.

Test needed updating: os.path.exists(os.readlink(link)) only works if the link
is absolute (or if we are in the right directory). Let's just use
os.path.exists(link), which properly tests that the symlink target exists.
2017-07-13 18:56:36 -04:00
Jeremy Bicha 303608c1bc escape: Fix help description (#6352)
Resolves: #6351
2017-07-13 16:44:33 +02:00
Vito Caputo b439282e0b journal: avoid unnecessary mmap_cache_get() calls
journal_file_move_to_object() can skip the second
journal_file_move_to() call if the first one already mapped a
sufficiently large area.

Now that mmap_cache_get() returns the size of the mapped area
when asked, ask for the size and only perform the second call if
the required size exceeds the mapped size instead of the object
header size.

This results in a nice performance boost in my testing, even with
a corpus of many small logs burning much CPU time elsewhere:

 Before:

  # time ./journalctl -b -1 --no-pager > /dev/null
  real    0m16.330s
  user    0m16.281s
  sys     0m0.046s

  # time ./journalctl -b -1 --no-pager > /dev/null
  real    0m16.409s
  user    0m16.358s
  sys     0m0.048s

  # time ./journalctl -b -1 --no-pager > /dev/null
  real    0m16.625s
  user    0m16.558s
  sys     0m0.061s

 After:

  # time ./journalctl -b -1 --no-pager > /dev/null
  real    0m15.311s
  user    0m15.257s
  sys     0m0.046s

  # time ./journalctl -b -1 --no-pager > /dev/null
  real    0m15.201s
  user    0m15.135s
  sys     0m0.062s

  # time ./journalctl -b -1 --no-pager > /dev/null
  real    0m15.170s
  user    0m15.113s
  sys     0m0.053s
2017-07-12 23:59:29 -07:00
Vito Caputo b42549ad69 journal: return mapped size from mmap_cache_get()
If requested, return the actual mapping size to the caller in
addition to the address.

journal_file_move_to_object() often performs two successive
mmap_cache_get() calls via journal_file_move_to(); one to get the
object header, then another to get the entire object when it's
larger than the header's size.

If mmap_cache_get() returned the actual mapping's size, it's
probable that the second mmap_cache_get() could be skipped when
the established mapping already encompassed the desired size.
2017-07-12 23:58:48 -07:00
WaLyong Cho 80c21aea11 core: dump also missed security context 2017-07-13 13:12:24 +09:00
WaLyong Cho 5b8e1b7755 core: modify resource leak by SmackProcessLabel= 2017-07-13 13:12:15 +09:00