Commit graph

26891 commits

Author SHA1 Message Date
Lennart Poettering 4a13100c6a Merge pull request #4052 from yann-morin-1998/yem/o-tmpfile
importd: fix build failure with missing O_TMPFILE (branch yem/o-tmpfile)
2016-08-30 09:47:25 +02:00
Martin Pitt 3e2b210894 Merge pull request #4054 from yuwata/man-fix
man page fixes
2016-08-30 06:27:04 +02:00
WaLyong Cho 96e131ea09 core: introduce MemorySwapMax=
Similar to MemoryMax=, MemorySwapMax= limits swap usage. This controls
controls "memory.swap.max" attribute in unified cgroup.
2016-08-30 11:11:45 +09:00
Yann E. MORIN 1d9ed17178 basic/fileio: we always have O_TMPFILE now
fileio makes use of O_TMPFILE when it is available.

We now always have O_TMPFILE, defined in missing.h if missing
from the toolchain headers.

Have fileio include missing.h and drop the guards around the
use of O_TMPFILE.
2016-08-29 12:49:10 +02:00
Yann E. MORIN daad709a7c missing.h: add missing definitions for __O_TMPFILE
Currently, a missing __O_TMPFILE was only defined for i386 and x86_64,
leaving any other architectures with an "old" toolchain fail miserably
at build time:
    src/import/export-raw.c: In function 'reflink_snapshot':
    src/import/export-raw.c:271:26: error: 'O_TMPFILE' undeclared (first use in this function)
             new_fd = open(d, O_TMPFILE|O_CLOEXEC|O_NOCTTY|O_RDWR, 0600);
                              ^

__O_TMPFILE (and O_TMPFILE) are available since glibc 2.19. However, a
lot of existing toolchains are still using glibc-2.18, and some even
before that, and it is not really possible to update those toolchains.

Instead of defining it only for i386 and x86_64, define __O_TMPFILE
with the specific values for those archs where it is different from the
generic value. Use the values as found in the Linux kernel (v4.8-rc3,
current as of time of commit).

---
Note: tested on ARM (build+run), with glibc-2.18 and linux headers 3.12.
Untested on other archs, though (I have no board to test this).

Changes v1 -> v2:
  - add a comment specifying some are hexa, others are octal.
2016-08-29 12:40:22 +02:00
Yann E. MORIN 4a6d35237f importd/export-raw: needs missing.h for O_TMPFILE
O_TMPFILE may be missing from the system headers, so use our fallback
definition.

---
Changes v1 -> v2:
  - move include with local includes
