platform/upstream/systemd.git
8 years agoUse "return log_error_errno" in more places"
Zbigniew Jędrzejewski-Szmek [Sat, 23 Jul 2016 00:27:45 +0000 (20:27 -0400)]
Use "return log_error_errno" in more places"

8 years agoMerge pull request #3777 from poettering/id128-rework
Zbigniew Jędrzejewski-Szmek [Sat, 23 Jul 2016 01:18:41 +0000 (21:18 -0400)]
Merge pull request #3777 from poettering/id128-rework

uuid/id128 code rework

8 years agoMerge pull request #3783 from poettering/fix-3285
Lennart Poettering [Fri, 22 Jul 2016 16:37:42 +0000 (18:37 +0200)]
Merge pull request #3783 from poettering/fix-3285

coredump: make sure to handle crashes of PID 1 and journald special

8 years agocoredump: turn off coredump collection entirely after journald or PID 1 crashed
Lennart Poettering [Fri, 22 Jul 2016 16:01:50 +0000 (18:01 +0200)]
coredump: turn off coredump collection entirely after journald or PID 1 crashed

Safe is safe, let's turn off the whole logic if we can, after all it is
unlikely we'll be able to process further crashes in a reasonable way.

8 years agocoredump: make sure to handle crashes of PID 1 and journald special
Lennart Poettering [Fri, 22 Jul 2016 14:45:43 +0000 (16:45 +0200)]
coredump: make sure to handle crashes of PID 1 and journald special

Fixes: #3285

8 years agoMerge pull request #3753 from poettering/tasks-max-scale
Lennart Poettering [Fri, 22 Jul 2016 15:40:12 +0000 (17:40 +0200)]
Merge pull request #3753 from poettering/tasks-max-scale

Add support for relative TasksMax= specifications, and bump default for services

