diff options
-rw-r--r-- | .dir-locals.el | 15 | ||||
-rw-r--r-- | .editorconfig | 7 | ||||
-rw-r--r-- | .vimrc | 12 | ||||
-rw-r--r-- | NEWS | 155 | ||||
-rw-r--r-- | catalog/systemd.catalog | 1 | ||||
-rw-r--r-- | man/systemd-resolved.service.xml | 4 | ||||
-rw-r--r-- | src/basic/time-util.c | 5 | ||||
-rw-r--r-- | src/basic/time-util.h | 2 | ||||
-rw-r--r-- | src/core/dbus-unit.c | 6 | ||||
-rw-r--r-- | src/core/transaction.c | 14 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/bus-common-errors.c | 2 | ||||
-rw-r--r-- | units/basic.target | 9 |
12 files changed, 203 insertions, 29 deletions
diff --git a/.dir-locals.el b/.dir-locals.el index 9388bd66c2..3e1b2d76c0 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -2,13 +2,22 @@ ; A list of (major-mode . ((var1 . value1) (var2 . value2))) ; Mode can be nil, which gives default values. +; Note that we set a line width of 119 for .c and XML files, but for everything +; else (such as journal catalog files, unit files, README files) we stick to a +; more conservative 79 characters. + +; NOTE: If you update this file make sure to update .vimrc and .editorconfig, +; too. + ((nil . ((indent-tabs-mode . nil) (tab-width . 8) - (fill-column . 119))) - (c-mode . ((c-basic-offset . 8) + (fill-column . 79))) + (c-mode . ((fill-column . 119) + (c-basic-offset . 8) (eval . (c-set-offset 'substatement-open 0)) (eval . (c-set-offset 'statement-case-open 0)) (eval . (c-set-offset 'case-label 0)) (eval . (c-set-offset 'arglist-intro '++)) (eval . (c-set-offset 'arglist-close 0)))) - (nxml-mode . ((nxml-child-indent . 2)))) + (nxml-mode . ((nxml-child-indent . 2) + (fill-column . 119)))) diff --git a/.editorconfig b/.editorconfig index 70b6c0f139..e98007c4e8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,10 @@ # EditorConfig configuration for systemd # http://EditorConfig.org -# top-most EditorConfig file +# NOTE: If you update this file make sure to update .dir-locals.el and .vimrc, +# too. + +# Top-most EditorConfig file root = true # Unix-style newlines with a newline ending every file, utf-8 charset @@ -11,7 +14,7 @@ insert_final_newline = true trim_trailing_whitespace = true charset = utf-8 -# match config files, set indent to spaces with width of eight +# Match config files, set indent to spaces with width of eight [*.{c,h}] indent_style = space indent_size = 8 @@ -3,8 +3,18 @@ " vimrc configuration file, including write operations and shell execution. " You should consider setting 'set secure' as well, which is highly " recommended! + +" Note that we set a line width of 119 for .c and XML files, but for everything +" else (such as journal catalog files, unit files, README files) we stick to a +" more conservative 79 characters. + +" NOTE: If you update this file make sure to update .dir-locals.el and +" .editorconfig, too. + set tabstop=8 set shiftwidth=8 set expandtab set makeprg=GCC_COLORS=\ make -set tw=119 +set tw=79 +au FileType xml set tw=119 +au FileType c set tw=119 @@ -2,12 +2,159 @@ systemd System and Service Manager CHANGES WITH 229: - * Creation of the legacy /run/lock/lockdev/ directory was - dropped from tmpfiles.d/legacy.conf. Hardly any software uses - that any more, and better locking mechanisms like flock() have + * The systemd-resolved DNS resolver service has gained a substantial + set of new features, most prominently it may now act as a DNSSEC + validating stub resolver. DNSSEC mode is currently turned off by + default, but it is expected that this is turned on by default in one + of the next releases. For now, we invite everybody to test the DNSSEC + logic by setting DNSSEC=allow-downgrade in + /etc/systemd/resolved.conf. The service also gained a full set of + D-Bus interfaces, including calls to configure DNS and DNSSEC + settings per link (for consumption by external network management + software). systemd-resolved (and systemd-networkd along with it) now + know to distinguish between "search" and "routing" domains. The + former are used to qualify single-label names, the latter are purely + used for routing lookups within certain domains to specific + links. resolved will now also synthesize RRs for all entries from + /etc/hosts. + + * The systemd-resolve tool (which is a client utility for + systemd-resolved, and previously experimental) has been beefed up + considerably and is now fully supported and documented. It has moved + from /usr/lib/systemd to /usr/bin because. + + * /dev/disk/by-path/ symlink support has been (re-)added for virtio + devices. + + * The systemd-activate socket activation testing tool gained support + for SOCK_DGRAM and SOCK_SEQPACKET sockets using the new --datagram + and --seqpacket switches. It also has been extended to support both + new-style and inetd-style file descriptor passing. Use the new + --inetd switch to request inetd-style file descriptor passing. + + * Most systemd tools now honour a new $SYSTEMD_COLORS environment + variable, which takes a boolean value. If set to false ANSI color + output is disabled in the tools even when run on a terminal that + supports it. + + * The VXLAN support in networkd now supports two new settings + DestinationPort= and PortRange=. + + * A new systemd.machine_id= kernel command line switch has been added, + that may be used to set the machine ID in /etc/machine-id if it is + not initialized yet. This command line option has no effect if the + file is already initialized. + + * systemd-nspawn gained a new --as-pid2 switch that invokes any + specified command line as PID 2 rather than PID 1 in the + container. In this mode PID 1 will be a minimal stub init process + that implements the special POSIX and Linux semantics of PID 1 + regarding signal and child process management. Note that this stub + init process is implemented in nspawn itself and requires no support + from the container image. This new logic is useful to support running + arbitrary command lines in the container, as normal processes are + generally not prepared to run as PID 1. + + * systemd-nspawn gained a new --chdir= switch for setting the current + working directory for the process started in the container. + + * "journalctl /dev/sda" will now output all kernel log messages from + the specified device, in addition to all devices that are parents of + it. This should make log output about devices pretty useful, as long + as kernel drivers attach enough metadata to the log messages. (The + usual SATA drivers do.) + + * The sd-journal API gained two new calls + sd_journal_has_runtime_files() and sd_journal_has_persistent_files() + that report whether log data from /run or /var has been found. + + * journalctl gained a new switch "--fields" that prints all journal + record field names currently in use in the journal. This is backed + by two new sd-journal API calls sd_journal_enumerate_fields() and + sd_journal_restart_fields(). + + * Most configurable timeouts in systemd now expect an argument of + "infinity" to turn them off, instead of "0" as before. This follows + of a logic where a timeout of "0" means "now", and one of "infinity" + means "never". For compatibility where this was supported before 0 + continues to be accepted to turn off timeouts. + + * "systemctl reload-or-try-restart" has been renamed to "systemctl + try-reload-or-restart" to make clearer what it actually does, and + indicate that the "try" logic applies to both reloading and + restarting and not just restarting. The old name continues to be + accepted for compatibility. + + * On boot-up when PID 1 detects that the system clock is before the + release date of the systemd version in use, the clock is now bumped + ahead to it. Previously, this was already done in timesyncd, in order + to avoid running with clocks set to the various clock epochs such as + 1902, 1938 or 1970. With this change the logic is now done in PID 1 + in addition to timesyncd during early boot-up, so that it is enforced + before the first process is spawned by systemd. Note that the logic + in timesyncd remains, as it is more comprehensive and ensures + montonic clocks by maintaining a persistant timestamp file in + /var. Since /var is generally not available in earliest boot or the + initrd, this part of the logic remains in timesyncd, and is not done + by PID 1. + + * A new service setting RuntimeMaxSec= has been added that may be used + to specify a maximum runtime for a service. If the timeout is hit the + service is terminated and put into a failure state. + + * A new service setting AmbientCapabilities= has been added, that + allows configuration of additional Linux process capabilities that + are passed to the activated processes. This is only available on very + recent kernels. + + * The process resource limit settings in service units may now be used + to configure hard and soft limits individually. + + * The various libsystemd APIs such as sd-bus or sd-event now publically + expose support for gcc's __attribute__((cleanup())) C + extension. Specifically, for many object destructor functions + alternative versions whose names are suffixed with "p" and take a + pointer to a pointer to the object to destroy instead of just a + pointer to the object itself have been added. This is useful because + these destructor functions may be used directly as parameters to the + cleanup construct. Internally, systemd has been a heavy user of the + GCC extension since a long time, and with this change similar support + is now available to consumers of the library outside of systemd. Note + of course, that by using this extension in your sources compatibility + with old and strictly ANSI compatible C compilers is lost. However, + any gcc or LLVM version of the last years has been supporting this + extension just fine. + + * Timer units gained support for a new setting RandomizedDelaySec= that + allows configuring an amount of additional randomized delay to add + to the time a timer elapses. This is useful to distribute timer + events over a time range to avoid load peaks in clusters or larger + setups. + + * Calendar time specifications now support sub-second accuracy. + + * Socket units now support listening on SCTP and UDP-lite protocol + sockets. + + * The sd-event API now comes with a full set of man pages. + + * Older versions of systemd contained experimental support for + compressing journal files and coredumps with the LZ4 compressor that + was not compatible with the lz4 binary (due to API limitations of the + lz4 library). This support has been removed; only support for files + compatible with the lz4 binary remains. This LZ4 logic is now + officially supported and no longer considered experimental. + + * The dkr image import logic has been removed again from importd. dkr's + micro-services focus doesn't fit into the machine image focus of + importd, and quickly got out of date with the upstream dkr API. + + * Creation of the /run/lock/lockdev/ directory was dropped from + tmpfiles.d/legacy.conf. Better locking mechanisms like flock() have been available for many years. If you still need this, you need to create your own tmpfiles.d config file with: - d /run/lock/lockdev 0775 root lock - + + d /run/lock/lockdev 0775 root lock - Contributions from: ... diff --git a/catalog/systemd.catalog b/catalog/systemd.catalog index 1025590681..077f182a5a 100644 --- a/catalog/systemd.catalog +++ b/catalog/systemd.catalog @@ -1,4 +1,3 @@ -# -*- fill-column: 79; indent-tabs-mode: nil -*- # This file is part of systemd. # # Copyright 2012 Lennart Poettering diff --git a/man/systemd-resolved.service.xml b/man/systemd-resolved.service.xml index 4e144b5c98..1b63afdded 100644 --- a/man/systemd-resolved.service.xml +++ b/man/systemd-resolved.service.xml @@ -135,6 +135,10 @@ <para>Note that <filename>/run/systemd/resolve/resolv.conf</filename> should not be used directly by applications, but only through a symlink from <filename>/etc/resolv.conf</filename>.</para> + + <para>See the <ulink url="http://www.freedesktop.org/wiki/Software/systemd/resolved"> resolved D-Bus API + Documentation</ulink> for information about the APIs <filename>systemd-resolved</filename> provides.</para> + </refsect1> <refsect1> diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 3f3863910b..efb415fc35 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -42,6 +42,8 @@ #include "strv.h" #include "time-util.h" +static nsec_t timespec_load_nsec(const struct timespec *ts); + usec_t now(clockid_t clock_id) { struct timespec ts; @@ -116,7 +118,6 @@ dual_timestamp* dual_timestamp_from_boottime_or_monotonic(dual_timestamp *ts, us return ts; } - usec_t timespec_load(const struct timespec *ts) { assert(ts); @@ -132,7 +133,7 @@ usec_t timespec_load(const struct timespec *ts) { (usec_t) ts->tv_nsec / NSEC_PER_USEC; } -nsec_t timespec_load_nsec(const struct timespec *ts) { +static nsec_t timespec_load_nsec(const struct timespec *ts) { assert(ts); if (ts->tv_sec == (time_t) -1 && diff --git a/src/basic/time-util.h b/src/basic/time-util.h index 080c1110f5..4b4b2a2f5e 100644 --- a/src/basic/time-util.h +++ b/src/basic/time-util.h @@ -92,8 +92,6 @@ struct timespec *timespec_store(struct timespec *ts, usec_t u); usec_t timeval_load(const struct timeval *tv) _pure_; struct timeval *timeval_store(struct timeval *tv, usec_t u); -nsec_t timespec_load_nsec(const struct timespec *ts) _pure_; - char *format_timestamp(char *buf, size_t l, usec_t t); char *format_timestamp_utc(char *buf, size_t l, usec_t t); char *format_timestamp_us(char *buf, size_t l, usec_t t); diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 47f8ba5362..a3da7455e6 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -1270,10 +1270,10 @@ int bus_unit_check_load_state(Unit *u, sd_bus_error *error) { * possible. Note that in the case of UNIT_MASKED, load_error * is not set. */ if (u->load_state == UNIT_MASKED) - return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit is masked."); + return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit %s is masked.", u->id); if (u->load_state == UNIT_NOT_FOUND) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit not found."); + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s not found.", u->id); - return sd_bus_error_set_errnof(error, u->load_error, "Unit is not loaded properly: %m."); + return sd_bus_error_set_errnof(error, u->load_error, "Unit %s is not loaded properly: %m.", u->id); } diff --git a/src/core/transaction.c b/src/core/transaction.c index 0d53e4bac0..00d88f1b6c 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -912,7 +912,7 @@ int transaction_add_job_and_dependencies( SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUIRES], i) { r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, true, false, false, ignore_order, e); if (r < 0) { - if (r != -EBADR) + if (r != -EBADR) /* job type not applicable */ goto fail; sd_bus_error_free(e); @@ -922,7 +922,7 @@ int transaction_add_job_and_dependencies( SET_FOREACH(dep, ret->unit->dependencies[UNIT_BINDS_TO], i) { r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, true, false, false, ignore_order, e); if (r < 0) { - if (r != -EBADR) + if (r != -EBADR) /* job type not applicable */ goto fail; sd_bus_error_free(e); @@ -932,9 +932,9 @@ int transaction_add_job_and_dependencies( SET_FOREACH(dep, ret->unit->dependencies[UNIT_WANTS], i) { r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, false, false, false, ignore_order, e); if (r < 0) { - /* unit masked and unit not found are not considered as errors. */ + /* unit masked, job type not applicable and unit not found are not considered as errors. */ log_unit_full(dep, - r == -EBADR || r == -ENOENT ? LOG_DEBUG : LOG_WARNING, + IN_SET(r, -ESHUTDOWN, -EBADR, -ENOENT) ? LOG_DEBUG : LOG_WARNING, r, "Cannot add dependency job, ignoring: %s", bus_error_message(e, r)); sd_bus_error_free(e); @@ -944,7 +944,7 @@ int transaction_add_job_and_dependencies( SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUISITE], i) { r = transaction_add_job_and_dependencies(tr, JOB_VERIFY_ACTIVE, dep, ret, true, false, false, ignore_order, e); if (r < 0) { - if (r != -EBADR) + if (r != -EBADR) /* job type not applicable */ goto fail; sd_bus_error_free(e); @@ -954,7 +954,7 @@ int transaction_add_job_and_dependencies( SET_FOREACH(dep, ret->unit->dependencies[UNIT_CONFLICTS], i) { r = transaction_add_job_and_dependencies(tr, JOB_STOP, dep, ret, true, true, false, ignore_order, e); if (r < 0) { - if (r != -EBADR) + if (r != -EBADR) /* job type not applicable */ goto fail; sd_bus_error_free(e); @@ -999,7 +999,7 @@ int transaction_add_job_and_dependencies( r = transaction_add_job_and_dependencies(tr, nt, dep, ret, true, false, false, ignore_order, e); if (r < 0) { - if (r != -EBADR) + if (r != -EBADR) /* job type not applicable */ goto fail; sd_bus_error_free(e); diff --git a/src/libsystemd/sd-bus/bus-common-errors.c b/src/libsystemd/sd-bus/bus-common-errors.c index e344b3b77b..9bea1d479c 100644 --- a/src/libsystemd/sd-bus/bus-common-errors.c +++ b/src/libsystemd/sd-bus/bus-common-errors.c @@ -39,7 +39,7 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_common_errors[] = { SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, EDEADLK), SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, EDEADLK), SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, EDEADLK), - SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_MASKED, EBADR), + SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_MASKED, ESHUTDOWN), SD_BUS_ERROR_MAP(BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, EBADR), SD_BUS_ERROR_MAP(BUS_ERROR_NO_ISOLATION, EPERM), SD_BUS_ERROR_MAP(BUS_ERROR_SHUTTING_DOWN, ECANCELED), diff --git a/units/basic.target b/units/basic.target index e0e1e604f8..3e3527f894 100644 --- a/units/basic.target +++ b/units/basic.target @@ -10,8 +10,11 @@ Description=Basic System Documentation=man:systemd.special(7) Requires=sysinit.target Wants=sockets.target timers.target paths.target slices.target -After=sysinit.target sockets.target paths.target slices.target +After=sysinit.target sockets.target paths.target slices.target tmp.mount # We support /var, /tmp, /var/tmp, being on NFS, but we don't pull in -# remote-fs.target by default, hence explicitly pull /var in here. -RequiresMountsFor=/var /tmp /var/tmp +# remote-fs.target by default, hence pull them in explicitly here. Note that we +# require /var and /var/tmp, but only add a Wants= type dependency on /tmp, as +# we support that unit being masked, and this should not be considered an error. +RequiresMountsFor=/var /var/tmp +Wants=tmp.mount |