2016-08-29 12:40:22 +02:00
Yu Watanabe de87760fde man: systemd-journal-remote: do not use ulink tags for example addresses
Applying ulink tags to example addresses adds meaningless references in NOTES section of the man page.
2016-08-29 16:08:56 +09:00
Yu Watanabe 871583be95 man: systemd.mount: DefaultTimeoutStart -> DefaultTimeoutStartSec 2016-08-29 11:02:36 +09:00
Peter Hutterer 2551d797f3 Merge pull request #4046 from pilophae/ideapad500isk
hwdb: add axis range corrections for Lenovo Ideapad 500S-13ISK
2016-08-29 11:37:01 +10:00
Mantas Mikulėnas d9e76d1433
hwdb: 60-keyboard: remove line causing a syntax error 2016-08-27 19:12:44 +03:00
Barron Rulon 49915de245 mount: add SloppyOptions= to mount_dump() 2016-08-27 10:47:46 -04:00
Barron Rulon 4f8d40a9dc mount: add new ForceUnmount= setting for mount units, mapping to umount(8)'s "-f" switch 2016-08-27 10:46:52 -04:00
Erik Karlsson 67684ba665 hwdb: add axis range corrections for Lenovo Ideapad 500S-13ISK 2016-08-26 19:48:52 +02:00
Douglas Christman 2507992f6b load-fragment: Resolve specifiers in OnCalendar and On*Sec
Resolves #3534
2016-08-26 12:13:16 -04:00
brulon e520950a03 mount: add new LazyUnmount= setting for mount units, mapping to umount(8)'s "-l" switch (#3827) 2016-08-26 17:57:22 +02:00
Vito Caputo 6431c7e216 journal: add/use flushed_flag_is_set() helper (#4041)
Minor cleanup suggested by Lennart.
2016-08-26 17:51:13 +02:00
Evgeny Vereshchagin 23cabb68ac tests: mount proc before exec valgrind (#4044)
Fixes:
$ sudo make run QEMU_BIN=/usr/bin/qemu-system-x86_64  KERNEL_APPEND=systemd.unit=multi-user.target SKIP_INITRD=yes
TEST RUN: Basic systemd setup
+ /usr/bin/qemu-system-x86_64 -smp 1 -net none -m 512M -nographic -kernel /boot/vmlinuz-4.6.7-200.fc23.x86_64 -drive format=raw,cache=unsafe,file=/var/tmp/systemd-test.izx99J/rootdisk.img -append 'root=/dev/sda1 raid=noautodetect loglevel=2 init=/usr/lib/systemd/systemd-under-valgrind rw console=ttyS0 selinux=0 systemd.unified_cgroup_hierarchy=no systemd.unit=multi-user.target '
valgrind: warning (non-fatal): readlink("/proc/self/exe") failed.
valgrind: continuing, however --trace-children=yes will not work.
--1:0: aspacem Valgrind: FATAL: can't open /proc/self/maps
--1:0: aspacem Exiting now.
[    3.152367] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[    3.152367]
[    3.152367] CPU: 0 PID: 1 Comm: memcheck-amd64- Not tainted 4.6.7-200.fc23.x86_64 #1
[    3.152367] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.2-20150714_191134- 04/01/2014
[    3.152367]  0000000000000086 0000000047ca1666 ffff88001ea43e00 ffffffff813d954e
[    3.152367]  ffffffff81a205a0 ffff88001ea43e98 ffff88001ea43e88 ffffffff811b5557
[    3.152367]  ffffffff00000010 ffff88001ea43e98 ffff88001ea43e30 0000000047ca1666
[    3.152367] Call Trace:
[    3.152367]  [<ffffffff813d954e>] dump_stack+0x63/0x85
[    3.152367]  [<ffffffff811b5557>] panic+0xde/0x220
[    3.152367]  [<ffffffff810ab9c3>] do_exit+0xb43/0xb50
[    3.152367]  [<ffffffff810aba57>] do_group_exit+0x47/0xb0
[    3.152367]  [<ffffffff810abad4>] SyS_exit_group+0x14/0x20
[    3.152367]  [<ffffffff817dae72>] entry_SYSCALL_64_fastpath+0x1a/0xa4
[    3.152367] Kernel Offset: disabled
[    3.152367] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[    3.152367]
QEMU: Terminated
2016-08-26 17:49:56 +02:00
Evgeny Vereshchagin 6afe14ff5b Merge pull request #3984 from poettering/refcnt
permit bus clients to pin units to avoid automatic GC
2016-08-26 16:17:05 +03:00
Luca Bruno 0c582db0c6 nspawn: split down SYSTEMD_NSPAWN_SHARE_SYSTEM (#4023)
This commit follows further on the deprecation path for --share-system,
by splitting and gating each share-able namespace behind its own
environment flag.
2016-08-26 00:08:26 +02:00
Michal Sekletar 51bce29f8e units: remove udev control socket when systemd stops the socket unit (#4039)
Mere presence of the socket in the filesystem makes
udev_queue_get_udev_is_active() return that udev is running. Note that,
udev on exit doesn't unlink control socket nor does systemd. Thus socket
stays around even when both daemon and socket are stopped. This causes
problems for cryptsetup because when it detects running udev it launches
synchronous operations that *really* require udev. This in turn may
cause blocking and subsequent timeout in systemd-cryptsetup on reboot
while machine is in a state that udev and its control socket units are
stopped, e.g. emergency mode.

Fixes #2477
2016-08-26 00:07:58 +02:00
Vito Caputo 929eeb5498 journal: implicitly flush to var on recovery (#4028)
When the system journal becomes re-opened post-flush with the runtime
journal open, it implies we've recovered from something like an ENOSPC
situation where the system journal rotate had failed, leaving the system
journal closed, causing the runtime journal to be opened post-flush.

For the duration of the unavailable system journal, we log to the
runtime journal.  But when the system journal gets opened (space made
available, for example), we need to close the runtime journal before new
journal writes will go to the system journal.  Calling
server_flush_to_var() after opening the system journal with a runtime
journal present, post-flush, achieves this while preserving the runtime
journal's contents in the system journal.

The combination of the present flushed flag file and the runtime journal
being open is a state where we should be logging to the system journal,
so it's appropriate to resume doing so once we've successfully opened
the system journal.
2016-08-25 17:37:57 +02:00
Mantas Mikulėnas c436d55397
networkd: do not drop config for unmanaged interfaces
Flushing foreign configuration for unmanaged interfaces is outright
evil, especially when it's a regular occurence with Wi-Fi.

Fixes: 3104883ddc "networkd: remove route if carrier is lost"
Ref: #3831
2016-08-25 13:25:08 +03:00
Michal Sekletar 1ef72b55ba udev: inform systemd how many workers we can potentially spawn (#4036) 2016-08-25 08:18:42 +02:00
Stefan b74d0fdf79 docs: add --with-support-url= to distribution porting guide. (#4035) 2016-08-24 20:49:53 +02:00
Nick Owens 3dea75dead run: respect quiet when starting timer (#4029) 2016-08-24 12:12:18 +02:00
Peter Hutterer 769c29d5d1 hwdb: add axis ranges for the MacBook 4,1 (#4030)
https://bugzilla.redhat.com/show_bug.cgi?id=1357990
2016-08-24 12:11:48 +02:00
Balázs Úr 3e3ddccf08 Updated Hungarian translation (#4026) 2016-08-23 20:08:35 +02:00
Felipe Sateler 8dec4a9d2d core,network: Use const qualifiers for block-local variables in macro functions (#4019)
Prevents discard-qualifiers warnings when the passed variable was const
2016-08-23 12:29:30 +03:00
Felipe Sateler 83f12b27d1 core: do not fail at step SECCOMP if there is no kernel support (#4004)
Fixes #3882
2016-08-22 22:40:58 +03:00
Lennart Poettering 383034987d bus-util: turn on exit-on-disconnect for all command line tools
bus_connect_transport() is exclusively used from our command line tools, hence
let's set exit-on-disconnect for all of them, making behaviour a bit nicer in
case dbus-daemon goes down.
2016-08-22 17:31:41 +02:00
Lennart Poettering fbb4603d48 sd-bus: optionally, exit process or event loop on disconnect
Old libdbus has a feature that the process is terminated whenever the the bus
connection receives a disconnect. This is pretty useful on desktop apps (where
a disconnect indicates session termination), as well as on command line apps
(where we really shouldn't stay hanging in most cases if dbus daemon goes
down).

Add a similar feature to sd-bus, but make it opt-in rather than opt-out, like
it is on libdbus. Also, if the bus is attached to an event loop just exit the
event loop rather than the the whole process.
2016-08-22 17:31:41 +02:00
Lennart Poettering 2c5f295823 update TODO 2016-08-22 17:31:41 +02:00
Lennart Poettering 70cb8b7b16 sd-bus: add a small test case for sd_bus_track
This tests in particular that disconnecting results in the tracking object's
handlers to be called.
2016-08-22 17:31:36 +02:00
Lennart Poettering 232f367766 sd-bus: when the server-side disconnects, make sure to dispatch all tracking objects immediately
If the server side kicks us from the bus, from our view no names are on the bus
anymore, hence let's make sure to dispatch all tracking objects immediately.
2016-08-22 17:31:36 +02:00
Lennart Poettering 8b6e65ac32 sd-bus: ensure we don't dispatch track objects while we are adding names to them
In order to add a name to a bus tracking object we need to do some bus
operations: we need to check if the name already exists and add match for it.
Both are synchronous bus calls. While processing those we need to make sure
that the tracking object is not dispatched yet, as it might still be empty, but
is not going to be empty for very long.

hence, block dispatching by removing the object from the dispatch queue while
adding it, and readding it on error.
2016-08-22 16:14:21 +02:00
Lennart Poettering 217fcc7eb3 sd-bus: split out handling of reply callbacks on close into its own function
When a bus connection is closed we dispatch all reply callbacks. Do so in a new
function if its own.

No behaviour changes.
2016-08-22 16:14:21 +02:00
Lennart Poettering 390bc2b149 core: let's use set_contains() where appropriate 2016-08-22 16:14:21 +02:00
Lennart Poettering 014c4c98ba man: document the new --wait switch of systemd-run
Also, make major improvements to the an page in general.
2016-08-22 16:14:21 +02:00
Lennart Poettering 2a453c2ee3 run: optionally, wait for the service to finish and show its result 2016-08-22 16:14:21 +02:00
Lennart Poettering fe700f46ec core: cache last CPU usage counter, before destorying a cgroup
It is useful for clients to be able to read the last CPU usage counter value of
a unit even if the unit is already terminated. Hence, before destroying a
cgroup's cgroup cache the last CPU usage counter and return it if the cgroup is
gone.
2016-08-22 16:14:21 +02:00
Lennart Poettering 8b3b6f588c bus-util: make sure map_basic() returns EOPNOTSUPP if called for an unknown type
Make sure we return proper errors for types not understood yet.
2016-08-22 16:14:21 +02:00
Lennart Poettering 0b83b8a4dc bus-util: treat an empty string as a NULL
Instead of ignoring empty strings retrieved via the bus, treat them as NULL, as
it's customary in systemd.
2016-08-22 16:14:21 +02:00
Lennart Poettering bdf97b8ad8 bus-util: support mapping signed integers with bus_map_properties()
Let's make sure we can read the exit code/status properties exposed by PID 1
properly. Let's reuse the existing code for unsigned fields, as we just use it
to copy words around, and don't calculate it.
2016-08-22 16:14:21 +02:00
Lennart Poettering 05a98afd3e core: add Ref()/Unref() bus calls for units
This adds two (privileged) bus calls Ref() and Unref() to the Unit interface.
The two calls may be used by clients to pin a unit into memory, so that various
runtime properties aren't flushed out by the automatic GC. This is necessary
to permit clients to race-freely acquire runtime results (such as process exit
status/code or accumulated CPU time) on successful service termination.

Ref() and Unref() are fully recursive, hence act like the usual reference
counting concept in C. Taking a reference is a privileged operation, as this
allows pinning units into memory which consumes resources.

Transient units may also gain a reference at the time of creation, via the new
AddRef property (that is only defined for transient units at the time of
creation).
2016-08-22 16:14:21 +02:00
Lennart Poettering ecddb2b586 man: document sd_bus_track objects
And while ware at it, also drop some references to kdbus, and stop claiming
sd-bus wasn't stable yet. Also order man page references in the main sd-bus man
page alphabetically.
2016-08-22 14:17:24 +02:00
Lennart Poettering ae1a2efa8b sd-bus: add a "recursive" mode to sd_bus_track
This adds an optional "recursive" counting mode to sd_bus_track. If enabled
adding the same name multiple times to an sd_bus_track object is counted
individually, so that it also has to be removed the same number of times before
it is gone again from the tracking object.

This functionality is useful for implementing local ref counted objects that
peers make take references on.
2016-08-22 14:17:24 +02:00
Lennart Poettering 512e3bbce6 man: don't claim arguments where const that actually are not 2016-08-22 14:17:24 +02:00
Lennart Poettering 4a4485ae69 seccomp: make sure getrlimit() is among the default permitted syscalls
A lot of basic code wants to know the stack size, and it is safe if they do,
hence let's permit getrlimit() (but not setrlimit()) by default.

See: #3970
2016-08-22 14:17:23 +02:00
0xAX 05b4d3b55c mount-tool: return 0 instead of NULL in the acquire_description() (#4009)
to prevent:

src/mount/mount-tool.c: In function ‘acquire_description’:
src/mount/mount-tool.c:728:24: warning: return makes integer from pointer without a cast [-Wint-conversion]
                 return NULL;
                                         ^~~~
warning.

Additionally we don't set Description property in a case when
arg_description is NULL.
2016-08-22 02:14:23 -04:00
Peter Hutterer df35bfaa25 hwdb: provide axis ranges for the Dell XPS M1530 (#4016)
https://bugs.freedesktop.org/show_bug.cgi?id=97433
2016-08-21 19:31:25 -04:00