platform/upstream/systemd.git
6 years agocoverity: don't use (void)0 under coverity
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 08:45:23 +0000 (09:45 +0100)]
coverity: don't use (void)0 under coverity

I'm not sure why this is needed, but apparrently coverity doesn't like
(void)0. With this change, coverity can (almost) build systemd:

CFLAGS='-D_Float128="long double"' meson cov-build -Dman=false && \
  CCACHE_DISABLE=1 COVERITY_UNSUPPORTED=1 cov-build --dir cov-int ninja -C cov-build

Patch originially by Marek Cermak <macermak@redhat.com>.

6 years agotest-routing-policy-rule: split out fd assignment from assert_se
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 12:27:51 +0000 (13:27 +0100)]
test-routing-policy-rule: split out fd assignment from assert_se

It's ugly that parentheses need to be used. Let's just split it out.
Incidentally, this will make coverity happy, because it doesn't grok
assert_se().

6 years agoip-address-access: let's exit the loop after invalidating our entry a (#7803)
Lennart Poettering [Thu, 4 Jan 2018 12:24:40 +0000 (13:24 +0100)]
ip-address-access: let's exit the loop after invalidating our entry a (#7803)

CID#1382967

6 years agomeson: don't search PATH for telinit (#7770)
Mike Gilbert [Thu, 4 Jan 2018 12:14:20 +0000 (07:14 -0500)]
meson: don't search PATH for telinit (#7770)

On a typical system running systemd, the telinit in PATH is very likely to be a symlink
to systemctl. Setting TELINIT to this may result in an infinite recursion if telinit is called
and sd_booted() == 0. This may commonly occur in a chroot environment.

Bug: https://bugs.gentoo.org/642724

[zj:
The path was originally hardcoded as "/lib/upstart/telinit", but was made configurable without
changing the default in 4ad61fd1806dde23d2c99043b4bed91a196d2c82. Then the default was
changed to `/lib/sysvinit/telinit` in abaaabf40a9891014ed4c402d7beb5a67ac256b1. Then it
started being  autodetected when meson support was added in
5c23128daba7236a6080383b2a5649033cfef85c. This patch restores the behaviour that was
implemented in configure.ac at the time of its removal.]

6 years agomain: don't bother with the return value of invoke_mainloop() (#7802)
Lennart Poettering [Thu, 4 Jan 2018 11:55:21 +0000 (12:55 +0100)]
main: don't bother with the return value of invoke_mainloop() (#7802)

We don't use the return value, and we don't have to, as the call already
initializes &ret, which is the one we return as exit code from the
process.

CID#1384230

6 years agoMerge pull request #7801 from keszybz/docs-and-coverity
Lennart Poettering [Thu, 4 Jan 2018 11:38:27 +0000 (12:38 +0100)]
Merge pull request #7801 from keszybz/docs-and-coverity

Docs and coverity

6 years agofix machinectl shell (in machined) (#7785)
Shawn Landden [Thu, 4 Jan 2018 11:37:15 +0000 (03:37 -0800)]
fix machinectl shell (in machined) (#7785)

4c253ed broke machined
$machinectl shell arch
Failed to get shell PTY: Input/output error

Closes: #7779

v2: do not drop DEATHSIG flag

6 years agocore: fix mac_selinux_setup return value check
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:29:36 +0000 (11:29 +0100)]
core: fix mac_selinux_setup return value check

Introduced in 74da609f0d0f9112047dd746188469df3692ad4a. CID #1384210.

6 years agocore: double free in bus_timer_set_transient_property
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:19:55 +0000 (11:19 +0100)]
core: double free in bus_timer_set_transient_property

Introduced in 3e3c5a4571d. CID #1384233.

6 years agorun: double free
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:12:57 +0000 (11:12 +0100)]
run: double free

Introduced in f2b9f2c83e5b4035b22eb2f610531fce275bf55f. CID #1384218.

6 years agotest-sizeof: also add uid_t
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 10:11:16 +0000 (11:11 +0100)]
test-sizeof: also add uid_t

We had gid_t, and pid_t, but not uid_t. Add for completeness.

6 years agoman: drop --arch from debootstrap invocation
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jan 2018 14:57:11 +0000 (15:57 +0100)]
man: drop --arch from debootstrap invocation