8 years agocoredump: truncate overly long coredump metadata fields (#3780)
Lennart Poettering [Fri, 22 Jul 2016 15:39:47 +0000 (17:39 +0200)]
coredump: truncate overly long coredump metadata fields (#3780)

Fixes: #3573
Replaces: #3588

8 years agosystemctl: never check inhibitors if -H or -M are used (#3781)
Lennart Poettering [Fri, 22 Jul 2016 15:39:21 +0000 (17:39 +0200)]
systemctl: never check inhibitors if -H or -M are used (#3781)

Don't check inhibitors when operating remotely. The interactivity inhibitors
imply can#t be provided anyway, and the current code checks for local sessions
directly, via various sd_session_xyz() APIs, hence bypass it entirely if we
operate on remote systems.

Fixes: #3476

8 years agoMerge pull request #3779 from kinvolk/alessandro/nspawn-inaccessible-devs
Lennart Poettering [Fri, 22 Jul 2016 15:37:54 +0000 (17:37 +0200)]
Merge pull request #3779 from kinvolk/alessandro/nspawn-inaccessible-devs

cgroup: whitelist inaccessible devices for "auto" and "closed" DevicePolicy

8 years agocgroup: whitelist inaccessible devices for "auto" and "closed" DevicePolicy.
Alessandro Puccetti [Fri, 22 Jul 2016 10:00:49 +0000 (12:00 +0200)]
cgroup: whitelist inaccessible devices for "auto" and "closed" DevicePolicy.

https://github.com/systemd/systemd/pull/3685 introduced
/run/systemd/inaccessible/{chr,blk} to map inacessible devices,
this patch allows systemd running inside a nspawn container to create
/run/systemd/inaccessible/{chr,blk}.

8 years agonspawn: set DevicesPolicy closed and clean up duplicated devices
Alessandro Puccetti [Fri, 22 Jul 2016 09:58:03 +0000 (11:58 +0200)]
nspawn: set DevicesPolicy closed and clean up duplicated devices

8 years agonamespace: ensure to return a valid inaccessible nodes (#3778)
Alessandro Puccetti [Fri, 22 Jul 2016 13:59:14 +0000 (15:59 +0200)]
namespace: ensure to return a valid inaccessible nodes (#3778)

Because /run/systemd/inaccessible/{chr,blk} are devices with
major=0 and minor=0 it might be possible that these devices cannot be created
so we use /run/systemd/inaccessible/sock instead to map them.

8 years agocore: check for overflow when handling scaled MemoryLimit= settings
Lennart Poettering [Fri, 22 Jul 2016 13:30:23 +0000 (15:30 +0200)]
core: check for overflow when handling scaled MemoryLimit= settings

Just in case...

8 years agomacros.systemd.in: add %systemd_ordering (#3776)
Harald Hoyer [Fri, 22 Jul 2016 13:33:13 +0000 (15:33 +0200)]
macros.systemd.in: add %systemd_ordering (#3776)

To remove the hard dependency on systemd, for packages, which function
without a running systemd the %systemd_ordering macro can be used to
ensure ordering in the rpm transaction. %systemd_ordering makes sure,
the systemd rpm is installed prior to the package, so the %pre/%post
scripts can execute the systemd parts.

Installing systemd afterwards though, does not result in the same outcome.

8 years agocore: change TasksMax= default for system services to 15%
Lennart Poettering [Tue, 19 Jul 2016 15:29:00 +0000 (17:29 +0200)]
core: change TasksMax= default for system services to 15%

As it turns out 512 is max number of tasks per service is hit by too many
applications, hence let's bump it a bit, and make it relative to the system's
maximum number of PIDs. With this change the new default is 15%. At the
kernel's default pids_max value of 32768 this translates to 4915. At machined's
default TasksMax= setting of 16384 this translates to 2457.

Why 15%? Because it sounds like a round number and is close enough to 4096
which I was going for, i.e. an eight-fold increase over the old 512

Summary:

            | on the host | in a container
old default |         512 |           512
new default |        4915 |          2457

8 years agologind: change TasksMax= value for user logins to 33%
Lennart Poettering [Tue, 19 Jul 2016 15:19:58 +0000 (17:19 +0200)]
logind: change TasksMax= value for user logins to 33%

Let's change from a fixed value of 12288 tasks per user to a relative value of
33%, which with the kernel's default of 32768 translates to 10813. This is a
slight decrease of the limit, for no other reason than "33%" sounding like a nice
round number that is close enough to 12288 (which would translate to 37.5%).
(Well, it also has the nice effect of still leaving a bit of room in the PID
space if there are 3 cooperating evil users that try to consume all PIDs...
Also, I like my bikesheds blue).

Since the new value is taken relative, and machined's TasksMax= setting
defaults to 16384, 33% inside of containers is usually equivalent to 5406,
which should still be ample space.

To summarize:

               | on the host | in the container
   old default |       12288 |            12288
   new default |       10813 |             5406

8 years agomain: simplify things a bit by moving container check into fixup_environment()
Lennart Poettering [Tue, 19 Jul 2016 15:00:36 +0000 (17:00 +0200)]
main: simplify things a bit by moving container check into fixup_environment()

8 years agocore: rename MemoryLimitByPhysicalMemory transient property to MemoryLimitScale
Lennart Poettering [Tue, 19 Jul 2016 14:10:15 +0000 (16:10 +0200)]
core: rename MemoryLimitByPhysicalMemory transient property to MemoryLimitScale

That way, we can neatly keep this in line with the new TasksMaxScale= option.

Note that we didn't release a version with MemoryLimitByPhysicalMemory= yet,
hence this change should be unproblematic without breaking API.

8 years agocore: support percentage specifications on TasksMax=
Lennart Poettering [Tue, 19 Jul 2016 13:58:49 +0000 (15:58 +0200)]
core: support percentage specifications on TasksMax=

This adds support for a TasksMax=40% syntax for specifying values relative to
the system's configured maximum number of processes. This is useful in order to
neatly subdivide the available room for tasks within containers.

8 years agomachine-id-setup: add new --print switch
Lennart Poettering [Fri, 22 Jul 2016 10:21:21 +0000 (12:21 +0200)]
machine-id-setup: add new --print switch

If specified we'll simply output the used machine ID.

8 years agocore: rework machine-id-setup.c to use the calls from id128-util.[ch]
Lennart Poettering [Fri, 22 Jul 2016 10:12:27 +0000 (12:12 +0200)]
core: rework machine-id-setup.c to use the calls from id128-util.[ch]

This allows us to delete quite a bit of code and make the whole thing a lot
shorter.

8 years agosd-id128: handle NULL return parameter in sd_id128_from_string() nicer
Lennart Poettering [Thu, 21 Jul 2016 18:23:51 +0000 (20:23 +0200)]
sd-id128: handle NULL return parameter in sd_id128_from_string() nicer

If the return parameter is NULL, simply validate the string, and return no
error.

8 years agomain: make sure set_machine_id() doesn't clobber arg_machine_id on failure
Lennart Poettering [Thu, 21 Jul 2016 18:22:42 +0000 (20:22 +0200)]
main: make sure set_machine_id() doesn't clobber arg_machine_id on failure

8 years agomachine-id-setup: port machine_id_commit() to new id128-util.c APIs
Lennart Poettering [Thu, 21 Jul 2016 17:12:50 +0000 (19:12 +0200)]
machine-id-setup: port machine_id_commit() to new id128-util.c APIs

8 years agonspawn: rework /etc/machine-id handling
Lennart Poettering [Thu, 21 Jul 2016 16:53:40 +0000 (18:53 +0200)]
nspawn: rework /etc/machine-id handling

With this change we'll no longer write to /etc/machine-id from nspawn, as that
breaks the --volatile= operation, as it ensures the image is never considered
in "first boot", since that's bound to the pre-existance of /etc/machine-id.

The new logic works like this:

- If /etc/machine-id already exists in the container, it is read by nspawn and
  exposed in "machinectl status" and friends.

- If the file doesn't exist yet, but --uuid= is passed on the nspawn cmdline,
  this UUID is passed in $container_uuid to PID 1, and PID 1 is then expected
  to persist this to /etc/machine-id for future boots (which systemd already
  does).

- If the file doesn#t exist yet, and no --uuid= is passed a random UUID is
  generated and passed via $container_uuid.

The result is that /etc/machine-id is never initialized by nspawn itself, thus
unbreaking the volatile mode. However still the machine ID configured in the
machine always matches nspawn's and thus machined's idea of it.

Fixes: #3611

8 years agosystemctl: fix format string for uint64_t field
Lennart Poettering [Thu, 21 Jul 2016 16:08:52 +0000 (18:08 +0200)]
systemctl: fix format string for uint64_t field

8 years agosystemctl: fix output alignment in "systemctl status"
Lennart Poettering [Thu, 21 Jul 2016 16:05:58 +0000 (18:05 +0200)]
systemctl: fix output alignment in "systemctl status"

If we show both a control and a main PID for a service fix this line in the
output of "systemctl status":

 Main PID: 19670 (sleep);         : 19671 (sleep)

to become this:

 Main PID: 19670 (sleep); Control PID: 19671 (sleep)

8 years agonspawn: rework machine/boot ID handling code to use new calls from id128-util.[ch]
Lennart Poettering [Thu, 21 Jul 2016 16:01:55 +0000 (18:01 +0200)]
nspawn: rework machine/boot ID handling code to use new calls from id128-util.[ch]

8 years agosd-id128: split UUID file read/write code into new id128-util.[ch]
Lennart Poettering [Thu, 21 Jul 2016 15:57:57 +0000 (17:57 +0200)]
sd-id128: split UUID file read/write code into new id128-util.[ch]

We currently have code to read and write files containing UUIDs at various
places. Unify this in id128-util.[ch], and move some other stuff there too.

The new files are located in src/libsystemd/sd-id128/ (instead of src/shared/),
because they are actually the backend of sd_id128_get_machine() and
sd_id128_get_boot().

In follow-up patches we can use this reduce the code in nspawn and
machine-id-setup by adopted the common implementation.

8 years agotree-wide: use sd_id128_is_null() instead of sd_id128_equal where appropriate
Lennart Poettering [Thu, 21 Jul 2016 14:06:31 +0000 (16:06 +0200)]
tree-wide: use sd_id128_is_null() instead of sd_id128_equal where appropriate

It's a bit easier to read because shorter. Also, most likely a tiny bit faster.

8 years agoMerge pull request #3762 from poettering/sigkill-log
Martin Pitt [Fri, 22 Jul 2016 07:18:30 +0000 (09:18 +0200)]
Merge pull request #3762 from poettering/sigkill-log

log about all processes we forcibly kill

8 years agoMerge pull request #3764 from poettering/assorted-stuff-2
Martin Pitt [Fri, 22 Jul 2016 07:10:04 +0000 (09:10 +0200)]
Merge pull request #3764 from poettering/assorted-stuff-2

Assorted fixes

8 years agonspawn: enable major=0/minor=0 devices inside the container (#3773)
Alessandro Puccetti [Thu, 21 Jul 2016 15:39:38 +0000 (17:39 +0200)]
nspawn: enable major=0/minor=0 devices inside the container (#3773)

https://github.com/systemd/systemd/pull/3685 introduced
/run/systemd/inaccessible/{chr,blk} to map inacessible devices,
this patch allows systemd running inside a nspawn container to create
/run/systemd/inaccessible/{chr,blk}.

8 years agomissing_syscall: add __NR_copy_file_range for powerpc architecture (#3772)
Alessio Igor Bogani [Thu, 21 Jul 2016 09:40:35 +0000 (11:40 +0200)]
missing_syscall: add __NR_copy_file_range for powerpc architecture (#3772)

8 years agoupdate TODO
Lennart Poettering [Thu, 21 Jul 2016 09:09:24 +0000 (11:09 +0200)]
update TODO

8 years agohwdb: axis resolution override for the Lenovo Y700 (#3769)
Peter Hutterer [Thu, 21 Jul 2016 08:55:36 +0000 (18:55 +1000)]
hwdb: axis resolution override for the Lenovo Y700 (#3769)

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

8 years agoMerge pull request #3770 from AlexanderKurtz/master
Lennart Poettering [Thu, 21 Jul 2016 08:55:05 +0000 (10:55 +0200)]
Merge pull request #3770 from AlexanderKurtz/master

bootctl: Always use upper case for "/EFI/BOOT" and "/EFI/BOOT/BOOT*.EFI".

8 years agocore: remove duplicate includes (#3771)
Thomas H. P. Andersen [Thu, 21 Jul 2016 08:52:07 +0000 (10:52 +0200)]
core: remove duplicate includes (#3771)

8 years agoMerge pull request #3760 from poettering/rfkill-fix
Zbigniew Jędrzejewski-Szmek [Thu, 21 Jul 2016 02:19:05 +0000 (22:19 -0400)]
Merge pull request #3760 from poettering/rfkill-fix

rfkill dead-lock fix

8 years agodocumentation: add a short document describing how to test your systemd build tree...
Lennart Poettering [Thu, 21 Jul 2016 02:15:54 +0000 (04:15 +0200)]
documentation: add a short document describing how to test your systemd build tree (#3763)

8 years agobootctl: Always use upper case for "/EFI/BOOT" and "/EFI/BOOT/BOOT*.EFI".
Alexander Kurtz [Thu, 21 Jul 2016 00:29:54 +0000 (02:29 +0200)]
bootctl: Always use upper case for "/EFI/BOOT" and "/EFI/BOOT/BOOT*.EFI".

If the ESP is not mounted with "iocharset=ascii", but with "iocharset=utf8"
(which is for example the default in Debian), the file system becomes case
sensitive. This means that a file created as "FooBarBaz" cannot be accessed as
"foobarbaz" since those are then considered different files.

Moreover, a file created as "FooBar" can then also not be accessed as "foobar",
and it also prevents such a file from being created, as both would use the same
8.3 short name "FOOBAR".

Even though the UEFI specification [0] does give the canonical spelling for
the files mentioned above, not all implementations completely conform to that,
so it's possible that those files would already exist, but with a different
spelling, causing subtle bugs when scanning or modifying the ESP.

While the proper fix would of course be that everybody conformed to the
standard, we can work around this problem by just referencing the files by
their 8.3 short names, i.e. using upper case.

Fixes: #3740

[0] <http://www.uefi.org/specifications>, version 2.6, section 3.5.1.1

8 years agobootctl: Use lower case string constants in case-insensitive comparisons.
Alexander Kurtz [Thu, 21 Jul 2016 00:20:12 +0000 (02:20 +0200)]
bootctl: Use lower case string constants in case-insensitive comparisons.

8 years agonamespace: fix wrong return value from mount(2) (#3758)
Topi Miettinen [Wed, 20 Jul 2016 14:43:21 +0000 (14:43 +0000)]
namespace: fix wrong return value from mount(2) (#3758)

Fix bug introduced by #3263: mount(2) return value is 0 or -1, not errno.

Thanks to Evgeny Vereshchagin (@evverx) for reporting.

8 years agobasic: fix macro definition in nss-util.h
Lennart Poettering [Thu, 14 Jul 2016 17:16:19 +0000 (19:16 +0200)]
basic: fix macro definition in nss-util.h

Fix a copy/paste mistake.

8 years agoexecute: make sure JoinsNamespaceOf= doesn't leak ns fds to executed processes
Lennart Poettering [Thu, 14 Jul 2016 11:12:01 +0000 (13:12 +0200)]
execute: make sure JoinsNamespaceOf= doesn't leak ns fds to executed processes

8 years agonamespace: add a (void) cast
Lennart Poettering [Thu, 14 Jul 2016 10:28:54 +0000 (12:28 +0200)]
namespace: add a (void) cast

8 years agonspawn: when netns is on, mount /proc/sys/net writable
Lennart Poettering [Thu, 14 Jul 2016 14:53:13 +0000 (16:53 +0200)]
nspawn: when netns is on, mount /proc/sys/net writable

Normally we make all of /proc/sys read-only in a container, but if we do have
netns enabled we can make /proc/sys/net writable, as things are virtualized
then.

8 years agonspawn: document why the uid shift range is the way it is
Lennart Poettering [Thu, 14 Jul 2016 10:25:32 +0000 (12:25 +0200)]
nspawn: document why the uid shift range is the way it is

8 years agoconf-parser: minor coding style improvements
Lennart Poettering [Thu, 14 Jul 2016 10:24:59 +0000 (12:24 +0200)]
conf-parser: minor coding style improvements

8 years agounits: fix TasksMax=16384 for systemd-nspawn@.service
Lennart Poettering [Thu, 14 Jul 2016 10:20:29 +0000 (12:20 +0200)]
units: fix TasksMax=16384 for systemd-nspawn@.service

When a container scope is allocated via machined it gets 16K set already since
cf7d1a30e44bf380027a2e73f9bf13f423a33cc1. Make sure when a container is run as
system service it gets the same values.

8 years agocore: normalize header inclusion in execute.h a bit
Lennart Poettering [Sat, 2 Jul 2016 02:58:14 +0000 (19:58 -0700)]
core: normalize header inclusion in execute.h a bit

We don't actually need any functionality from cgroup.h in execute.h, hence
don't include that. However, we do need the Unit structure from unit.h, hence
include that, and move it as late as possible, since it needs the definitions
from execute.h.

8 years agoexecute: normalize connect_logger_as() parameters slightly
Lennart Poettering [Sat, 2 Jul 2016 02:57:21 +0000 (19:57 -0700)]
execute: normalize connect_logger_as() parameters slightly

All other functions in execute.c that need the unit id take a Unit* parameter
as first argument. Let's change connect_logger_as() to follow a similar logic.

8 years agologind: always abandon session scopes before killing them
Lennart Poettering [Wed, 20 Jul 2016 11:42:36 +0000 (13:42 +0200)]
logind: always abandon session scopes before killing them

This way systemd is informed that we consider everything inside the scope as
"left-over", and systemd can log about killing it.

With this change systemd will log about all processes killed due to the session
clean-up on KillUserProcesses=yes.

8 years agocore: when a scope was abandoned, always log about processes we kill
Lennart Poettering [Wed, 20 Jul 2016 11:41:32 +0000 (13:41 +0200)]
core: when a scope was abandoned, always log about processes we kill

After all, if a unit is abandoned, all processes inside of it may be considered
"left over" and are something we should better log about.

8 years agocore: make sure RequestStop signal is send directed
Lennart Poettering [Wed, 20 Jul 2016 11:39:23 +0000 (13:39 +0200)]
core: make sure RequestStop signal is send directed

This was accidentally left commented out for debugging purposes, let's fix that
and make the signal directed again.

8 years agocgroup: suppress sending follow-up SIGCONT after sending SIGCONT/SIGKILL anyway
Lennart Poettering [Wed, 20 Jul 2016 09:16:53 +0000 (11:16 +0200)]
cgroup: suppress sending follow-up SIGCONT after sending SIGCONT/SIGKILL anyway

8 years agocore: when forcibly killing/aborting left-over unit processes log about it
Lennart Poettering [Wed, 20 Jul 2016 09:16:05 +0000 (11:16 +0200)]
core: when forcibly killing/aborting left-over unit processes log about it

Let's lot at LOG_NOTICE about any processes that we are going to
SIGKILL/SIGABRT because clean termination of them didn't work.

This turns the various boolean flag parameters to cg_kill(), cg_migrate() and
related calls into a single binary flags parameter, simply because the function
now gained even more parameters and the parameter listed shouldn't get too
long.

Logging for killing processes is done either when the kill signal is SIGABRT or
SIGKILL, or on explicit request if KILL_TERMINATE_AND_LOG instead of LOG_TERMINATE
is passed. This isn't used yet in this patch, but is made use of in a later
patch.

8 years agoPO: italian updates (#3761)
Daniele Medri [Wed, 20 Jul 2016 11:02:28 +0000 (13:02 +0200)]
PO: italian updates (#3761)

8 years agoutil: don't send SIGCONT following a SIGCONT or SIGKILL in kill_and_sigcont()
Lennart Poettering [Wed, 20 Jul 2016 09:14:48 +0000 (11:14 +0200)]
util: don't send SIGCONT following a SIGCONT or SIGKILL in kill_and_sigcont()

8 years agologind: minor coding style improvements
Lennart Poettering [Wed, 20 Jul 2016 09:14:18 +0000 (11:14 +0200)]
logind: minor coding style improvements

8 years agoMerge pull request #3759 from poettering/namespace-fixup
Lennart Poettering [Wed, 20 Jul 2016 07:22:40 +0000 (09:22 +0200)]
Merge pull request #3759 from poettering/namespace-fixup

minor follow-up fixes for #3685

8 years agorules: make sure always set at least one property on rfkill devices
Lennart Poettering [Wed, 20 Jul 2016 07:17:57 +0000 (09:17 +0200)]
rules: make sure always set at least one property on rfkill devices

The rfkill service waits for rfkill device initialization as reported by
udev_device_is_initialized(), and if that is never reported it might dead-lock.

However, udev never reports completed initialization for devices that have no
properties or tags set. For some rfkill devices this might be the case, in
particular those which are connected to exotic busses, where path_id returns
nothing.

This patch simply sets the SYSTEM_RFKILL property on all rfkill devices, to
ensure that udev_device_is_initialized() always reports something useful and we
don't dead-lock.

Fixes: #2745

8 years agoman: document a tiny bit better what udev_device_get_is_initialized() actually returns
Lennart Poettering [Wed, 20 Jul 2016 07:17:33 +0000 (09:17 +0200)]
man: document a tiny bit better what udev_device_get_is_initialized() actually returns

8 years agonamespace: minor improvements
Lennart Poettering [Wed, 20 Jul 2016 06:57:25 +0000 (08:57 +0200)]
namespace: minor improvements

We generally try to avoid strerror(), due to its threads-unsafety, let's do
this here, too.

Also, let's be tiny bit more explanatory with the log messages, and let's
shorten a few things.

8 years agocore: hide legacy bus properties
Lennart Poettering [Wed, 20 Jul 2016 06:55:50 +0000 (08:55 +0200)]
core: hide legacy bus properties

We usually hide legacy bus properties from introspection. Let's do that for the
InaccessibleDirectories= properties too.

The properties stay accessible if requested, but they won't be listed anymore
if people introspect the unit.

8 years agoman: revise entry about specifying a file path (#3739)
mulkieran [Wed, 20 Jul 2016 03:15:22 +0000 (23:15 -0400)]
man: revise entry about specifying a file path (#3739)

* Specifying a device node has an effect much larger than a simple shortcut
for a field/value match, so the original sentence is no longer a good way
to start the paragraph.
* Specifying a device node causes matches to be generated for all ancestor
devices of the device specified, not just its parents.
* Indicates that the path must be absolute, but that it may be a link.
* Eliminates a few typos.

8 years agoman: mention that locale changes might require initramfs to be rebuilt (#3754)
Zbigniew Jędrzejewski-Szmek [Tue, 19 Jul 2016 19:24:23 +0000 (15:24 -0400)]
man: mention that locale changes might require initramfs to be rebuilt (#3754)

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

Also explain what localectl does a bit better:
https://bugzilla.redhat.com/show_bug.cgi?id=1357861

8 years agoMerge pull request #3685 from kinvolk/alessandro/inaccessible-paths
Lennart Poettering [Tue, 19 Jul 2016 19:17:49 +0000 (21:17 +0200)]
Merge pull request #3685 from kinvolk/alessandro/inaccessible-paths

namespace: unify limit behavior on non-directory paths

8 years agoMerge pull request #3636 from poettering/logs-show-utf8
Evgeny Vereshchagin [Tue, 19 Jul 2016 18:11:41 +0000 (21:11 +0300)]
Merge pull request #3636 from poettering/logs-show-utf8

improve handling of trailing newline in journal logging

8 years agosd-journal: suppress empty lines
Lennart Poettering [Tue, 19 Jul 2016 12:27:05 +0000 (14:27 +0200)]
sd-journal: suppress empty lines

Let's make sure our logging APIs is in sync with how stdout/stderr logging
works.

8 years agodoc,core: Read{Write,Only}Paths= and InaccessiblePaths=
Alessandro Puccetti [Thu, 7 Jul 2016 09:17:00 +0000 (11:17 +0200)]
doc,core: Read{Write,Only}Paths= and InaccessiblePaths=

This patch renames Read{Write,Only}Directories= and InaccessibleDirectories=
to Read{Write,Only}Paths= and InaccessiblePaths=, previous names are kept
as aliases but they are not advertised in the documentation.

Renamed variables:
`read_write_dirs` --> `read_write_paths`
`read_only_dirs` --> `read_only_paths`
`inaccessible_dirs` --> `inaccessible_paths`

8 years agonamespace: unify limit behavior on non-directory paths
Alessandro Puccetti [Wed, 6 Jul 2016 07:48:58 +0000 (09:48 +0200)]
namespace: unify limit behavior on non-directory paths

Despite the name, `Read{Write,Only}Directories=` already allows for
regular file paths to be masked. This commit adds the same behavior
to `InaccessibleDirectories=` and makes it explicit in the doc.
This patch introduces `/run/systemd/inaccessible/{reg,dir,chr,blk,fifo,sock}`
{dile,device}nodes and mounts on the appropriate one the paths specified
in `InacessibleDirectories=`.

Based on Luca's patch from https://github.com/systemd/systemd/pull/3327

8 years agoman: document that sd_journal_print() strips trailing whitespace
Lennart Poettering [Sat, 2 Jul 2016 00:10:26 +0000 (17:10 -0700)]
man: document that sd_journal_print() strips trailing whitespace

8 years agojournalctl: make sure that journalctl's --all switch also has an effect on json output
Lennart Poettering [Fri, 1 Jul 2016 00:41:19 +0000 (17:41 -0700)]
journalctl: make sure that journalctl's --all switch also has an effect on json output

With this change, binary record data is formatted as string if --all is
specified when using json output. This is inline with the effect of --all on
the other available output modes.

Fixes: #3416

8 years agosd-journal: when formatting log messages, implicitly strip trailing whitespace
Lennart Poettering [Fri, 1 Jul 2016 00:37:21 +0000 (17:37 -0700)]
sd-journal: when formatting log messages, implicitly strip trailing whitespace

When converting log messages from human readable text into binary records to
send off to journald in sd_journal_print(), strip trailing whitespace in the
log message. This way, handling of logs made via syslog(), stdout/stderr and
sd_journal_print() are treated the same way: trailing (but not leading)
whitespace is automatically removed, in particular \n and \r. Note that in case
of syslog() and stdout/stderr based logging the stripping takes place
server-side though, while for the native protocol based transport this takes
place client-side. This is because in the former cases conversion from
free-form human-readable strings into structured, binary log records takes
place on the server-side while for journal-native logging it happens on the
client side, and after conversion into binary records we probably shouldn't
alter the data anymore.

See: #3416

8 years agomkosi: make sure we fail on error
Lennart Poettering [Tue, 19 Jul 2016 10:30:34 +0000 (12:30 +0200)]
mkosi: make sure we fail on error

8 years agokernel-install: recognize /boot/efi mountpoint (#3751)
Harald Hoyer [Tue, 19 Jul 2016 10:10:09 +0000 (12:10 +0200)]
kernel-install: recognize /boot/efi mountpoint (#3751)

install everything in /boot/efi, if this is a mountpoint

8 years agoupdate 60-evdev to include rules for ASUS UX305 touchpad (#3698)
Atrotors [Tue, 19 Jul 2016 09:43:15 +0000 (19:43 +1000)]
update 60-evdev to include rules for ASUS UX305 touchpad (#3698)

8 years agoMerge pull request #3749 from phomes/trivial-fixes3
Zbigniew Jędrzejewski-Szmek [Mon, 18 Jul 2016 23:03:08 +0000 (19:03 -0400)]
Merge pull request #3749 from phomes/trivial-fixes3

Trivial fixes3

8 years agoresolved: replace bitwise and with logical and
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:42:09 +0000 (22:42 +0200)]
resolved: replace bitwise and with logical and

8 years agotreewide: remove unused variables
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:31:34 +0000 (22:31 +0200)]
treewide: remove unused variables

8 years agobasic: fix whitespace
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:14:23 +0000 (22:14 +0200)]
basic: fix whitespace

8 years agonetwork: fix indentation
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:09:57 +0000 (22:09 +0200)]
network: fix indentation

8 years agosd-boot: Fix waiting for keyboard input (#3735)
Jan Janssen [Mon, 18 Jul 2016 19:19:32 +0000 (21:19 +0200)]
sd-boot: Fix waiting for keyboard input (#3735)

WaitForKeyEx may never return on some UEFI systems depending
on firmware, hardware configuration and the phase of the moon.
Use ConIn->WaitForKey unconditionally instead.

Fixes #3632

8 years agohwdb: Update database of Bluetooth company identifiers
Marcel Holtmann [Mon, 18 Jul 2016 12:56:46 +0000 (14:56 +0200)]
hwdb: Update database of Bluetooth company identifiers

8 years agonspawn: decrease mkdir error logging in /sys to debug priority (#3748)
tblume [Mon, 18 Jul 2016 10:23:08 +0000 (12:23 +0200)]
nspawn: decrease mkdir error logging in /sys to debug priority (#3748)

Such mkdir errors happen for example when trying to mkdir /sys/fs/selinux.

/sys is documented to be readonly in the container, so mkdir errors below /sys
can be expected.
They shouldn't be logged as warnings since they lead users to think that
there is something wrong.

8 years agoMerge pull request #3745 from keszybz/fix-make-nulstr-confusion
Lennart Poettering [Mon, 18 Jul 2016 09:12:47 +0000 (11:12 +0200)]
Merge pull request #3745 from keszybz/fix-make-nulstr-confusion

Fix make nulstr confusion

8 years agoMerge pull request #3746 from keszybz/trivial-fixes
Daniel Mack [Mon, 18 Jul 2016 07:54:06 +0000 (09:54 +0200)]
Merge pull request #3746 from keszybz/trivial-fixes

Trivial fixes

8 years agoDrop parentheses in two places
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 19:12:01 +0000 (15:12 -0400)]
Drop parentheses in two places

8 years agosystemd-resolve: remove spurious newline with no global settings
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 17:55:58 +0000 (13:55 -0400)]
systemd-resolve: remove spurious newline with no global settings

8 years agosystemd-resolve: use plural "DNS Servers"
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 17:51:30 +0000 (13:51 -0400)]
systemd-resolve: use plural "DNS Servers"

Usually multiple DNS servers are configured, and it looks strange to have
singular in the heading.

8 years agobasic/strv: add an extra NUL after strings in strv_make_nulstr
Zbigniew Jędrzejewski-Szmek [Sun, 17 Jul 2016 19:25:01 +0000 (15:25 -0400)]
basic/strv: add an extra NUL after strings in strv_make_nulstr

strv_make_nulstr was creating a nulstr which was not a valid nulstr,
because it was missing the terminating NUL. This didn't cause any issues,
because strv_parse_nulstr correctly parsed the result, using the
separately specified length.

But it's confusing to have something called nulstr which really isn't.
It is likely that somebody will try to use strv_make_nulstr() in
some other place, incorrectly.

This patch changes strv_parse_nulstr() to produce a valid nulstr, and
changes the output length parameter to be the minimum number of bytes
which can be later on parsed by strv_parse_nulstr(). This allows the
only user in ask-password-api to be slightly simplified.

Based-on-patch-by: Jean-Sébastien Bour <jean-sebastien@bour.name>
Fixes #3689.

8 years agobasic/strv: exhibit strv_make_nulstr missing final NUL char (systemd/systemd#3689)
Jean-Sébastien Bour [Sat, 9 Jul 2016 00:38:00 +0000 (02:38 +0200)]
basic/strv: exhibit strv_make_nulstr missing final NUL char (systemd/systemd#3689)

8 years agomanager: don't skip sigchld handler for main and control pid for services (#3738)
Lukáš Nykrýn [Sat, 16 Jul 2016 19:04:13 +0000 (21:04 +0200)]
manager: don't skip sigchld handler for main and control pid for services (#3738)

During stop when service has one "regular" pid one main pid and one
control pid and the sighld for the regular one is processed first the
unit_tidy_watch_pids will skip the main and control pid and does not
remove them from u->pids(). But then we skip the sigchld event because we
already did one in the iteration and there are two pids in u->pids.

v2: Use general unit_main_pid() and unit_control_pid() instead of
reaching directly to service structure.

8 years agoman: mention system-shutdown hook directory in synopsis (#3741)
Michael Biebl [Sat, 16 Jul 2016 16:51:45 +0000 (18:51 +0200)]
man: mention system-shutdown hook directory in synopsis (#3741)

The distinction between systemd-shutdown the binary vs system-shutdown
the hook directory (without the 'd') is not immediately obvious and can
be quite confusing if you are looking for a directory which doesn't exist.

Therefore explicitly mention the hook directory in the synopsis with a
trailing slash to make it clearer which is which.

8 years agoman: replace dash with mdash where appropriate
Zbigniew Jędrzejewski-Szmek [Sat, 16 Jul 2016 15:09:25 +0000 (11:09 -0400)]
man: replace dash with mdash where appropriate

8 years agobuild-sys: add mkosi hookup (#3731)
Lennart Poettering [Sat, 16 Jul 2016 00:00:44 +0000 (02:00 +0200)]
build-sys: add mkosi hookup (#3731)

This adds a build script and a settings file for "mkosi", a tool for putting
together full, bootable disk images for container managers of EFI systems and
VMs.

With these files it's enough to type "mkosi" in the project directory to
generate a bootable Fedora 24 OS image with a version of systemd compiled fresh
from the working tree.

See https://github.com/systemd/mkosi

8 years agonetworkd: fix for 3692 (#3699)
Susant Sahani [Fri, 15 Jul 2016 16:50:51 +0000 (22:20 +0530)]
networkd: fix for 3692 (#3699)

We should look that the kind is invalid rather than pointer is NULL.

8 years agorules: UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG property (#3714)
Rusty Bird [Fri, 15 Jul 2016 16:47:42 +0000 (16:47 +0000)]
rules: UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG property (#3714)

Sometimes, the persistent storage rules should be skipped for a subset
of devices. For example, the Qubes operating system prevents dom0 from
parsing untrusted block device content (such as filesystem metadata) by
shipping a custom 60-persistent-storage.rules, patched to bail out early
if the device name matches a hardcoded pattern.

As a less brittle and more flexible alternative, this commit adds a line
to the two relevant .rules files which makes them test the value of the
UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG device property, modeled
after the various DM_UDEV_DISABLE_*_RULES_FLAG properties.

8 years agotree-wide: get rid of selinux_context_t (#3732)
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jul 2016 16:44:02 +0000 (12:44 -0400)]
tree-wide: get rid of selinux_context_t (#3732)

https://github.com/SELinuxProject/selinux/commit/9eb9c9327563014ad6a807814e7975424642d5b9
deprecated selinux_context_t. Replace with a simple char* everywhere.

Alternative fix for #3719.