Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 19:34:45 +0000 (14:34 -0500)]
basic/log: merge two big log_struct_internal invocations into one
We can take advantage of the fact a NULL argument terminates the list.
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 19:25:45 +0000 (14:25 -0500)]
tools/catalog-report.py: a script to scour the journal for bad catalog entries
I think it can be a useful tool to find such issues.
SD_MESSAGE_UNIT_STARTING
7d4958e842da4a758f6c1cdc7b36dcc5: no field UNIT
../src/core/unit.c:1239 unit_status_log_starting_stopping_reloading
Starting Paths.
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
PRIORITY=6
USER_UNIT=paths.target
SD_MESSAGE_UNIT_STARTED
39f53479d3a045ac8e11786248231fbf: no field UNIT
../src/core/job.c:721 job_log_status_message
Reached target Paths.
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
PRIORITY=6
RESULT=done
USER_UNIT=paths.target
SD_MESSAGE_STARTUP_FINISHED
b07a249cd024414a82dd00cd181378ff: no field KERNEL_USEC
../src/core/manager.c:2532 manager_check_finished
Startup finished in 19ms.
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
PRIORITY=6
USERSPACE_USEC=19670
SD_MESSAGE_STARTUP_FINISHED
b07a249cd024414a82dd00cd181378ff: no field INITRD_USEC
../src/core/manager.c:2532 manager_check_finished
Startup finished in 19ms.
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
PRIORITY=6
USERSPACE_USEC=19670
unknown
0ce153587afa4095832d233c17a88001: no catalog entry
gsm-manager.c:1366 start_phase
Entering running state
SYSLOG_IDENTIFIER=gnome-session
PRIORITY=5
SD_MESSAGE_UNIT_STOPPING
de5b426a63be47a7b6ac3eaac82e2f6f: no field UNIT
../src/core/unit.c:1239 unit_status_log_starting_stopping_reloading
Stopping Default.
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
PRIORITY=6
USER_UNIT=default.target
SD_MESSAGE_UNIT_STOPPED
9d1aaa27d60140bd96365438aad20286: no field UNIT
../src/core/job.c:729 job_log_status_message
Stopped target Default.
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
PRIORITY=6
RESULT=done
USER_UNIT=default.target
SD_MESSAGE_TIME_CHANGE
c7a787079b354eaaa9e77b371893cd27: no field REALTIME
src/core/manager.c:2049 manager_dispatch_time_change_fd
Time has been changed
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
PRIORITY=6
unknown
f3ea493c22934e26811cd62abe8e203a: no catalog entry
shell-global.c:1375 shell_global_log_structured
GNOME Shell started at Sat Jun 11 2016 12:37:46 GMT-0400 (EDT)
SYSLOG_IDENTIFIER=gnome-shell
SD_MESSAGE_UNIT_FAILED
be02cf6855d2428ba40df7e9d022f03d: no field UNIT
src/core/job.c:803 job_log_status_message
Failed to start GNOME Terminal Server.
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
RESULT=failed
PRIORITY=3
USER_UNIT=gnome-terminal-server.service
SD_MESSAGE_LID_CLOSED
b72ea4a2881545a0b50e200e55b9b070: no catalog entry
src/login/logind-button.c:198 button_dispatch
Lid closed.
SYSLOG_FACILITY=4
SYSLOG_IDENTIFIER=systemd-logind
PRIORITY=6
SD_MESSAGE_LID_OPENED
b72ea4a2881545a0b50e200e55b9b06f: no catalog entry
src/login/logind-button.c:219 button_dispatch
Lid opened.
SYSLOG_FACILITY=4
SYSLOG_IDENTIFIER=systemd-logind
PRIORITY=6
SD_MESSAGE_SUSPEND_KEY
b72ea4a2881545a0b50e200e55b9b072: no catalog entry
src/login/logind-button.c:177 button_dispatch
Suspend key pressed.
SYSLOG_FACILITY=4
SYSLOG_IDENTIFIER=systemd-logind
PRIORITY=6
SD_MESSAGE_CONFIG_ERROR
c772d24e9a884cbeb9ea12625c306c01: no catalog entry
src/shared/conf-parser.c:469 config_parse_sec
[/etc/systemd/system/systemd-networkd.service.d/override.conf:2] Failed to parse sec value, ignoring:
UNIT=systemd-networkd.service
SYSLOG_FACILITY=3
ERRNO=22
SYSLOG_IDENTIFIER=systemd
PRIORITY=3
CONFIG_LINE=2
CONFIG_FILE=/etc/systemd/system/systemd-networkd.service.d/override.conf
unknown
10dd2dc188b54a5e98970f56499d1f73: no catalog entry
gsm-manager.c:308 on_display_server_failure
Unrecoverable failure in required component org.gnome.Shell.desktop
PRIORITY=3
SYSLOG_IDENTIFIER=gnome-session-binary
unknown
52fb62f99e2c49d89cfbf9d6de5e3555: no catalog entry
src/journal/test-journal-send.c:85 main
Hello World!
PAGE_SIZE=4096
TERM=xterm-256color
SYSLOG_IDENTIFIER=lt-test-journal-send
PRIORITY=5
N_CPUS=2
HOME=/home/zbyszek
unknown
9348174c5cc74001a71ef26bd79d302e: no catalog entry
/usr/lib/python3.5/site-packages/dnf-plugins/system_upgrade.py:422 log_status
Download finished.
SYSLOG_IDENTIFIER=python3
DNF_VERSION=1.1.10
TARGET_RELEASEVER=25
SYSTEM_RELEASEVER=24
PRIORITY=5
unknown
fef1cc509d5047268b83a3a553f54b43: no catalog entry
/usr/lib/python3.5/site-packages/dnf-plugins/system_upgrade.py:422 log_status
Rebooting to perform upgrade.
SYSLOG_IDENTIFIER=python3
DNF_VERSION=1.1.10
TARGET_RELEASEVER=25
SYSTEM_RELEASEVER=24
PRIORITY=5
unknown
3e0a5636d16b4ca4bbe5321d06c6aa62: no catalog entry
/usr/lib/python3.5/site-packages/dnf-plugins/system_upgrade.py:422 log_status
Starting system upgrade. This will take a while.
SYSLOG_IDENTIFIER=python3
DNF_VERSION=1.1.10
SYSTEM_RELEASEVER=24
PRIORITY=5
TARGET_RELEASEVER=25
unknown
0123456789abcdef0123456789abcdef: no catalog entry
<doctest systemd.journal.JournalHandler[9]>:1 <module>
Message with ID
SYSLOG_IDENTIFIER=/usr/lib/python2.7/site-packages/py/test.py
LOGGER=custom_logger_name
PRIORITY=4
THREAD_NAME=MainThread
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 16:32:28 +0000 (11:32 -0500)]
pid1,catalog: use a different MESSAGE_ID for user manager startup
This add a new message id for the end of user instance startup.
User manager startup is a different beast then the system startup.
Their descriptions are completely different too. Let's just separate
them.
Partially fixes #3351.
Also remove "successful" from the description, since we don't know if
the startup was successful or not.
AsciiWolf [Sun, 11 Dec 2016 05:14:19 +0000 (06:14 +0100)]
Added Debian config for mkosi (#4865)
Lennart Poettering [Sat, 10 Dec 2016 15:28:50 +0000 (16:28 +0100)]
Merge pull request #4844 from hadess/sensor-quirks
udev: Add rules for accelerometer orientation quirks
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 07:28:24 +0000 (02:28 -0500)]
hwdb_parser: make sure that our patterns match the full property
We would catch stuff like:
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0.0., 0
but not
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 0.0.
because the match would stop at the next-to-last char. Fix that
by requiring a line end.
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 07:26:37 +0000 (02:26 -0500)]
hwdb_parser: add support for ACCEL_MOUNT_MATRIX
We test that we have exactly three rows of three reals separated by two
semicolons.
Bastien Nocera [Tue, 6 Dec 2016 16:16:43 +0000 (17:16 +0100)]
udev: Add rules for accelerometer orientation quirks
This commit adds a rules file to extract the properties from hwdb
to set on i2c IIO devices. This is used to set the ACCEL_MOUNT_MATRIX
property on IIO devices, to be consumed by iio-sensor-proxy or
equivalent daemon.
The hwdb file contains documentation on how to write quirks. Note
however that mount information is usually exported in:
- the device-tree for ARM devices
- the ACPI DSDT for Intel-compatible devices
but currently not extracted by the kernel.
Also note that some devices have the framebuffer rotation that changes
between the bootloader and the main system, which might mean that the
accelerometer is then wrongly oriented. This is a missing feature in the
i915 kernel driver: https://bugs.freedesktop.org/show_bug.cgi?id=94894
which needs to be fixed, and won't require quirks.
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 06:29:52 +0000 (01:29 -0500)]
Merge pull request #4835 from poettering/unit-name-printf
Various specifier resolution fixes.
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 06:08:13 +0000 (01:08 -0500)]
Merge pull request #4795 from poettering/dissect
Generalize image dissection logic of nspawn, and make it useful for other tools.
Wim de With [Sat, 10 Dec 2016 04:33:58 +0000 (05:33 +0100)]
nspawn: add missing -E to getopt_long (#4860)
Reverend Homer [Fri, 9 Dec 2016 09:04:30 +0000 (12:04 +0300)]
tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)
Zbigniew Jędrzejewski-Szmek [Fri, 9 Dec 2016 04:24:28 +0000 (23:24 -0500)]
Merge pull request #4686 from poettering/machine-id-app-specific
Add new "khash" API and add new sd_id128_get_machine_app_specific() function
David Michael [Wed, 7 Dec 2016 21:42:17 +0000 (13:42 -0800)]
network: fix const qualifier (#4849)
Follow up for #4809.
Franck Bui [Wed, 7 Dec 2016 20:36:39 +0000 (21:36 +0100)]
nspawn: resolv.conf might not be created initially (#4799)
This might happen that resolv.conf is missing in a minimal rootfs and in this
case the following warning is emitted:
Failed to mount n/a on /mnt/etc/resolv.conf (MS_BIND ""): No such file or directory
This patch fixes this case.
Lennart Poettering [Wed, 7 Dec 2016 20:35:07 +0000 (21:35 +0100)]
Merge pull request #4843 from joukewitteveen/protocol
Go through stop_post on failure (#4770)
David Michael [Wed, 7 Dec 2016 18:12:10 +0000 (10:12 -0800)]
network: support negation in matching patterns (#4809)
Lennart Poettering [Wed, 7 Dec 2016 18:03:22 +0000 (19:03 +0100)]
core: add a note clarifying that we should be careful when adding new specifiers
Lennart Poettering [Wed, 7 Dec 2016 17:58:09 +0000 (18:58 +0100)]
core: deprecate %c, %r, %R specifiers
%c and %r rely on settings made in the unit files themselves and hence resolve
to different values depending on whether they are used before or after Slice=.
Let's simply deprecate them and drop them from the documentation, as that's not
really possible to fix. Moreover they are actually redundant, as the same
information may always be queried from /proc/self/cgroup and /proc/1/cgroup.
(Accurately speaking, %R is actually not broken like this as it is constant.
However, let's remove all cgroup-related specifiers at once, as it is also
redundant, and doesn't really make much sense alone.)
Lennart Poettering [Mon, 5 Dec 2016 19:14:13 +0000 (20:14 +0100)]
update TODO
Lennart Poettering [Mon, 5 Dec 2016 19:12:46 +0000 (20:12 +0100)]
tests: let's make function tables static/const
Lennart Poettering [Mon, 5 Dec 2016 18:42:25 +0000 (19:42 +0100)]
core: add specifier expansion to ReadOnlyPaths= and friends
Expanding specifiers here definitely makes sense.
Also simplifies the loop a bit, as there's no reason to keep "prev" around...
Lennart Poettering [Mon, 5 Dec 2016 18:40:13 +0000 (19:40 +0100)]
core: add specifier expansion to RequiresMountsFor=
This might be useful for some people, for example to pull in mounts for paths
including the machine ID or hostname.
Lennart Poettering [Mon, 5 Dec 2016 18:38:39 +0000 (19:38 +0100)]
core: turn on specifier expansion for more unit file settings
Let's permit specifier expansion at a numbre of additional fields, where
arbitrary strings might be passed where this might be useful one day. (Or at
least where there's no clear reason where it wouldn't make sense to have.)
Lennart Poettering [Mon, 5 Dec 2016 18:25:44 +0000 (19:25 +0100)]
core: use unit_full_printf() at a couple of locations we used unit_name_printf() before
For settings that are not taking unit names there's no reason to use
unit_name_printf(). Use unit_full_printf() instead, as the names are validated
anyway in one form or another after expansion.
Lennart Poettering [Mon, 5 Dec 2016 18:12:54 +0000 (19:12 +0100)]
core: resolve more specifiers in unit_name_printf()
unit_name_printf() is usually what we use when the resulting string shall
qualify as unit name, and it hence avoids resolving specifiers that almost
certainly won't result in valid unit names.
Add a couple of more specifiers that unit_full_printf() resolves also to the
list unit_name_printf() resolves, as they are likely to be useful in valid unit
names too. (Note that there might be cases where this doesn't hold, but we
should still permit this, as more often than not they are safe, and if people
want to use them that way, they should be able to.)
Lennart Poettering [Mon, 5 Dec 2016 18:10:44 +0000 (19:10 +0100)]
man: drop reference to %U being useless
This paragraph was a missed left-over from
79413b673b45adc98dfeaec882bbdda2343cb2f9. Drop it now.
Lennart Poettering [Mon, 5 Dec 2016 17:56:25 +0000 (18:56 +0100)]
core: move specifier expansion out of service.c/socket.c
This monopolizes unit file specifier expansion in load-fragment.c, and removes
it from socket.c + service.c. This way expansion becomes an operation done exclusively at time of loading unit files.
Previously specifiers were resolved for all settings during loading of unit
files with the exception of ExecStart= and friends which were resolved in
socket.c and service.c. With this change the latter is also moved to the
loading of unit files.
Fixes: #3061
Lennart Poettering [Wed, 7 Dec 2016 17:36:08 +0000 (18:36 +0100)]
man: update the nspawn man page, and document what kind of dissection features we now support
Lennart Poettering [Wed, 7 Dec 2016 17:28:13 +0000 (18:28 +0100)]
nspawn/dissect: automatically discover dm-verity verity partitions
This adds support for discovering and making use of properly tagged dm-verity
data integrity partitions. This extends both systemd-nspawn and systemd-dissect
with a new --root-hash= switch that takes the root hash to use for the root
partition, and is otherwise fully automatic.
Verity partitions are discovered automatically by GPT table type UUIDs, as
listed in
https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
(which I updated prior to this change, to include new UUIDs for this purpose.
mkosi with https://github.com/systemd/mkosi/pull/39 applied may generate images
that carry the necessary integrity data. With that PR and this commit, the
following simply lines suffice to boot up an integrity-protected container image:
```
# mkdir test
# cd test
# mkosi --verity
# systemd-nspawn -i ./image.raw -bn
```
Note that mkosi writes the image file to "image.raw" next to a a file
"image.roothash" that contains the root hash. systemd-nspawn will look for that
file and use it if it exists, in case --root-hash= is not specified explicitly.
Lennart Poettering [Wed, 7 Dec 2016 16:42:40 +0000 (17:42 +0100)]
nspawn: when generating a machine name from an image name, truncate .raw suffix
Let's prettify the machine name we generate for image-based containers: let's
chop off the .raw suffix before using it as machine name.
Lennart Poettering [Mon, 5 Dec 2016 15:26:48 +0000 (16:26 +0100)]
dissect: add support for encrypted images
This adds support to the image dissector to deal with encrypted images (only
LUKS). Given that we now have a neatly isolated image dissector codebase, let's
add a new feature to it: support for automatically dealing with encrypted
images. This is then exposed in systemd-dissect and nspawn.
It's pretty basic: only support for passphrase-based encryption.
In order to ensure that "systemd-dissect --mount" results in mount points whose
backing LUKS DM devices are cleaned up automatically we use the DM_DEV_REMOVE
ioctl() directly on the device (in DM_DEFERRED_REMOVE mode). libgcryptsetup at
the moment doesn't provide a proper API for this. Thankfully, the ioctl() API
is pretty easy to use.
Lennart Poettering [Mon, 5 Dec 2016 15:09:04 +0000 (16:09 +0100)]
minor code beautifications
Lennart Poettering [Fri, 2 Dec 2016 18:32:09 +0000 (19:32 +0100)]
dissect: add small "systemd-dissect" tool as wrapper around dissect-image.c
This adds a small tool that may be used to look into OS images, and mount them
to any place. This is mostly a friendlier version of test-dissect-image.c. I am
not sure this should really become a proper command of systemd, hence for now
do not install it into bindir, but simply libexecdir.
This tool is already pretty useful since you can mount image files with it,
honouring the various partitions correctly. I figure this is going to become
more interesting if the dissctor learns luks and verity support.
Lennart Poettering [Fri, 2 Dec 2016 16:01:19 +0000 (17:01 +0100)]
util-lib: drop unnecessary NULL check
DEFINE_TRIVIAL_CLEANUP_FUNC() already does that check, no need to duplicate it.
Lennart Poettering [Thu, 1 Dec 2016 22:24:20 +0000 (23:24 +0100)]
machined: add API for querying the OS release of a machine image
This adds a bus call GetImageOSRelease() to the Manager interface that
retrieves the /etc/os-release file of a machine image. It matches the existing
GetMachineOSRelease() call, however operates on a disk image rather than a
running container.
The backend for this call on .raw images is implemented via the generalized
image dissector, which makes this scheme relatively easy to implement.
Lennart Poettering [Thu, 1 Dec 2016 22:19:31 +0000 (23:19 +0100)]
util-lib: add easy helpers for temporary directories that rmdir()ed via _cleanup_
This adds mkdtemp_malloc() that is a combination of mkdtemp() plus strdup(). It
initializes its return paremeter only if the temporary directory could be
created successfully, so that the parameter is exactly non-NULL when the
directory exists.
rmdir_and_free() and rmdir_and_freep() are also added, and the latter may be
used inside of _cleanup_ for such a directory string variable, to automatically
rmdir() the directory if it is non-NULL when the scope exits.
rmdir_and_free() is similar to the existing rm_rf_and_free() however, is only
removes a single directory and does not operate recursively.
Lennart Poettering [Thu, 1 Dec 2016 19:26:09 +0000 (20:26 +0100)]
nspawn: port nspawn to new generalized image dissection code
Let's make use of the new internal API. This mostly doesn't change anything for
the caller, however, "systemd-nspawn --image=/dev/sda7" works now as the new
code can handle disk images with no partition tables, and make any detected
images directly the root.
Lennart Poettering [Thu, 1 Dec 2016 19:25:26 +0000 (20:25 +0100)]
util-lib: split out image dissecting code and loopback code from nspawn
This adds two new APIs to systemd:
- loop-util.h is a simple internal API for allocating, setting up and releasing
loopback block devices.
- dissect-image.h is an internal API for taking apart disk images and figuring
out what the purpose of each partition is.
Both APIs are basically refactored versions of similar code in nspawn. This
rework should permit us to reuse this in other places than just nspawn in the
future. Specifically: to implement RootImage= in the service image, similar to
RootDirectory=, but operating on a disk image; to unify the gpt-auto-discovery
generator code with the discovery logic in nspawn; to add new API to machined
for determining the OS version of a disk image (i.e. not just running
containers). This PR does not make any such changes however, it just provides
the new reworked API.
The reworked code is also slightly more powerful than the nspawn original one.
When pointing it to an image or block device with a naked file system (i.e. no
partition table) it will simply make it the root device.
Lennart Poettering [Thu, 1 Dec 2016 17:15:43 +0000 (18:15 +0100)]
libudev: set errno if udev_new() fails
All other constructors in libudev do that, let's also do this for udev_new().
27o [Wed, 7 Dec 2016 01:00:05 +0000 (02:00 +0100)]
dhcp: bind udp sockets to interfaces (#4822)
Peter Hutterer [Tue, 6 Dec 2016 21:12:13 +0000 (07:12 +1000)]
Merge pull request #4841 from hadess/oke-barcode-reader
hwdb: Add fixed layout for a few devices
Doug Christman [Tue, 6 Dec 2016 19:41:15 +0000 (14:41 -0500)]
calendarspec: always interpret missing seconds as :00 (#4813)
"*:*" should be equivalent to "*-*-* *:*:00" (minutely)
rather than running every microsecond.
Fixes #4804
Jouke Witteveen [Tue, 6 Dec 2016 12:30:28 +0000 (13:30 +0100)]
service: go through stop_post on failure (#4770)
Jouke Witteveen [Tue, 6 Dec 2016 12:01:35 +0000 (13:01 +0100)]
man: fix $SERVICE_RESULT/$EXIT_CODE/$EXIT_STATUS documentation
Note that any exit code is available through $EXIT_STATUS and not through
$EXIT_CODE. This mimics siginfo.
Susant Sahani [Tue, 6 Dec 2016 11:22:33 +0000 (16:52 +0530)]
networkd: Use dhcp correct type for IP port (#4840)
Fixes: #4839
Susant Sahani [Tue, 6 Dec 2016 11:21:45 +0000 (16:51 +0530)]
core: introduce parse_ip_port (#4825)
1. Listed in TODO.
2. Tree wide replace safe_atou16 with parse_ip_port incase
it's used for ports.
Bastien Nocera [Tue, 6 Dec 2016 11:14:40 +0000 (12:14 +0100)]
hwdb: Add fixed layout for another Yubikey
Bastien Nocera [Tue, 6 Dec 2016 10:42:23 +0000 (11:42 +0100)]
hwdb: Add fixed layout for OKE barcode reader
Lennart Poettering [Tue, 6 Dec 2016 09:51:26 +0000 (10:51 +0100)]
time-util: accept "µs" as time unit, in addition to "us" (#4836)
Let's accept "µs" as alternative time unit for microseconds. We already accept
"us" and "usec" for them, lets extend on this and accept the proper scientific
unit specification too.
We will never output this as time unit, but it's fine to accept it, after all
we are pretty permissive with time units already.
Kieran Colford [Tue, 6 Dec 2016 09:46:13 +0000 (04:46 -0500)]
rules: consider MMC device partitions with partition number > 9 (#4831)
Add entries for extra partitions found on MMC devices (common in Chromebooks).
Evgeny Vereshchagin [Tue, 6 Dec 2016 03:51:55 +0000 (06:51 +0300)]
Merge pull request #4838 from phomes/misc-cleanup2
Misc cleanups
Thomas Hindoe Paaboel Andersen [Mon, 5 Dec 2016 23:07:34 +0000 (00:07 +0100)]
core: remove unused variable
Thomas Hindoe Paaboel Andersen [Mon, 5 Dec 2016 22:55:18 +0000 (23:55 +0100)]
udev: remove duplicate flag
One SA_RESTART is enough. Fall out from
e28c7cd0665364bb910fe2cead882623c23c28ac
Martin Ejdestig [Mon, 5 Dec 2016 22:42:41 +0000 (23:42 +0100)]
man: Document return value of event source prepare callback (#4834)
Evgeny Vereshchagin [Mon, 5 Dec 2016 17:14:05 +0000 (20:14 +0300)]
nspawn: don't hide --bind=/tmp/* mounts (#4824)
Fixes #4789
Susant Sahani [Mon, 5 Dec 2016 14:31:48 +0000 (20:01 +0530)]
networkd: link_enter_configured remove assert (#4800)
When we are in link_enter_configured we assume that the
link->state should be LINK_STATE_SETTING_ROUTES but in some
situation it's LINK_STATlE_SETTING_ADDRESSES.
Just ignore the wrong state.
Also since the return value not used any where
make link_enter_configured return type void.
Fixes: #4746
Franck Bui [Fri, 2 Dec 2016 17:40:10 +0000 (18:40 +0100)]
journal: make sure to initially populate the space info cache (#4807)
Make sure to populate the cache in cache_space_refresh() at least once
otherwise it's possible that the system boots fast enough (and the journal
flush service is finished) before the invalidate cache timeout (30 us) has
expired.
Fixes: #4790
Dave Reisner [Fri, 2 Dec 2016 14:23:23 +0000 (09:23 -0500)]
cgroup: properly check for ignore-notfound paths (#4803)
Follow-up to #4687 and
e7330dfe14b1965f.
Torstein Husebø [Fri, 2 Dec 2016 14:20:26 +0000 (15:20 +0100)]
treewide: fix typos (#4802)
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2016 14:14:27 +0000 (09:14 -0500)]
Merge pull request #4228 from dm0-/coreos-1554
networkd: support marking links unmanaged
Martin Pitt [Fri, 2 Dec 2016 07:48:37 +0000 (08:48 +0100)]
Merge pull request #4797 from keszybz/pylint
Python cleanups based on pylint advice
Zbigniew Jędrzejewski-Szmek [Thu, 1 Dec 2016 23:29:54 +0000 (18:29 -0500)]
python: use raw strings for regexp patterns
Behaviour is not changed, because "unknown" escapes like \s or \d were not
substituted, but it's much nicer to use raw strings to avoid ambiguity.
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2016 00:10:01 +0000 (19:10 -0500)]
hwdb_parse: adjust indentation and imports following pylint advice
(This commit is separate to make it easy to export to libinput.)
Zbigniew Jędrzejewski-Szmek [Thu, 1 Dec 2016 22:30:31 +0000 (17:30 -0500)]
python: adjust imports, indentation, unused variables following pylint advice
Zbigniew Jędrzejewski-Szmek [Thu, 1 Dec 2016 22:23:53 +0000 (17:23 -0500)]
acpi-update.py: there is no "Error" class
Evidently this code path was never hit, because we'd crash with NameError.
The exception message also seems bogus. So just replace the whole thing
with the standard exception for invalid input.
Tobias Stoeckmann [Thu, 1 Dec 2016 23:46:36 +0000 (00:46 +0100)]
Spot inconsistent quoting (just one single quote) (#4732)
It is possible to specify only one quote in udev rules, which is not
detected as an invalid quoting (" instead of "" for empty string).
Technically this doesn't lead to a bug, because the string ends in two
terminating nul characters at this position, but a user should still be
reminded that his configuration is invalid.
Susant Sahani [Thu, 1 Dec 2016 23:05:10 +0000 (04:35 +0530)]
networkd: VXLAN add better explanation for ARPProxy (#4781)
This closes #4768
David Michael [Tue, 27 Sep 2016 22:18:14 +0000 (15:18 -0700)]
networkd: support marking links unmanaged
David Michael [Thu, 3 Nov 2016 23:27:55 +0000 (16:27 -0700)]
networkd-test: define a utility class to simplify tests
Martin Pitt [Thu, 1 Dec 2016 21:22:47 +0000 (22:22 +0100)]
rules: add persistent links for nbd devices (#4785)
https://bugs.debian.org/837999
Yassine Imounachen [Thu, 1 Dec 2016 14:58:58 +0000 (14:58 +0000)]
Update boot.c (#4780)
Zbigniew Jędrzejewski-Szmek [Thu, 1 Dec 2016 14:29:14 +0000 (09:29 -0500)]
Merge pull request #4694 from poettering/chase-everywhere
tree-wide: stop using canonicalize_file_name(), use chase_symlinks() …
Martin Pitt [Thu, 1 Dec 2016 13:32:32 +0000 (14:32 +0100)]
Merge pull request #4778 from whot/xkb-fixed-layout
Xkb fixed layout
Lennart Poettering [Thu, 1 Dec 2016 11:49:23 +0000 (12:49 +0100)]
util-lib: rename CHASE_NON_EXISTING → CHASE_NONEXISTENT
As suggested by @keszybz
Lennart Poettering [Thu, 1 Dec 2016 11:40:23 +0000 (12:40 +0100)]
nspawn: improve log messages
When complaining about the inability to resolve a path, show the full path, not
just the relative one.
As suggested by @keszybz.
Lennart Poettering [Wed, 30 Nov 2016 17:57:42 +0000 (18:57 +0100)]
nspawn: optionally, automatically allocated --bind=/--overlay source from /var/tmp
This extends the --bind= and --overlay= syntax so that an empty string as source/upper
directory is taken as request to automatically allocate a temporary directory
below /var/tmp, whose lifetime is bound to the nspawn runtime. In combination
with the "+" path extension this permits a switch "--overlay=+/var::/var" in
order to use the container's shipped /var, combine it with a writable temporary
directory and mount it to the runtime /var of the container.
Lennart Poettering [Wed, 30 Nov 2016 15:02:47 +0000 (16:02 +0100)]
nspawn: permit prefixing of source paths in --bind= and --overlay= with "+"
If a source path is prefixed with "+" it is taken relative to the container's
root directory instead of the host. This permits easily establishing bind and
overlay mounts based on data from the container rather than the host.
This also reworks custom_mounts_prepare(), and turns it into two functions: one
custom_mount_check_all() that remains in nspawn.c but purely verifies the
validity of the custom mounts configured. And one called
custom_mount_prepare_all() that actually does the preparation step, sorts the
custom mounts, resolves relative paths, and allocates temporary directories as
necessary.
Lennart Poettering [Wed, 30 Nov 2016 14:07:43 +0000 (15:07 +0100)]
tree-wide: set SA_RESTART for signal handlers we install
We already set it in most cases, but make sure to set it in all others too, and
document that that's a good idea.
Lennart Poettering [Tue, 29 Nov 2016 22:55:04 +0000 (23:55 +0100)]
nspawn: add ability to configure overlay mounts to .nspawn files
Fixes: #4634
Peter Hutterer [Tue, 22 Nov 2016 05:21:24 +0000 (15:21 +1000)]
hwdb: add XKB_FIXED_LAYOUT/VARIANT to the keyboard hwdb
Yubikeys and other pseudo keyboards require that they are in the US layout,
otherwise the data they send is invalid. Add two new keys to signal this to
processes that handles (XKB) layouts.
Peter Hutterer [Tue, 22 Nov 2016 04:54:06 +0000 (14:54 +1000)]
hwdb: fix comment referring to rules file
60-keyboard.rules was renamed to 60-evdev.rules in
51c0c2869
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Lennart Poettering [Tue, 29 Nov 2016 22:47:58 +0000 (23:47 +0100)]
nspawn: split out overlayfs argument parsing into a function of its own
Add overlay_mount_parse() similar in style to tmpfs_mount_parse() and
bind_mount_parse().
Lennart Poettering [Tue, 29 Nov 2016 22:47:24 +0000 (23:47 +0100)]
nspawn: use -ENOMEM instead of log_oom() in one case
The function is of the "library" kind and doesn't log ENOMEM in all other
cases, hence fix the one outlier.
Lennart Poettering [Tue, 29 Nov 2016 17:16:43 +0000 (18:16 +0100)]
nspawn: make use of CHASE_NON_EXISTING when locking image
If --template= is used on an image, then the image might not exist initially.
We can use CHASE_NON_EXISTING to properly lock the image already before it
exists. Let's do so.
Lennart Poettering [Tue, 29 Nov 2016 17:13:11 +0000 (18:13 +0100)]
nspawn: use the new CHASE_NON_EXISTING flag when resolving mount points
This restores the ability to implicitly create files/directories to mount
specified mount points on.
Lennart Poettering [Tue, 29 Nov 2016 17:02:45 +0000 (18:02 +0100)]
fs-util: add new CHASE_NON_EXISTING flag to chase_symlinks()
This new flag controls whether to consider a problem if the referenced path
doesn't actually exist. If specified it's OK if the final file doesn't exist.
Note that this permits one or more final components of the path not to exist,
but these must not contain "../" for safety reasons (or, to be extra safe,
neither "./" and a couple of others, i.e. what path_is_safe() permits).
This new flag is useful when resolving paths before issuing an mkdir() or
open(O_CREAT) on a path, as it permits that the file or directory is created
later.
The return code of chase_symlinks() is changed to return 1 if the file exists,
and 0 if it doesn't. The latter is only returned in case CHASE_NON_EXISTING is
set.
Lennart Poettering [Tue, 29 Nov 2016 15:49:30 +0000 (16:49 +0100)]
fs-util: add flags parameter to chase_symlinks()
Let's remove chase_symlinks_prefix() and instead introduce a flags parameter to
chase_symlinks(), with a flag CHASE_PREFIX_ROOT that exposes the behaviour of
chase_symlinks_prefix().
Lennart Poettering [Tue, 29 Nov 2016 14:54:42 +0000 (15:54 +0100)]
fs-util: change chase_symlinks() behaviour in regards to escaping the root dir
Previously, we'd generate an EINVAL error if it is attempted to escape a root
directory with relative ".." symlinks. With this commit this is changed so that
".." from the root directory is a NOP, following the kernel's own behaviour
where /.. is equivalent to /.
As suggested by @keszybz.
Zbigniew Jędrzejewski-Szmek [Sun, 27 Nov 2016 03:18:58 +0000 (22:18 -0500)]
test-fs-util: add a test case with repeated ".." parts that would escape the root
Lennart Poettering [Fri, 25 Nov 2016 18:01:36 +0000 (19:01 +0100)]
nspawn: use chase_symlinks() on all paths specified via --tmpfs=, --bind= and so on
Fixes: #2860
Lennart Poettering [Fri, 25 Nov 2016 17:59:39 +0000 (18:59 +0100)]
fs-util: add chase_symlinks_prefix() and extend comments
chase_symlinks() currently expects a fully qualified, absolute path, relative
to the host's root as first argument. Which is useful in many ways, and similar
to the paths unlink(), rename(), open(), … expect. Sometimes it's however
useful to first prefix the specified path with the specified root directory.
Add a new call chase_symlinks_prefix() for this, that is a simple wrapper.
Lennart Poettering [Fri, 25 Nov 2016 17:59:06 +0000 (18:59 +0100)]
nspawn: coding style: don't mix variable declarations and function calls
Lennart Poettering [Fri, 25 Nov 2016 17:58:31 +0000 (18:58 +0100)]
nspawn: use realloc_multiply() where it makes sense
Lennart Poettering [Fri, 25 Nov 2016 00:00:31 +0000 (01:00 +0100)]
nspawn: accept --ephemeral --template= as alternative for --ephemeral --directory=
As suggested in PR #3667.
This PR simply ensures that --template= can be used as alternative to
--directory= when --ephemeral is used, following the logic that for ephemeral
options the source directory is actually a template.
This does not deprecate usage of --directory= with --ephemeral, as I am not
convinced the old logic wouldn't make sense.
Fixes: #3667
Lennart Poettering [Thu, 24 Nov 2016 20:03:36 +0000 (21:03 +0100)]
nspawn: properly handle image/directory paths that are symlinks
This resolves any paths specified on --directory=, --template=, and --image=
before using them. This makes sure nspawn can be used correctly on symlinked
images and directory trees.
Fixes: #2001
Lennart Poettering [Fri, 18 Nov 2016 20:35:21 +0000 (21:35 +0100)]
tree-wide: stop using canonicalize_file_name(), use chase_symlinks() instead
Let's use chase_symlinks() everywhere, and stop using GNU
canonicalize_file_name() everywhere. For most cases this should not change
behaviour, however increase exposure of our function to get better tested. Most
importantly in a few cases (most notably nspawn) it can take the correct root
directory into account when chasing symlinks.
Lennart Poettering [Mon, 28 Nov 2016 18:41:20 +0000 (19:41 +0100)]
core: make unit_free() accept NULL pointers
We generally try to make our destructors robust regarding NULL pointers, much
in the same way as glibc's free(). Do this also for unit_free().
Follow-up for #4748.
AsciiWolf [Wed, 30 Nov 2016 20:59:19 +0000 (21:59 +0100)]
l10n: update line numbers in Czech translation (#4776)
Franck Bui [Wed, 30 Nov 2016 17:27:42 +0000 (18:27 +0100)]
systemctl: fix 'is-enabled' exit status on failure when executed in chroot (#4773)