Nowadays people use systemd on many different architectures, so we
shouldn't presuppose that they are using amd64. debootstrap defaults
to the native architecture and this should be good enough.

6 years agodhcp6: Fix DHCPv6 client file descriptor and event handling (#7796)
Patrik Flykt [Thu, 4 Jan 2018 10:02:52 +0000 (12:02 +0200)]
dhcp6: Fix DHCPv6 client file descriptor and event handling (#7796)

Close DHCPv6 client socket file descriptor when
sd_dhcp6_client_stop() is called and not when client_reset() is
called. If left in client_reset(), any internal temporary stopping
of the DHCPv6 client with client_stop() will call client_reset()
after which the DHCPv6 client will not be able to receive any further
DHCPv6 messages.

Similarly, client_start() needs to enable events for the DHCPv6
socket file descriptor since a call to client_stop() will call
client_reset() which will remove it from the main loop. Events should
be turned off when no DHCPv6 messages are expected.

6 years agoREADME: EXT4_POSIX_ACL -> EXT4_FS_POSIX_ACL (#7799)
George G [Thu, 4 Jan 2018 07:53:44 +0000 (07:53 +0000)]
README: EXT4_POSIX_ACL -> EXT4_FS_POSIX_ACL (#7799)

EXT4_POSIX_ACL doesn't exist.

6 years agoMerge pull request #7793 from rojkov/fix-6456
Lennart Poettering [Wed, 3 Jan 2018 17:43:14 +0000 (18:43 +0100)]
Merge pull request #7793 from rojkov/fix-6456

resolved: fix refcounting DnsScope's conflict_queue

6 years agoMerge pull request #7759 from yuwata/dbus-api
Lennart Poettering [Wed, 3 Jan 2018 17:41:32 +0000 (18:41 +0100)]
Merge pull request #7759 from yuwata/dbus-api

DBus-API: add more options in transient units

6 years agoMerge pull request #7705 from keszybz/redo-linking
Lennart Poettering [Wed, 3 Jan 2018 17:37:00 +0000 (18:37 +0100)]
Merge pull request #7705 from keszybz/redo-linking

Redo linking

6 years agohwdb: Add accelerometer orientation entry for Teclast X98 Plus II tablet (#7766)
Paul Cercueil [Wed, 3 Jan 2018 14:54:06 +0000 (15:54 +0100)]
hwdb: Add accelerometer orientation entry for Teclast X98 Plus II tablet (#7766)

6 years agofix systemd-analyze time when default.target is not reached (#7764)
Boucman [Wed, 3 Jan 2018 14:52:13 +0000 (15:52 +0100)]
fix systemd-analyze time when default.target is not reached (#7764)

Also, better error messages.

6 years agoresolved: use DNS_ANSWER_FOREACH instead of for
Dmitry Rozhkov [Wed, 3 Jan 2018 13:00:27 +0000 (15:00 +0200)]
resolved: use DNS_ANSWER_FOREACH instead of for

6 years agoresolved: skip conflict notifications for DNS-SD PTR RRs
Dmitry Rozhkov [Wed, 3 Jan 2018 12:42:13 +0000 (14:42 +0200)]
resolved: skip conflict notifications for DNS-SD PTR RRs

Enumerating DNS-SD PTR resource records are a special case and
are supposed to have non-unique keys pointing to services of the
same type running on different hosts. There's no need for them
to be checked for conflicts.

Thus don't check for conflicts such RRs.

6 years agoresolved: fix refcounting DnsScope's conflict_queue
Dmitry Rozhkov [Wed, 3 Jan 2018 12:26:53 +0000 (14:26 +0200)]
resolved: fix refcounting DnsScope's conflict_queue

Refcounting for a RR's key is done separately from refcounting
for the RR itself, but in dns_scope_notify_conflict() we don't
do that. This may lead to a situation when a RR key put in the
conflict_queue hash as a value's key gets freed upon
cache reduction when it's still referenced by the hash.

Thus increase refcount for the key when putting it into the hash
and unreference it upon removing from the hash.

Closes #6456

6 years agomeson: add a single .h file to shared libs with no sources
Zbigniew Jędrzejewski-Szmek [Wed, 20 Dec 2017 08:12:08 +0000 (09:12 +0100)]
meson: add a single .h file to shared libs with no sources

Otherwise stuff doesn't build on old Ubuntu with meson-0.42.1-1~xenial.

6 years agomeson: use a convenience lib for shared resolve files
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 21:46:01 +0000 (22:46 +0100)]
meson: use a convenience lib for shared resolve files

This reduces the man=false meson target count from 1281 to 1253.

--

A fully scientific test:
  git grep _sources, :/*.build|cut -d: -f2|tr -d ' '|sort|uniq -c
reveals that libudev_sources is the only source list now reused twice.  There's
some ugly circular dependency between libudev and libshared, and anyway I'm not
sure if we don't want to use different compilation options (LOG_REALM_…) in
those two cases, so I'm leaving that alone for now.

6 years agomeson: rename libudev_internal to libudev_static and link into libudev
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 19:54:46 +0000 (20:54 +0100)]
meson: rename libudev_internal to libudev_static and link into libudev

This reduces the meson man=false target count to 1281.

v2:
- link test-engine with libshared instead of libsystemd_static
Previous version built fine on F27, but fails on F26 with the following error:
/usr/bin/ld: /tmp/ccr8HRGw.ltrans6.ltrans.o: undefined reference to symbol '__start_BUS_ERROR_MAP@@SD_SHARED'
/home/zbyszek/fedora/systemd/systemd-9d5aae75c64f5583a110f03b94816aacc03bbf4d/x86_64-redhat-linux-gnu/src/shared/libsystemd-shared-236.so: error adding symbols: DSO missing from command line

v3:
- add libudev_basic

6 years agomeson: use a convenience lib for journal user sources
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 18:38:43 +0000 (19:38 +0100)]
meson: use a convenience lib for journal user sources

Instead of compiling those files twice, once for libsystemd and once for
libshared, compile once as a static archive and then link into both.
This reduce the meson target for man=no compile to 1291.

6 years agomeson: link libsystemd_static in libshared instead of recompiling
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 18:14:03 +0000 (19:14 +0100)]
meson: link libsystemd_static in libshared instead of recompiling

This is similar to the great-grandpa commit. This time the number
of meson targets compilation without man is reduced from 1347 to 1302.

6 years agoMove gcrypt-util to basic/
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 18:06:56 +0000 (19:06 +0100)]
Move gcrypt-util to basic/

We were including gcrypt-util.[ch] by hand in the few places where it
was used. Create a convenience library to avoid compiling the same
files multiple times.

v2:
- use a separate static library instead of mergin into libbasic

6 years agomeson: link libbasic and libshared_static into libshared
Zbigniew Jędrzejewski-Szmek [Tue, 19 Dec 2017 13:19:46 +0000 (14:19 +0100)]
meson: link libbasic and libshared_static into libshared

gcrypt_util_sources had to be moved because otherwise they appeared twice
in libshared.so halfproducts, causing an error.

-fvisibility=default is added to libbasic, libshared_static so that the symbols
appear properly in the exported symbol list in libshared.

The advantage is that files are not compiled twice. When configured with -Dman=false,
the ninja target list is reduced from 1588 to 1347 targets. The difference in compilation
time is small (<10%). I think this is because of -O0 and ccache and multiple cores, and
in different settings the compilation time could be reduced. The main advantage is that
errors and warnings are not reported twice.

6 years agodbus-cgroup: simplify bus_cgroup_set_property()
Yu Watanabe [Tue, 2 Jan 2018 17:30:16 +0000 (02:30 +0900)]
dbus-cgroup: simplify bus_cgroup_set_property()

6 years agodbus-cgroup: add missing space
Yu Watanabe [Tue, 2 Jan 2018 17:28:17 +0000 (02:28 +0900)]
dbus-cgroup: add missing space

6 years agodoc: update TRANSIENT-SETTINGS.md
Yu Watanabe [Fri, 29 Dec 2017 14:05:37 +0000 (23:05 +0900)]
doc: update TRANSIENT-SETTINGS.md

6 years agobus-unit-util: support more options set to transient unit
Yu Watanabe [Mon, 1 Jan 2018 17:11:26 +0000 (02:11 +0900)]
bus-unit-util: support more options set to transient unit

6 years agobus-unit-util: use struct __useless_struct_to_allow_trailing_semicolon__ in DEFINE_BU...
Yu Watanabe [Mon, 1 Jan 2018 15:50:19 +0000 (00:50 +0900)]
bus-unit-util: use struct __useless_struct_to_allow_trailing_semicolon__ in DEFINE_BUS_APPEND_PARSE{,_PTR} macro

6 years agodbus-path: add Paths= option to set path specs in transient path unit
Yu Watanabe [Mon, 1 Jan 2018 17:25:57 +0000 (02:25 +0900)]
dbus-path: add Paths= option to set path specs in transient path unit

6 years agodbus-service: expose *ExitStatus= settings on bus
Yu Watanabe [Tue, 2 Jan 2018 17:32:10 +0000 (02:32 +0900)]
dbus-service: expose *ExitStatus= settings on bus

6 years agobasic: detect_vm_cpuid: fix hypervisor detection
Mike Gilbert [Sat, 30 Dec 2017 17:48:20 +0000 (12:48 -0500)]
basic: detect_vm_cpuid: fix hypervisor detection

The __get_cpuid() function only calls __cpuid() if __get_cpuid_max()
returns a value that is less than or equal to the leaf value.

In QEMU/KVM, I found that the special hypervisor leaf value (0x40000000U)
is always larger than the value retured by __get_cpuid_max().

Avoid this problem by calling the __cpuid() macro directly once we have
checked the hypervisor bit from leaf 1.

Fixes: d31b0033b7743393562a2e9d3c1e74afea981c13

6 years agodbus-service: support more options in transient service unit
Yu Watanabe [Mon, 1 Jan 2018 16:40:06 +0000 (01:40 +0900)]
dbus-service: support more options in transient service unit

6 years agodbus-socket: simplify bus_socket_set_transient_property()
Yu Watanabe [Mon, 1 Jan 2018 17:25:04 +0000 (02:25 +0900)]
dbus-socket: simplify bus_socket_set_transient_property()

6 years agodbus-execute: simplify bus_exec_context_set_transient_property()
Yu Watanabe [Mon, 1 Jan 2018 15:55:44 +0000 (00:55 +0900)]
dbus-execute: simplify bus_exec_context_set_transient_property()

6 years agocore: rename bus_exec_command_set_transient_property() to bus_set_transient_exec_comm...
Yu Watanabe [Fri, 29 Dec 2017 08:23:25 +0000 (17:23 +0900)]
core: rename bus_exec_command_set_transient_property() to bus_set_transient_exec_command()

6 years agodbus-unit: support more options in transient units
Yu Watanabe [Mon, 1 Jan 2018 15:26:34 +0000 (00:26 +0900)]
dbus-unit: support more options in transient units

6 years agocore: rename dbus property StartLimitIntervalSec= to StartLimitIntervalUSec=
Yu Watanabe [Fri, 29 Dec 2017 08:13:23 +0000 (17:13 +0900)]
core: rename dbus property StartLimitIntervalSec= to StartLimitIntervalUSec=

StartLimitIntervalSec= and DefaultStartLimitIntervalSec= are the
last options whose suffix is 'Sec' instead of 'USec'.
All the other option has suffix 'USec'. So, let's rename them.

6 years agonsflags: add namespace_flag_to_string_many_with_check()
Yu Watanabe [Fri, 29 Dec 2017 08:11:42 +0000 (17:11 +0900)]
nsflags: add namespace_flag_to_string_many_with_check()

The function will be used in later commits.

6 years agodbus-timer: add TimersMonotonic= and TimersCalendar= to set timer in transient timer...
Yu Watanabe [Fri, 29 Dec 2017 08:09:53 +0000 (17:09 +0900)]
dbus-timer: add TimersMonotonic= and TimersCalendar= to set timer in transient timer unit

This also obsoletes OnActiveSec= or their friends

6 years agodbus-scope: simplify bus_scope_set_transient_property()
Yu Watanabe [Fri, 29 Dec 2017 08:08:22 +0000 (17:08 +0900)]
dbus-scope: simplify bus_scope_set_transient_property()

6 years agodbus-kill: simplify bus_kill_context_set_transient_property()
Yu Watanabe [Fri, 29 Dec 2017 08:07:44 +0000 (17:07 +0900)]
dbus-kill: simplify bus_kill_context_set_transient_property()

6 years agodbus-mount: support more options in transient mount unit
Yu Watanabe [Fri, 29 Dec 2017 08:06:46 +0000 (17:06 +0900)]
dbus-mount: support more options in transient mount unit

6 years agodbus-automount: support more options in transient automount unit
Yu Watanabe [Fri, 29 Dec 2017 08:05:56 +0000 (17:05 +0900)]
dbus-automount: support more options in transient automount unit

6 years agocondition: introduce condition_takes_path()
Yu Watanabe [Fri, 29 Dec 2017 08:04:23 +0000 (17:04 +0900)]
condition: introduce condition_takes_path()

The function will be used in later commits.

6 years agobasic: introduce *_to_string_with_check() functions
Yu Watanabe [Fri, 29 Dec 2017 08:03:54 +0000 (17:03 +0900)]
basic: introduce *_to_string_with_check() functions

They are used in later commits.

6 years agosocket-util: introduce parse_socket_address_bind_ipv6_only_or_bool()
Yu Watanabe [Mon, 1 Jan 2018 15:15:03 +0000 (00:15 +0900)]
socket-util: introduce parse_socket_address_bind_ipv6_only_or_bool()

6 years agoload-fragment: obsolete OnFailureIsolate=
Yu Watanabe [Fri, 29 Dec 2017 08:00:40 +0000 (17:00 +0900)]
load-fragment: obsolete OnFailureIsolate=

6 years agonamespace: introduce parse_protect_system()_or_bool
Yu Watanabe [Mon, 1 Jan 2018 15:10:22 +0000 (00:10 +0900)]
namespace: introduce parse_protect_system()_or_bool

6 years agonamespace: introduce parse_protect_home_or_bool()
Yu Watanabe [Mon, 1 Jan 2018 15:08:40 +0000 (00:08 +0900)]
namespace: introduce parse_protect_home_or_bool()

6 years agocore: add dbus-util.[ch] to simplify creating transient units
Yu Watanabe [Mon, 1 Jan 2018 17:22:36 +0000 (02:22 +0900)]
core: add dbus-util.[ch] to simplify creating transient units

The functions and macros introduced by them will be used in later commits.

6 years agoanalyze: fix prototype mismatch on libseccomp-less builds (#7768)
Lennart Poettering [Mon, 1 Jan 2018 04:24:41 +0000 (05:24 +0100)]
analyze: fix prototype mismatch on libseccomp-less builds (#7768)

This fixes a compiler warning that matters, if people build systemd
without libseccomp.

Follow-up for a6bcef29579409872735a2cfbf77d1c61ea91332

6 years agomkosi: use libidn2 on Arch (#7751)
Tomasz Bachorski [Sat, 30 Dec 2017 11:23:24 +0000 (12:23 +0100)]
mkosi: use libidn2 on Arch (#7751)

Since libidn2 is now available in Arch official repositories, let's use
it instead of libidn.

6 years agoMerge pull request #7755 from floppym/fileio-error
Lennart Poettering [Sat, 30 Dec 2017 11:21:53 +0000 (12:21 +0100)]
Merge pull request #7755 from floppym/fileio-error

fileio: write_string_stream_ts: return errors from fputs and fputc

6 years agosysctl: use raw file descriptor in sysctl_write (#7753)
Mike Gilbert [Sat, 30 Dec 2017 11:16:49 +0000 (06:16 -0500)]
sysctl: use raw file descriptor in sysctl_write (#7753)

The kernel returns specific error codes which may be lost if we use the
libc buffered io functions.

Fixes: https://github.com/systemd/systemd/issues/7744

6 years agobasic: detect_vm_cpuid: use gcc's __get_cpuid() function (#7758)
Mike Gilbert [Fri, 29 Dec 2017 18:30:38 +0000 (13:30 -0500)]
basic: detect_vm_cpuid: use gcc's __get_cpuid() function (#7758)

The __get_cpuid() function includes a safety check to ensure that
executing the cpuid instruction is valid/safe.

This method also works with clang.

https://lists.freedesktop.org/archives/systemd-devel/2017-December/040054.html

6 years agonetworkd: Tunnel allows tunnel traffic on ip6tnl devices (#7756)
Susant Sahani [Fri, 29 Dec 2017 14:19:21 +0000 (19:49 +0530)]
networkd: Tunnel allows tunnel traffic on ip6tnl devices (#7756)

where the remote endpoint is a local host address.

6 years agonetworkd: allow to configure default/initial send/recv congestion window and store...
Susant Sahani [Fri, 29 Dec 2017 14:18:05 +0000 (19:48 +0530)]
networkd: allow to configure default/initial send/recv congestion window and store persistentl (#7750)

Currently we can only change initcwnd/initrwnd in the following way, and it does not store persistently:
sudo ip route change default via 192.168.1.1 dev tun0 initcwnd 20
sudo ip route change default via 192.168.1.1 dev tun0 initrwnd 20

For more details about initcwnd/initrwnd, please look at:
http://hjzhao.blogspot.com/2012/05/increase-initcwnd-for-performance.html
http://www.cdnplanet.com/blog/tune-tcp-initcwnd-for-optimum-performance
or google 'initcwnd initrwnd'

This work allows to configure the initcwnd and initrwnd.

Closes #2118

6 years agoMerge pull request #7745 from poettering/sockaddr-size
Yu Watanabe [Fri, 29 Dec 2017 14:13:53 +0000 (23:13 +0900)]
Merge pull request #7745 from poettering/sockaddr-size

mostly systemd-analyze fixes

6 years agofileio: write_string_stream_ts: check for file errors immediately
Mike Gilbert [Thu, 28 Dec 2017 15:03:47 +0000 (10:03 -0500)]
fileio: write_string_stream_ts: check for file errors immediately

6 years agofileio: write_string_stream_ts: return errors from fputs and fputc
Mike Gilbert [Thu, 28 Dec 2017 02:46:52 +0000 (21:46 -0500)]
fileio: write_string_stream_ts: return errors from fputs and fputc

Ignoring errors from these functions may mask errors returned by the
kernel.

Fixes: https://github.com/systemd/systemd/issues/7744

6 years agoman: remove empty paragraph
Yu Watanabe [Fri, 29 Dec 2017 07:55:31 +0000 (16:55 +0900)]
man: remove empty paragraph

6 years agocryptsetup: small if check improvement (#7747)
Lennart Poettering [Wed, 27 Dec 2017 11:43:31 +0000 (12:43 +0100)]
cryptsetup: small if check improvement (#7747)

It's a bit weird to test these strings after the fact instead of before.
Let's make sure that we don't even attempt the string escaping if the
strings are NULL.

Follow-up for #7688

6 years agoMerge pull request #7629 from poettering/condition-kernel-version
Lennart Poettering [Tue, 26 Dec 2017 19:48:58 +0000 (20:48 +0100)]
Merge pull request #7629 from poettering/condition-kernel-version

core,udev,networkd: add ConditionKernelVersion=

6 years agoman: systemd: fix typo (#7746)
nulsoh [Tue, 26 Dec 2017 19:45:06 +0000 (20:45 +0100)]
man: systemd: fix typo (#7746)

Add missing _r_ for ctl-alt-del.target

6 years agocondition: extend ConditionKernelVersion= with relative version checks
Lennart Poettering [Sat, 23 Dec 2017 14:02:58 +0000 (15:02 +0100)]
condition: extend ConditionKernelVersion= with relative version checks

Now that we have str_verscmp() in our source tree anyway, let's make it
generic and reuse it for ConditionKernelVersion=.

6 years agoAdd note about kernel version unportability
Zbigniew Jędrzejewski-Szmek [Fri, 15 Dec 2017 20:44:29 +0000 (21:44 +0100)]
Add note about kernel version unportability

6 years agocore,udev,networkd: add ConditionKernelVersion=
Lennart Poettering [Wed, 13 Dec 2017 19:34:13 +0000 (20:34 +0100)]
core,udev,networkd: add ConditionKernelVersion=

This adds a simple condition/assert/match to the service manager, to
udev's .link handling and to networkd, for matching the kernel version
string.

In this version we only do fnmatch() based globbing, but we might want
to extend that to version comparisons later on, if we like, by slightly
extending the syntax with ">=", "<=", ">", "<" and "==" expressions.

6 years agoMerge pull request #7728 from poettering/fork-rework
Yu Watanabe [Tue, 26 Dec 2017 16:32:46 +0000 (01:32 +0900)]
Merge pull request #7728 from poettering/fork-rework

some fork() reworking

6 years agoMerge pull request #7735 from poettering/rc-local-fix
Yu Watanabe [Tue, 26 Dec 2017 16:31:22 +0000 (01:31 +0900)]
Merge pull request #7735 from poettering/rc-local-fix

rc-local documentation

6 years agoman: further file-hierarchy *Directory= improvements
Lucas Werkmeister [Sat, 23 Dec 2017 21:33:46 +0000 (22:33 +0100)]
man: further file-hierarchy *Directory= improvements

Follow-up to @poettering’s comments in #7723:

- Slightly expand on the difference between using tmpfiles.d and service
  directives
- Mention CacheDirectory=
- Mention LogsDirectory=
- Abbreviate and unify some later descriptions

ConfigDirectory= is not mentioned, since it does not support the
functionality mentioned in the manpage which tmpfiles.d provides:
copying or symlinking default configuration from /usr/share/factory. And
the user package variable file locations don’t mention the directives
because in user units the service can always create the directories
itself (whereas in system units lesser-privileged services lack
permission to create them).

6 years agoupdate TODO
Lennart Poettering [Tue, 26 Dec 2017 15:02:10 +0000 (16:02 +0100)]
update TODO

6 years agoanalyze: correct help text where we take unit name arguments
Lennart Poettering [Tue, 26 Dec 2017 15:01:49 +0000 (16:01 +0100)]
analyze: correct help text where we take unit name arguments

6 years agoanalyze: fix indentation in one case
Lennart Poettering [Tue, 26 Dec 2017 15:01:43 +0000 (16:01 +0100)]
analyze: fix indentation in one case

6 years agoanalyze: add some logging to some error cases
Lennart Poettering [Tue, 26 Dec 2017 15:01:14 +0000 (16:01 +0100)]
analyze: add some logging to some error cases

6 years agoanalyze: arg_host can be "const char*", hence make it so.
Lennart Poettering [Tue, 26 Dec 2017 15:00:54 +0000 (16:00 +0100)]
analyze: arg_host can be "const char*", hence make it so.

6 years agoanalyze: port verb dispatching to verbs.[ch] API
Lennart Poettering [Tue, 26 Dec 2017 14:58:06 +0000 (15:58 +0100)]
analyze: port verb dispatching to verbs.[ch] API

Let's unify the code for parsing command line verbs, and reuse the
common verbs.[ch] API in systemd-analyze too.

This adds a couple of error messages when people pass too many
arguments. Moreover thus pushes bus allocation into the verb functions,
which corrects a couple of cases where we previously allocated a bus but
really didn't need to.

Other than that behaviour shouldn't really change.

6 years agosd-daemon: use sockaddr_port() helper
Lennart Poettering [Tue, 26 Dec 2017 12:36:07 +0000 (13:36 +0100)]
sd-daemon: use sockaddr_port() helper

6 years agosocket-util: clarify why sockaddr_port returns unsigned rather than uint16_t
Lennart Poettering [Tue, 26 Dec 2017 12:35:52 +0000 (13:35 +0100)]
socket-util: clarify why sockaddr_port returns unsigned rather than uint16_t

6 years agounits: link up debug-generator documentation from debug-shell.service
Lennart Poettering [Sun, 24 Dec 2017 15:51:45 +0000 (16:51 +0100)]
units: link up debug-generator documentation from debug-shell.service

6 years agorc-local-generator: minor modernizations
Lennart Poettering [Sun, 24 Dec 2017 15:51:28 +0000 (16:51 +0100)]
rc-local-generator: minor modernizations

6 years agoman: add a systemd-rc-local-generator(8) man page
Lennart Poettering [Sun, 24 Dec 2017 15:50:19 +0000 (16:50 +0100)]
man: add a systemd-rc-local-generator(8) man page

Most importantly, let's highlight the differences to the rc-local
behaviour in SysV.

Fixes: #7703

6 years agobootspec: drop ".conf" from BootEntry.filename
Yu Watanabe [Tue, 26 Dec 2017 00:35:35 +0000 (09:35 +0900)]
bootspec: drop ".conf" from BootEntry.filename

The boot loader systemd-boot removes ".conf" from file name of entry
configs, and determine which entry is the default entry.
However, bootspec, which is used by systemctl and bootctl did not
remove ".conf", then sometimes bootctl marks wrong entry as default.
This fixes the logic to choose the default entry in bootspec, to
match the logic used in systemd-boot boot loader.

Fixes #7727.

6 years agoseparate flags from shebang
bleep_blop [Sun, 24 Dec 2017 06:53:20 +0000 (06:53 +0000)]
separate flags from shebang

6 years agosd-boot, udev: trivial condition simplifications
Yu Watanabe [Mon, 25 Dec 2017 04:38:49 +0000 (13:38 +0900)]
sd-boot, udev: trivial condition simplifications

Reported and proposed by @dcb314.

Fixes #7656 and #7657.

6 years agoMerge pull request #7742 from poettering/meson-syscall
Lennart Poettering [Mon, 25 Dec 2017 16:21:59 +0000 (17:21 +0100)]
Merge pull request #7742 from poettering/meson-syscall

Meson syscall

6 years agomeson: hopefully renameat2() will show up where renameat() is defined
Lennart Poettering [Mon, 25 Dec 2017 11:35:43 +0000 (12:35 +0100)]
meson: hopefully renameat2() will show up where renameat() is defined

Should glibc add this eventually, let's try to be smart where to look
for it.

6 years agomeson: look for gettid() definition where getpid() is defined
Lennart Poettering [Mon, 25 Dec 2017 11:35:28 +0000 (12:35 +0100)]
meson: look for gettid() definition where getpid() is defined

Hopefully, should gettid() show up one day in glibc it'll show up where
getpid() is defined too.

6 years agomeson: when pivot_root() is added one day, look for it in <unistd.h>
Lennart Poettering [Mon, 25 Dec 2017 11:07:40 +0000 (12:07 +0100)]
meson: when pivot_root() is added one day, look for it in <unistd.h>

We of course don't know in which header glibc will export pivot_root()
and if it ever will. But there's a good chance they'll place it where
chroot() is located, given the similarity in the operations, hence let's
try our luck and look for it at the same place.

If we are lucky this means we don't have to patch our code if glibc
decides to expose the call one day.

6 years agomeson: use "args" for setting _GNU_SOURCE when checking for functions
Lennart Poettering [Mon, 25 Dec 2017 11:01:14 +0000 (12:01 +0100)]
meson: use "args" for setting _GNU_SOURCE when checking for functions

This reworks how we set _GNU_SOURCE when checking for the availability
of functions:

1. We set it for most of the functions we look for. After all we set it
for our entire built anyway, and it's usually how Linux-specific
definitions in glibc are protected these days. Given that we usually
have checks for such modern stuff only anyway, let's just blanket enable
it.

2. Use "args" instead of "prefix" to set the macro. This is what is
suggested in the meson docs, hence let's do it.

6 years agoupdate TODO
Lennart Poettering [Fri, 22 Dec 2017 14:28:17 +0000 (15:28 +0100)]
update TODO

6 years agoprocess-util: debug log if PR_SET_NAME fails.
Lennart Poettering [Sun, 24 Dec 2017 17:50:17 +0000 (18:50 +0100)]
process-util: debug log if PR_SET_NAME fails.

6 years agoprocess-util: allow rename_process() only in the main thread
Lennart Poettering [Sun, 24 Dec 2017 17:48:49 +0000 (18:48 +0100)]
process-util: allow rename_process() only in the main thread

We make assumptions about the comm name we set via PR_SET_NAME: that it
would reflect the process name, but that's only the case for the main
thread. Moreover, we cache the mmap() region without locking.

Let's hence be safe rather than sorry and support all this only in the
main thread.

6 years agobasic: split out blockdev-util.[ch] from util.h
Lennart Poettering [Fri, 22 Dec 2017 14:22:59 +0000 (15:22 +0100)]
basic: split out blockdev-util.[ch] from util.h

With three functions it makes sense to split this out now.

6 years agoagents: use kill_and_sigcont() where appropriate
Lennart Poettering [Fri, 22 Dec 2017 14:10:56 +0000 (15:10 +0100)]
agents: use kill_and_sigcont() where appropriate