platform/upstream/systemd.git
8 years agopid1: drop kdbus_fd and all associated logic
Zbigniew Jędrzejewski-Szmek [Fri, 9 Sep 2016 14:16:26 +0000 (15:16 +0100)]
pid1: drop kdbus_fd and all associated logic

8 years agoman: drop kdbus descriptions from sd_b_negotiate_fds(3)
Zbigniew Jędrzejewski-Szmek [Fri, 9 Sep 2016 14:06:06 +0000 (15:06 +0100)]
man: drop kdbus descriptions from sd_b_negotiate_fds(3)

8 years agobuild-sys: drop last reference to --have-kdbus
Zbigniew Jędrzejewski-Szmek [Fri, 9 Sep 2016 14:03:11 +0000 (15:03 +0100)]
build-sys: drop last reference to --have-kdbus

8 years agoservice: Continue shutdown on socket activated unit on termination (#4108)
Kyle Russell [Fri, 9 Sep 2016 02:34:43 +0000 (22:34 -0400)]
service: Continue shutdown on socket activated unit on termination (#4108)

ENOTCONN may be a legitimate return code if the endpoint disappeared,
but the service should still attempt to shutdown cleanly.

8 years agoman: add missing <constant> tag (#4109)
Lucas Werkmeister [Thu, 8 Sep 2016 08:18:16 +0000 (10:18 +0200)]
man: add missing <constant> tag (#4109)

8 years agoMerge pull request #4087 from fsateler/detect-seccomp-filter
Evgeny Vereshchagin [Wed, 7 Sep 2016 03:44:06 +0000 (06:44 +0300)]
Merge pull request #4087 from fsateler/detect-seccomp-filter

seccomp: also detect if seccomp filtering is available

8 years agoREADME: document that CONFIG_SECCOMP_FILTER is required for SECCOMP support
Felipe Sateler [Mon, 5 Sep 2016 22:16:13 +0000 (19:16 -0300)]
README: document that CONFIG_SECCOMP_FILTER is required for SECCOMP support

8 years agonspawn: detect SECCOMP availability, skip audit filter if unavailable
Felipe Sateler [Tue, 6 Sep 2016 23:25:22 +0000 (20:25 -0300)]
nspawn: detect SECCOMP availability, skip audit filter if unavailable

Fail hard if SECCOMP was detected but could not be installed

8 years agoseccomp: also detect if seccomp filtering is enabled
Felipe Sateler [Wed, 31 Aug 2016 13:00:35 +0000 (10:00 -0300)]
seccomp: also detect if seccomp filtering is enabled

In https://github.com/systemd/systemd/pull/4004 , a runtime detection
method for seccomp was added. However, it does not detect the case
where CONFIG_SECCOMP=y but CONFIG_SECCOMP_FILTER=n. This is possible
if the architecture does not support filtering yet.
Add a check for that case too.

While at it, change get_proc_field usage to use PR_GET_SECCOMP prctl,
as that should save a few system calls and (unnecessary) allocations.
Previously, reading of /proc/self/stat was done as recommended by
prctl(2) as safer. However, given that we need to do the prctl call
anyway, lets skip opening, reading and parsing the file.

Code for checking inspired by
https://outflux.net/teach-seccomp/autodetect.html

8 years agoMerge pull request #4084 from ssahani/netfix
Daniel Mack [Fri, 2 Sep 2016 20:08:18 +0000 (22:08 +0200)]
Merge pull request #4084 from ssahani/netfix

fix #4080

8 years agofix #4080
Susant Sahani [Fri, 2 Sep 2016 10:36:58 +0000 (16:06 +0530)]
fix #4080

ethtool_sset_info  adding some extra space to it.

also fix valgrind warning
```
Unloaded link configuration context.
==31690==
==31690== HEAP SUMMARY:
==31690==     in use at exit: 8,192 bytes in 2 blocks
==31690==   total heap usage: 431 allocs, 429 frees, 321,164 bytes allocated
==31690==
==31690== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 2
==31690==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==31690==    by 0x166B32: mempool_alloc_tile (mempool.c:62)
==31690==    by 0x166BBC: mempool_alloc0_tile (mempool.c:81)
==31690==    by 0x15B8FC: hashmap_base_new (hashmap.c:732)
==31690==    by 0x15B9F7: internal_hashmap_new (hashmap.c:766)
==31690==    by 0x151291: conf_files_list_strv_internal (conf-files.c:103)
==31690==    by 0x1514BA: conf_files_list_strv (conf-files.c:135)
==31690==    by 0x13A1CF: link_config_load (link-config.c:227)
==31690==    by 0x135B68: builtin_net_setup_link_init
(udev-builtin-net_setup_link.c:77)
==31690==    by 0x1306B3: udev_builtin_init (udev-builtin.c:57)
==31690==    by 0x11E984: adm_builtin (udevadm-test-builtin.c:72)
==31690==    by 0x117B4D: run_command (udevadm.c:75)
```
Fixes #4080

8 years agoshell-completion: add systemd-resolve --status (#4085)
Marcos Mello [Fri, 2 Sep 2016 10:18:11 +0000 (07:18 -0300)]
shell-completion: add systemd-resolve --status (#4085)

From be371fe.

8 years agoMerge pull request #4075 from Noeljunior/master
Peter Hutterer [Thu, 1 Sep 2016 09:07:49 +0000 (19:07 +1000)]
Merge pull request #4075 from Noeljunior/master

hwdb: add axis corrections for the Lenovo Yoga 500-14ISK touchpad

8 years agosystemctl: usable status command for special units (#4072)
Cireo [Thu, 1 Sep 2016 09:04:36 +0000 (02:04 -0700)]
systemctl: usable status command for special units (#4072)

Prior to this commit, users could be given an unusable command to run if
they attempted to stop or start special services.  For example:

    $ systemctl stop -- -.mount
    Failed to stop -.mount: Operation refused, unit -.mount may be \
        requested by dependency only.
    See system logs and 'systemctl status -.mount' for details.

    $ systemctl status -.mount
    systemctl: invalid option -- '.'

This adds a '--' to the example command in these situations.

8 years agoMerge pull request #4071 from poettering/some-fixes-3
Martin Pitt [Thu, 1 Sep 2016 06:30:12 +0000 (08:30 +0200)]
Merge pull request #4071 from poettering/some-fixes-3

three trivial fixes

8 years agohwdb: add axis range corrections for Lenovo L430 (#4074)
Peter Hutterer [Thu, 1 Sep 2016 06:29:13 +0000 (16:29 +1000)]
hwdb: add axis range corrections for Lenovo L430 (#4074)

https://bugs.freedesktop.org/show_bug.cgi?id=96220

8 years agohwdb: add axis corrections for the Lenovo Yoga 500-14ISK touchpad
Noeljunior [Thu, 1 Sep 2016 02:02:10 +0000 (03:02 +0100)]
hwdb: add axis corrections for the Lenovo Yoga 500-14ISK touchpad

8 years agohostnamed: prefer more precise DMI info over ACPI OSPM info
Lennart Poettering [Wed, 31 Aug 2016 18:23:19 +0000 (20:23 +0200)]
hostnamed: prefer more precise DMI info over ACPI OSPM info

(also: add comments about the used numbers)

Fixes: #3930

8 years agoresolved: include d.f.ip6.arpa in default NTA list
Lennart Poettering [Wed, 31 Aug 2016 18:12:11 +0000 (20:12 +0200)]
resolved: include d.f.ip6.arpa in default NTA list

Fixes: #4049

8 years agosd-bus: bump message queue size
Lennart Poettering [Wed, 31 Aug 2016 18:09:31 +0000 (20:09 +0200)]
sd-bus: bump message queue size

Let's bump it further, as this the current limit turns out to be problematic
IRL. Let's bump it to more than twice what we know of is needed.

Fixes: #4068

8 years agomachinectl: split OS field in two; print ip addresses (#4058)
Seraphime Kirkovski [Wed, 31 Aug 2016 18:06:57 +0000 (21:06 +0300)]
machinectl: split OS field in two; print ip addresses (#4058)

This splits the OS field in two : one for the distribution name
and one for the the version id.
Dashes are written for missing fields.
This also prints ip addresses of known machines. The `--max-addresses`
option specifies how much ip addresses we want to see. The default is 1.
When more than one address is written for a machine, a `,` follows it.
If there are more ips than `--max-addresses`, `...` follows the last
address.

8 years agonetworkd: add options to bridge (#4051)
Tobias Jungel [Wed, 31 Aug 2016 18:06:23 +0000 (20:06 +0200)]
networkd: add options to bridge (#4051)

This patch allows to configure AgeingTimeSec, Priority and DefaultPVID for
bridge interfaces.

8 years agoinstall: fix disable when /etc/systemd/system is a symlink (#4063)
Lennart Poettering [Wed, 31 Aug 2016 11:02:02 +0000 (13:02 +0200)]
install: fix disable when /etc/systemd/system is a symlink (#4063)

8 years agonetworkd: do not drop config for unmanaged interfaces (#4033)
Lennart Poettering [Wed, 31 Aug 2016 10:36:55 +0000 (12:36 +0200)]
networkd: do not drop config for unmanaged interfaces (#4033)

Flushing foreign configuration for unmanaged interfaces is outright
evil, especially when it's a regular occurence with Wi-Fi.

Fixes: 3104883ddc24 "networkd: remove route if carrier is lost"
Ref: #3831

8 years agohwdb: 60-keyboard: remove line causing a syntax error (#3999)
Lennart Poettering [Wed, 31 Aug 2016 10:29:51 +0000 (12:29 +0200)]
hwdb: 60-keyboard: remove line causing a syntax error (#3999)

8 years agocore: introduce MemorySwapMax= (#3659)
Lennart Poettering [Wed, 31 Aug 2016 10:28:54 +0000 (12:28 +0200)]
core: introduce MemorySwapMax= (#3659)

Similar to MemoryMax=, MemorySwapMax= limits swap usage. This controls
controls "memory.swap.max" attribute in unified cgroup.

8 years agolink : add support to configure LRO and GRO Offload features (#4064)
Lennart Poettering [Wed, 31 Aug 2016 10:13:08 +0000 (12:13 +0200)]
link : add support to configure LRO and GRO Offload features (#4064)

The patch supports to configure

GenericReceiveOffload
LargeReceiveOffload

8 years agoload-fragment: Resolve specifiers in OnCalendar and On*Sec (#4045)
Lennart Poettering [Wed, 31 Aug 2016 10:07:39 +0000 (12:07 +0200)]
load-fragment: Resolve specifiers in OnCalendar and On*Sec (#4045)

Resolves #3534

8 years agolink : add support to configure LRO and GRO Offload features
Susant Sahani [Wed, 31 Aug 2016 07:17:02 +0000 (12:47 +0530)]
link : add support to configure LRO and GRO Offload features

The patch supports to configure

GenericReceiveOffload
LargeReceiveOffload

8 years agolink : add support to configure Offload features (#4017)
Susant Sahani [Tue, 30 Aug 2016 14:52:04 +0000 (20:22 +0530)]
link : add support to configure Offload features (#4017)

This patch supports these features to be on or off

Generic Segmentation Offload
TCP Segmentation Offload
UDP Segmentation Offload

fixes #432

8 years agobootctl: properly skip duplicate entries (#4048)
Mantas Mikulėnas [Tue, 30 Aug 2016 14:50:19 +0000 (17:50 +0300)]
bootctl: properly skip duplicate entries (#4048)

'continue' is a fancy no-op here – it only skips through the inner loop,
not the outer one, so entries already in BootOrder get printed twice.

This partially reverts f939cff71577 "bootctl: various coding style
updates".

8 years agoMerge pull request #4053 from brulon/force-unmount
Lennart Poettering [Tue, 30 Aug 2016 14:44:51 +0000 (16:44 +0200)]
Merge pull request #4053 from brulon/force-unmount

add ForceUnmount= setting for mount units

8 years agoinstall: fix disable when /etc/systemd/system is a symlink
Lukas Nykryn [Tue, 30 Aug 2016 13:04:07 +0000 (15:04 +0200)]
install: fix disable when /etc/systemd/system is a symlink

8 years agoMerge pull request #4052 from yann-morin-1998/yem/o-tmpfile
Lennart Poettering [Tue, 30 Aug 2016 07:47:25 +0000 (09:47 +0200)]
Merge pull request #4052 from yann-morin-1998/yem/o-tmpfile

importd: fix build failure with missing O_TMPFILE (branch yem/o-tmpfile)

8 years agoMerge pull request #4054 from yuwata/man-fix
Martin Pitt [Tue, 30 Aug 2016 04:27:04 +0000 (06:27 +0200)]
Merge pull request #4054 from yuwata/man-fix

man page fixes

8 years agocore: introduce MemorySwapMax=
WaLyong Cho [Mon, 4 Jul 2016 07:03:54 +0000 (07:03 +0000)]
core: introduce MemorySwapMax=

Similar to MemoryMax=, MemorySwapMax= limits swap usage. This controls
controls "memory.swap.max" attribute in unified cgroup.

8 years agobasic/fileio: we always have O_TMPFILE now
Yann E. MORIN [Mon, 29 Aug 2016 10:34:50 +0000 (12:34 +0200)]
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.

8 years agomissing.h: add missing definitions for __O_TMPFILE
Yann E. MORIN [Sun, 28 Aug 2016 15:26:42 +0000 (17:26 +0200)]
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.

8 years agoimportd/export-raw: needs missing.h for O_TMPFILE
Yann E. MORIN [Sun, 28 Aug 2016 14:26:04 +0000 (16:26 +0200)]
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

8 years agoman: systemd-journal-remote: do not use ulink tags for example addresses
Yu Watanabe [Mon, 29 Aug 2016 06:59:18 +0000 (15:59 +0900)]
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.

8 years agoman: systemd.mount: DefaultTimeoutStart -> DefaultTimeoutStartSec
Yu Watanabe [Mon, 29 Aug 2016 02:02:36 +0000 (11:02 +0900)]
man: systemd.mount: DefaultTimeoutStart -> DefaultTimeoutStartSec

8 years agoMerge pull request #4046 from pilophae/ideapad500isk
Peter Hutterer [Mon, 29 Aug 2016 01:37:01 +0000 (11:37 +1000)]
Merge pull request #4046 from pilophae/ideapad500isk

hwdb: add axis range corrections for Lenovo Ideapad 500S-13ISK

8 years agohwdb: 60-keyboard: remove line causing a syntax error
Mantas Mikulėnas [Fri, 19 Aug 2016 18:33:28 +0000 (21:33 +0300)]
hwdb: 60-keyboard: remove line causing a syntax error

8 years agomount: add SloppyOptions= to mount_dump()
Barron Rulon [Sat, 27 Aug 2016 14:42:05 +0000 (10:42 -0400)]
mount: add SloppyOptions= to mount_dump()

8 years agomount: add new ForceUnmount= setting for mount units, mapping to umount(8)'s "-f...
Barron Rulon [Sat, 27 Aug 2016 14:27:49 +0000 (10:27 -0400)]
mount: add new ForceUnmount= setting for mount units, mapping to umount(8)'s "-f" switch

8 years agohwdb: add axis range corrections for Lenovo Ideapad 500S-13ISK
Erik Karlsson [Wed, 24 Aug 2016 18:18:22 +0000 (20:18 +0200)]
hwdb: add axis range corrections for Lenovo Ideapad 500S-13ISK

8 years agoload-fragment: Resolve specifiers in OnCalendar and On*Sec
Douglas Christman [Fri, 26 Aug 2016 16:13:16 +0000 (12:13 -0400)]
load-fragment: Resolve specifiers in OnCalendar and On*Sec

Resolves #3534

8 years agomount: add new LazyUnmount= setting for mount units, mapping to umount(8)'s "-l"...
brulon [Fri, 26 Aug 2016 15:57:22 +0000 (11:57 -0400)]
mount: add new LazyUnmount= setting for mount units, mapping to umount(8)'s "-l" switch (#3827)

8 years agojournal: add/use flushed_flag_is_set() helper (#4041)
Vito Caputo [Fri, 26 Aug 2016 15:51:13 +0000 (08:51 -0700)]
journal: add/use flushed_flag_is_set() helper (#4041)

Minor cleanup suggested by Lennart.

8 years agotests: mount proc before `exec valgrind` (#4044)
Evgeny Vereshchagin [Fri, 26 Aug 2016 15:49:56 +0000 (18:49 +0300)]
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

8 years agoMerge pull request #3984 from poettering/refcnt
Evgeny Vereshchagin [Fri, 26 Aug 2016 13:17:05 +0000 (16:17 +0300)]
Merge pull request #3984 from poettering/refcnt

permit bus clients to pin units to avoid automatic GC

8 years agonspawn: split down SYSTEMD_NSPAWN_SHARE_SYSTEM (#4023)
Luca Bruno [Thu, 25 Aug 2016 22:08:26 +0000 (22:08 +0000)]
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.

8 years agounits: remove udev control socket when systemd stops the socket unit (#4039)
Michal Sekletar [Thu, 25 Aug 2016 22:07:58 +0000 (00:07 +0200)]
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

8 years agojournal: implicitly flush to var on recovery (#4028)
Vito Caputo [Thu, 25 Aug 2016 15:37:57 +0000 (08:37 -0700)]
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.

8 years agonetworkd: do not drop config for unmanaged interfaces
Mantas Mikulėnas [Wed, 24 Aug 2016 15:26:48 +0000 (18:26 +0300)]
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: 3104883ddc24 "networkd: remove route if carrier is lost"
Ref: #3831

8 years agoudev: inform systemd how many workers we can potentially spawn (#4036)
Michal Sekletar [Thu, 25 Aug 2016 06:18:42 +0000 (08:18 +0200)]
udev: inform systemd how many workers we can potentially spawn (#4036)

8 years agodocs: add --with-support-url= to distribution porting guide. (#4035)
Stefan [Wed, 24 Aug 2016 18:49:53 +0000 (20:49 +0200)]
docs: add --with-support-url= to distribution porting guide. (#4035)

8 years agorun: respect quiet when starting timer (#4029)
Nick Owens [Wed, 24 Aug 2016 10:12:18 +0000 (03:12 -0700)]
run: respect quiet when starting timer (#4029)

8 years agohwdb: add axis ranges for the MacBook 4,1 (#4030)
Peter Hutterer [Wed, 24 Aug 2016 10:11:48 +0000 (20:11 +1000)]
hwdb: add axis ranges for the MacBook 4,1 (#4030)

https://bugzilla.redhat.com/show_bug.cgi?id=1357990

8 years agoUpdated Hungarian translation (#4026)
Balázs Úr [Tue, 23 Aug 2016 18:08:35 +0000 (20:08 +0200)]
Updated Hungarian translation (#4026)

8 years agocore,network: Use const qualifiers for block-local variables in macro functions ...
Felipe Sateler [Tue, 23 Aug 2016 09:29:30 +0000 (06:29 -0300)]
core,network: Use const qualifiers for block-local variables in macro functions (#4019)

Prevents discard-qualifiers warnings when the passed variable was const

8 years agocore: do not fail at step SECCOMP if there is no kernel support (#4004)
Felipe Sateler [Mon, 22 Aug 2016 19:40:58 +0000 (16:40 -0300)]
core: do not fail at step SECCOMP if there is no kernel support (#4004)

Fixes #3882

8 years agobus-util: turn on exit-on-disconnect for all command line tools
Lennart Poettering [Mon, 22 Aug 2016 15:21:27 +0000 (17:21 +0200)]
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.

8 years agosd-bus: optionally, exit process or event loop on disconnect
Lennart Poettering [Mon, 22 Aug 2016 15:19:12 +0000 (17:19 +0200)]
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.

8 years agoupdate TODO
Lennart Poettering [Mon, 15 Aug 2016 12:48:14 +0000 (14:48 +0200)]
update TODO

8 years agosd-bus: add a small test case for sd_bus_track
Lennart Poettering [Mon, 22 Aug 2016 14:13:19 +0000 (16:13 +0200)]
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.

8 years agosd-bus: when the server-side disconnects, make sure to dispatch all tracking objects...
Lennart Poettering [Mon, 22 Aug 2016 14:11:54 +0000 (16:11 +0200)]
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.

8 years agosd-bus: ensure we don't dispatch track objects while we are adding names to them
Lennart Poettering [Mon, 22 Aug 2016 14:09:15 +0000 (16:09 +0200)]
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.

8 years agosd-bus: split out handling of reply callbacks on close into its own function
Lennart Poettering [Mon, 22 Aug 2016 12:45:34 +0000 (14:45 +0200)]
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.

8 years agocore: let's use set_contains() where appropriate
Lennart Poettering [Fri, 19 Aug 2016 17:30:06 +0000 (19:30 +0200)]
core: let's use set_contains() where appropriate

8 years agoman: document the new --wait switch of systemd-run
Lennart Poettering [Thu, 18 Aug 2016 19:53:38 +0000 (21:53 +0200)]
man: document the new --wait switch of systemd-run

Also, make major improvements to the an page in general.

8 years agorun: optionally, wait for the service to finish and show its result
Lennart Poettering [Wed, 17 Aug 2016 12:24:17 +0000 (14:24 +0200)]
run: optionally, wait for the service to finish and show its result

8 years agocore: cache last CPU usage counter, before destorying a cgroup
Lennart Poettering [Thu, 18 Aug 2016 18:58:10 +0000 (20:58 +0200)]
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.

8 years agobus-util: make sure map_basic() returns EOPNOTSUPP if called for an unknown type
Lennart Poettering [Wed, 17 Aug 2016 17:04:35 +0000 (19:04 +0200)]
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.

8 years agobus-util: treat an empty string as a NULL
Lennart Poettering [Wed, 17 Aug 2016 17:03:44 +0000 (19:03 +0200)]
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.

8 years agobus-util: support mapping signed integers with bus_map_properties()
Lennart Poettering [Wed, 17 Aug 2016 17:00:12 +0000 (19:00 +0200)]
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.

8 years agocore: add Ref()/Unref() bus calls for units
Lennart Poettering [Mon, 15 Aug 2016 16:12:01 +0000 (18:12 +0200)]
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).

8 years agoman: document sd_bus_track objects
Lennart Poettering [Mon, 15 Aug 2016 12:59:59 +0000 (14:59 +0200)]
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.

8 years agosd-bus: add a "recursive" mode to sd_bus_track
Lennart Poettering [Mon, 15 Aug 2016 12:58:09 +0000 (14:58 +0200)]
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.

8 years agoman: don't claim arguments where const that actually are not
Lennart Poettering [Mon, 15 Aug 2016 12:57:29 +0000 (14:57 +0200)]
man: don't claim arguments where const that actually are not

8 years agoseccomp: make sure getrlimit() is among the default permitted syscalls
Lennart Poettering [Wed, 17 Aug 2016 15:53:25 +0000 (17:53 +0200)]
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

8 years agomount-tool: return 0 instead of NULL in the acquire_description() (#4009)
0xAX [Mon, 22 Aug 2016 06:14:23 +0000 (09:14 +0300)]
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.

8 years agohwdb: provide axis ranges for the Dell XPS M1530 (#4016)
Peter Hutterer [Sun, 21 Aug 2016 23:31:25 +0000 (09:31 +1000)]
hwdb: provide axis ranges for the Dell XPS M1530 (#4016)

https://bugs.freedesktop.org/show_bug.cgi?id=97433

8 years agonetworkd: fix typo (#4013)
Zbigniew Jędrzejewski-Szmek [Sun, 21 Aug 2016 17:15:26 +0000 (13:15 -0400)]
networkd: fix typo (#4013)

8 years agoshared/install: do not enable masked instances (#4005)
Zbigniew Jędrzejewski-Szmek [Sun, 21 Aug 2016 13:10:51 +0000 (09:10 -0400)]
shared/install: do not enable masked instances (#4005)

When told to enable a template unit, and the DefaultInstance specified in that
unit was masked, we would do this. Such a unit cannot be started or loaded, so
reporting successful enabling is misleading and unexpected.

$ systemctl mask getty@tty1
Created symlink /etc/systemd/system/getty@tty1.service → /dev/null.
$ systemctl --root=/ enable getty@tty1
(unchanged)
Failed to enable unit, unit /etc/systemd/system/getty@tty1.service is masked.

$ systemctl --root=/ enable getty@
(before)
Created symlink /etc/systemd/system/getty.target.wants/getty@tty1.service → /usr/lib/systemd/system/getty@.service.
(now)
Failed to enable unit, unit /etc/systemd/system/getty@tty1.service is masked.

The same error is emitted for enable and preset. And an error is emmited, not a
warning, so the failure to enable DefaultInstance is treated the same as if the
instance was specified on the command line. I think that this makes most sense,
for most template units.

Fixes #2513.

8 years agonetworkd: limit the number of routes to the kernel limit (#4007)
Zbigniew Jędrzejewski-Szmek [Sun, 21 Aug 2016 13:06:28 +0000 (09:06 -0400)]
networkd: limit the number of routes to the kernel limit (#4007)

Fixes #3922.

8 years agomachinectl: print OS release in `machinectl list` (#3975)
Seraphime [Sun, 21 Aug 2016 03:39:07 +0000 (05:39 +0200)]
machinectl: print OS release in `machinectl list` (#3975)

8 years agoMerge pull request #4001 from clintonroy/master
Ronny Chevalier [Sat, 20 Aug 2016 09:42:24 +0000 (11:42 +0200)]
Merge pull request #4001 from clintonroy/master

systemctl: kill all units specified on the command line, not just the…

8 years agoMerge pull request #3965 from htejun/systemd-controller-on-unified
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2016 23:00:25 +0000 (19:00 -0400)]
Merge pull request #3965 from htejun/systemd-controller-on-unified

8 years agosystemctl: kill all units specified on the command line, not just the first one.
Clinton Roy [Fri, 19 Aug 2016 22:59:02 +0000 (08:59 +1000)]
systemctl: kill all units specified on the command line, not just the first one.

8 years agoterminal-util: remove unnecessary check of result of isatty() (#4000)
0xAX [Fri, 19 Aug 2016 22:51:54 +0000 (01:51 +0300)]
terminal-util: remove unnecessary check of result of isatty() (#4000)

After the call of the isatty() we check its result twice in the
open_terminal(). There are no sense to check result of isatty() that
it is less than zero and return -errno, because as described in
documentation:

isatty() returns 1 if fd is an open file descriptor referring to a
terminal;  otherwise 0 is returned, and errno is set to indicate the
error.

So it can't be less than zero.

8 years agoMerge pull request #3909 from poettering/mount-tool
Evgeny Vereshchagin [Fri, 19 Aug 2016 20:33:49 +0000 (23:33 +0300)]
Merge pull request #3909 from poettering/mount-tool

add a new tool for creating transient mount and automount units

8 years agoMerge pull request #3987 from keszybz/console-color-setup
Lennart Poettering [Fri, 19 Aug 2016 17:36:09 +0000 (19:36 +0200)]
Merge pull request #3987 from keszybz/console-color-setup

Rework console color setup

8 years agoMerge pull request #3955 from keszybz/fix-preset-all
Lennart Poettering [Fri, 19 Aug 2016 17:10:30 +0000 (19:10 +0200)]
Merge pull request #3955 from keszybz/fix-preset-all

Fix preset-all

8 years agoMerge pull request #3961 from keszybz/pr/3924
Lennart Poettering [Fri, 19 Aug 2016 17:08:41 +0000 (19:08 +0200)]
Merge pull request #3961 from keszybz/pr/3924

Add documentation to #3924

8 years agoman: document that "systemctl switch-root" tries hard to pass state across (#3995)
Lennart Poettering [Fri, 19 Aug 2016 16:16:28 +0000 (18:16 +0200)]
man: document that "systemctl switch-root" tries hard to pass state across (#3995)

As suggested:

https://github.com/systemd/systemd/pull/3958#issuecomment-240410958

Let's document that we try hard to pass system state from the initrd to the
host, and even compare the systemd binary paths.

8 years agoMerge pull request #3997 from poettering/codition-udev-fix
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2016 16:13:44 +0000 (12:13 -0400)]
Merge pull request #3997 from poettering/codition-udev-fix

Trivial fixes to udev and condition tests

8 years agoterminal-util: use getenv_bool for $SYSTEMD_COLORS
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2016 14:26:27 +0000 (10:26 -0400)]
terminal-util: use getenv_bool for $SYSTEMD_COLORS

This changes the semantics a bit: before, SYSTEMD_COLORS= would be treated as
"yes", same as SYSTEMD_COLORS=xxx and SYSTEMD_COLORS=1, and only
SYSTEMD_COLORS=0 would be treated as "no". Now, only valid booleans are treated
as "yes". This actually matches how $SYSTEMD_COLORS was announced in NEWS.

8 years agosystemd: ignore lack of tty when checking whether colors should be enabled
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2016 02:03:56 +0000 (22:03 -0400)]
systemd: ignore lack of tty when checking whether colors should be enabled

When started by the kernel, we are connected to the console, and we'll set TERM
properly to some value in fixup_environment(). We'll then enable or disable
colors based on the value of $SYSTEMD_COLORS and $TERM.

When reexecuting, TERM should be already set, so we can use this value.
Effectively, behaviour is the same as before affd7ed1a was reverted, but instead
of reopening the console before configuring color output, we just ignore what
stdout is connected to and decide based on the variables only.

8 years agoMerge pull request #3992 from poettering/hostname-fix2
Ronny Chevalier [Fri, 19 Aug 2016 14:46:49 +0000 (16:46 +0200)]
Merge pull request #3992 from poettering/hostname-fix2

some hostname fixes, triggered by #3979