Zbigniew Jędrzejewski-Szmek [Sat, 16 May 2015 22:21:01 +0000 (18:21 -0400)]
load-fragment: put quotes around iffy rvalue
Zbigniew Jędrzejewski-Szmek [Sat, 16 May 2015 22:11:12 +0000 (18:11 -0400)]
Use fflush_and_check() in more places
Cristian Rodríguez [Sat, 16 May 2015 15:58:15 +0000 (12:58 -0300)]
buildsys: Remove X_SERVER from AM_CPPFLAGS
It is a leftover from multi-seat-x wrapper which is long
gone.
Lukas Rusak [Wed, 22 Apr 2015 18:07:39 +0000 (11:07 -0700)]
zsh-completion: add missing completions for systemd-nspawn
Lukas Rusak [Wed, 22 Apr 2015 18:07:38 +0000 (11:07 -0700)]
zsh-completion: update -M completion for systemd-analyze
Lukas Rusak [Wed, 22 Apr 2015 22:52:59 +0000 (15:52 -0700)]
zsh-completion: add missing completions for machinectl
Appologies, I'm still getting used to this mailing list thing and using git send-email
Tom Gundersen [Sat, 16 May 2015 08:14:20 +0000 (10:14 +0200)]
udevd: queue - update queue state when events are queued/freed
This way it is more obvious that the queue flag file is always
up-to-date. Moreover, we only have to touch/unlink it when the
first/last event is allocated/freed.
Tom Gundersen [Fri, 15 May 2015 23:12:21 +0000 (01:12 +0200)]
udevd: on_worker - distinguish between EINTR and EAGAIN
EAGAIN means there are no more messages to read, so give up. EINTR means we got interrupted
reading a message, so try again.
Tom Gundersen [Fri, 15 May 2015 09:41:36 +0000 (11:41 +0200)]
udevd: worker - use loop_write() rather than send()
When notifying the main daemon about event completion, make sure the message is sent
successfully, and not interrupted.
Tom Gundersen [Fri, 15 May 2015 23:07:45 +0000 (01:07 +0200)]
util: loop_write - accept 0-length message
write() can send empty messages, so make sure loop_write() can do the same.
Tom Gundersen [Fri, 15 May 2015 21:59:28 +0000 (23:59 +0200)]
udevd: net - fix leak in .link config
Path, Driver and Type are now strv rather than strings, so free them properly.
Tom Gundersen [Thu, 14 May 2015 13:30:52 +0000 (15:30 +0200)]
udev-ctrl: make _unref() always return NULL
Bring this in line with the rest of the codebase.
Tom Gundersen [Fri, 15 May 2015 20:59:24 +0000 (22:59 +0200)]
units: make networkd pull in its own .busname unit
The daemon requires the busname unit to operate (on kdbus systems),
since it contains the policy that allows it to acquire its service
name.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=90287
Lennart Poettering [Fri, 15 May 2015 19:48:20 +0000 (21:48 +0200)]
tmpfiles: use lstat() instead of stat() when checking whether a file system object already exists
Lennart Poettering [Fri, 15 May 2015 19:47:22 +0000 (21:47 +0200)]
tmpfiles: don't fail if we cannot create a subvolume because a file system is read-only but a dir already exists anyway
https://bugs.freedesktop.org/show_bug.cgi?id=90281
Lennart Poettering [Fri, 15 May 2015 19:34:14 +0000 (21:34 +0200)]
CODING_STYLE: document that EXIT_FAILURE and EXIT_SUCCESS should be used
Lennart Poettering [Fri, 15 May 2015 19:06:40 +0000 (21:06 +0200)]
CODING_STYLE: document best practices when initializing structs
Lennart Poettering [Fri, 15 May 2015 18:56:55 +0000 (20:56 +0200)]
coredump: make sure we vacuum by default
Only if both keep_free and max_use are actually 0 we can shortcut things
and avoid vacuuming. If either are positive or -1 we need to execute the
vacuuming.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031382.html
Lennart Poettering [Fri, 15 May 2015 18:15:59 +0000 (20:15 +0200)]
socket-util: socket_address_parse() should not log errors on its own
Given that socket_address_parse() is mostly a "library" call it
shouldn't log on its own, but leave that to its caller.
This patch removes logging from the call in case IPv6 is not available
but and IPv6 address shall be parsed. Instead a new call
socket_address_parse_and_warn() is introduced which first invokes
socket_address_parse() and then logs if necessary.
This should fix "make check" on ipv6-less kernels:
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031385.html
Martin Pitt [Thu, 14 May 2015 07:06:40 +0000 (09:06 +0200)]
core: Fix assertion with empty Exec*= paths
An Exec*= line with whitespace after modifiers, like
ExecStart=- /bin/true
is considered to have an empty command path. This is as specified, but causes
systemd to crash with
Assertion 'skip < l' failed at ../src/core/load-fragment.c:607, function config_parse_exec(). Aborting.
Aborted (core dumped)
Fix this by logging an error instead and ignoring the invalid line.
Add corresponding test cases. Also add a test case for a completely empty value
which resets the command list.
https://launchpad.net/bugs/1454173
Cristian Rodríguez [Fri, 15 May 2015 16:26:18 +0000 (13:26 -0300)]
timedate: fix memory leak in timedated
$ /usr/lib/systemd/systemd-timedated (wait until auto-exit)
=================================================================
==396==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 928 byte(s) in 1 object(s) allocated from:
#0 0x7f782f788db1 in __interceptor_calloc (/usr/lib64/libasan.so.2+0x96db1)
#1 0x562a83ae60cf in bus_message_from_header src/libsystemd/sd-bus/bus-message.c:480
#2 0x562a83ae6f5a in bus_message_from_malloc src/libsystemd/sd-bus/bus-message.c:576
#3 0x562a83ad3cad in bus_socket_make_message src/libsystemd/sd-bus/bus-socket.c:915
#4 0x562a83ad4cfc in bus_socket_read_message src/libsystemd/sd-bus/bus-socket.c:1051
#5 0x562a83ab733f in bus_read_message src/libsystemd/sd-bus/sd-bus.c:1647
#6 0x562a83ab98ea in sd_bus_call src/libsystemd/sd-bus/sd-bus.c:2038
#7 0x562a83b1f46d in sd_bus_call_method src/libsystemd/sd-bus/bus-convenience.c:94
#8 0x562a83aab3e1 in context_read_ntp src/timedate/timedated.c:192
#9 0x562a83aae1af in main src/timedate/timedated.c:730
#10 0x7f782eb238c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
Indirect leak of 77 byte(s) in 1 object(s) allocated from:
#0 0x7f782f788f6a in realloc (/usr/lib64/libasan.so.2+0x96f6a)
#1 0x562a83ad418a in bus_socket_read_message src/libsystemd/sd-bus/bus-socket.c:963
#2 0x562a83ab733f in bus_read_message src/libsystemd/sd-bus/sd-bus.c:1647
#3 0x562a83ab98ea in sd_bus_call src/libsystemd/sd-bus/sd-bus.c:2038
#4 0x562a83b1f46d in sd_bus_call_method src/libsystemd/sd-bus/bus-convenience.c:94
#5 0x562a83aab3e1 in context_read_ntp src/timedate/timedated.c:192
#6 0x562a83aae1af in main src/timedate/timedated.c:730
#7 0x7f782eb238c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
Indirect leak of 2 byte(s) in 1 object(s) allocated from:
#0 0x7f782f75493f in strdup (/usr/lib64/libasan.so.2+0x6293f)
#1 0x562a83b0229b in bus_message_parse_fields src/libsystemd/sd-bus/bus-message.c:5382
#2 0x562a83ae7290 in bus_message_from_malloc src/libsystemd/sd-bus/bus-message.c:601
#3 0x562a83ad3cad in bus_socket_make_message src/libsystemd/sd-bus/bus-socket.c:915
#4 0x562a83ad4cfc in bus_socket_read_message src/libsystemd/sd-bus/bus-socket.c:1051
#5 0x562a83ab733f in bus_read_message src/libsystemd/sd-bus/sd-bus.c:1647
#6 0x562a83ab98ea in sd_bus_call src/libsystemd/sd-bus/sd-bus.c:2038
#7 0x562a83b1f46d in sd_bus_call_method src/libsystemd/sd-bus/bus-convenience.c:94
#8 0x562a83aab3e1 in context_read_ntp src/timedate/timedated.c:192
#9 0x562a83aae1af in main src/timedate/timedated.c:730
#10 0x7f782eb238c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
SUMMARY: AddressSanitizer: 1007 byte(s) leaked in 3 allocation(s).
This is due to missing _cleanup_bus_message_unref_ in context_read_ntp()
Łukasz Stelmach [Fri, 15 May 2015 15:12:16 +0000 (17:12 +0200)]
.gitignore: add GNU GLOBAL files
Lennart Poettering [Fri, 15 May 2015 15:06:59 +0000 (17:06 +0200)]
generator: use fflush_and_check() where appropriate
Davide Bettio [Fri, 15 May 2015 14:36:28 +0000 (16:36 +0200)]
core: don't consider umask for SocketMode=
https://bugs.freedesktop.org/show_bug.cgi?id=89248
Lennart Poettering [Fri, 15 May 2015 13:47:37 +0000 (15:47 +0200)]
CODING_STYLE: document alloca() DONTS
Dimitri John Ledkov [Fri, 15 May 2015 10:44:22 +0000 (11:44 +0100)]
core: Execute first boot presets in an enable-only preset-mode.
This means any existing enabled units well be preserved and no
pre-created symlinks will be removed. This is done on first boot, when
the assumption is that /etc is not populated at all (no machine-id
setup). For minimal containers that gives a significant first boot
speed up, approximately ~20ms / ~16% in my trials.
Lennart Poettering [Fri, 15 May 2015 10:20:36 +0000 (12:20 +0200)]
networkd: don't try to turn on ipv6 forwarding if kernel lacks IPv6 support
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031598.html
Benedikt Morbach [Sun, 10 May 2015 18:32:14 +0000 (20:32 +0200)]
man: IPMasquerade only implies IPForward=ipv4
at least that's what the code does.
Benedikt Morbach [Sun, 10 May 2015 18:52:40 +0000 (20:52 +0200)]
networkd: don't touch global forwarding setting
This reverts commit
43c6d5abacaebf813845934ec8d5e5ee3c431854
(and a small part of
4046d8361c55c80ab8577aea52523b9e6eab0d0c)
It turns out we don't actually need to set the global ip_forward setting.
The only relevant setting is the one on each interface.
What the global toggle actually does is switch forwarding on/off for all
currently present interfaces and change the default for new ones.
That means that by setting the global ip_forward we
- Introduce a race condition, because if the interface with IPForward=yes
is brought up after one with IPForward=no, both will have forwarding
enabled, because the global switch turns it on for all interfaces.
If the other interface comes up first networkd correctly sets forward=0
and it doesn't get overridden.
- Change the forwarding setting for interfaces that networkd is not
configured to touch, even if the user disabled forwarding via sysctl,
either globally or per-interface
As forwarding works fine without this, as long as all relevant interfacest
individually set IPForward=yes: just drop it
This means that non-networkd interfaces use the global default while
networkd interfaces default to off if IPForward isn't given.
Jan Synacek [Fri, 15 May 2015 07:54:10 +0000 (09:54 +0200)]
systemctl: introduce --now for enable, disable and mask
https://bugs.freedesktop.org/show_bug.cgi?id=42940
Stefan Junker [Thu, 14 May 2015 20:51:05 +0000 (22:51 +0200)]
nspawn: allow access to device nodes listed in --bind= and --bind-ro= switches
https://bugs.freedesktop.org/show_bug.cgi?id=90385
Lennart Poettering [Thu, 14 May 2015 20:41:19 +0000 (22:41 +0200)]
test-bus-chat: various modernizations
Cristian Rodríguez [Sun, 10 May 2015 01:14:09 +0000 (22:14 -0300)]
sd-bus: fix memory leak in test-bus-chat
Building with address sanitizer enabled on GCC 5.1.x a memory leak
is reported because we never close the bus, fix it by using
cleanup variable attribute.
Lennart Poettering [Thu, 14 May 2015 20:32:35 +0000 (22:32 +0200)]
units: fix typo in systemd-resolved.service
There's no network.service unit, we actually mean network.target here.
Reported by Fco. Eduardo Ramírez.
Lennart Poettering [Thu, 14 May 2015 09:30:59 +0000 (11:30 +0200)]
util: introduce memmem_safe() and make use of it
GNU memmem() requires a nonnull first parameter. Let's introduce
memmem_safe() that removes this restriction for zero-length parameters,
and make use of it where appropriate.
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031705.html
Lennart Poettering [Thu, 14 May 2015 09:30:14 +0000 (11:30 +0200)]
util: use GNU comparison function prototype for qsort_safe()
Thomas Hindoe Paaboel Andersen [Wed, 13 May 2015 21:41:34 +0000 (23:41 +0200)]
networkd: remove dead initialization
Lennart Poettering [Wed, 13 May 2015 16:30:14 +0000 (18:30 +0200)]
core: only set event source name when we create an event source
Peter Lemenkov [Tue, 12 May 2015 11:45:33 +0000 (14:45 +0300)]
journal: fix size comment
Looks like sizeof(struct Header) is 240 not 224
Lennart Poettering [Wed, 13 May 2015 15:42:10 +0000 (17:42 +0200)]
util: add generic calls for prefixing a root directory to a path
So far a number of utilities implemented their own calls for this, unify
them in prefix_root() and prefix_roota(). The former uses heap memory,
the latter allocates from the stack via alloca().
Port over most users of a --root= logic.
Lennart Poettering [Wed, 13 May 2015 14:34:02 +0000 (16:34 +0200)]
core: make exec code a bit more readable
Let's add a function that checks whether we need fs namespacing, to make
things easier to read, instead of using a humungous if expression...
Cristian Rodríguez [Tue, 12 May 2015 02:30:38 +0000 (23:30 -0300)]
core: fix memory leak in manager_run_generators()
If systemd is built with GCC address sanitizer or leak sanitizer
the following memory leak ocurs:
May 12 02:02:46 linux.site systemd[326]: =================================================================
May 12 02:02:46 linux.site systemd[326]: ==326==ERROR: LeakSanitizer: detected memory leaks
May 12 02:02:46 linux.site systemd[326]: Direct leak of 101 byte(s) in 3 object(s) allocated from:
May 12 02:02:46 linux.site systemd[326]: #0 0x7fd1f504993f in strdup (/usr/lib64/libasan.so.2+0x6293f)
May 12 02:02:46 linux.site systemd[326]: #1 0x55d6ffac5336 in strv_new_ap src/shared/strv.c:163
May 12 02:02:46 linux.site systemd[326]: #2 0x55d6ffac56a9 in strv_new src/shared/strv.c:185
May 12 02:02:46 linux.site systemd[326]: #3 0x55d6ffa80272 in generator_paths src/shared/path-lookup.c:223
May 12 02:02:46 linux.site systemd[326]: #4 0x55d6ff9bdb0f in manager_run_generators src/core/manager.c:2828
May 12 02:02:46 linux.site systemd[326]: #5 0x55d6ff9b1a10 in manager_startup src/core/manager.c:1121
May 12 02:02:46 linux.site systemd[326]: #6 0x55d6ff9a78e3 in main src/core/main.c:1667
May 12 02:02:46 linux.site systemd[326]: #7 0x7fd1f394e8c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
May 12 02:02:46 linux.site systemd[326]: Direct leak of 29 byte(s) in 1 object(s) allocated from:
May 12 02:02:46 linux.site systemd[326]: #0 0x7fd1f504993f in strdup (/usr/lib64/libasan.so.2+0x6293f)
May 12 02:02:46 linux.site systemd[326]: #1 0x55d6ffac5288 in strv_new_ap src/shared/strv.c:152
May 12 02:02:46 linux.site systemd[326]: #2 0x55d6ffac56a9 in strv_new src/shared/strv.c:185
May 12 02:02:46 linux.site systemd[326]: #3 0x55d6ffa80272 in generator_paths src/shared/path-lookup.c:223
May 12 02:02:46 linux.site systemd[326]: #4 0x55d6ff9bdb0f in manager_run_generators src/core/manager.c:2828
May 12 02:02:46 linux.site systemd[326]: #5 0x55d6ff9b1a10 in manager_startup src/core/manager.c:1121
May 12 02:02:46 linux.site systemd[326]: #6 0x55d6ff9a78e3 in main src/core/main.c:1667
May 12 02:02:46 linux.site systemd[326]: #7 0x7fd1f394e8c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
May 12 02:02:46 linux.site systemd[326]: SUMMARY: AddressSanitizer: 130 byte(s) leaked in 4 allocation(s).
There is a leak due to the the use of cleanup_free instead _cleanup_strv_free_
Iago López Galeiras [Wed, 13 May 2015 13:45:49 +0000 (15:45 +0200)]
nspawn: skip symlink to a combined cgroup hierarchy if it already exists
If a symlink to a combined cgroup hierarchy already exists and points to
the right path, skip it. This avoids an error when the cgroups are set
manually before calling nspawn.
Iago López Galeiras [Wed, 13 May 2015 13:45:48 +0000 (15:45 +0200)]
nspawn: only mount the cgroup root if it's not already mounted
This allows the user to set the cgroups manually before calling nspawn.
Dimitri John Ledkov [Wed, 13 May 2015 13:43:04 +0000 (14:43 +0100)]
Default to /usr/bin/u?mount, configurable, rather than hard-coded /bin/u?mount.
Lennart Poettering [Wed, 13 May 2015 12:40:37 +0000 (14:40 +0200)]
core: never create device depencies for /dev/root mounts
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031658.html
Lennart Poettering [Wed, 13 May 2015 12:04:55 +0000 (14:04 +0200)]
nspawn: rework custom mount point order, and add support for overlayfs
Previously all bind mount mounts were applied in the order specified,
followed by all tmpfs mounts in the order specified. This is
problematic, if bind mounts shall be placed within tmpfs mounts.
This patch hence reworks the custom mount point logic, and alwas applies
them in strict prefix-first order. This means the order of mounts
specified on the command line becomes irrelevant, the right operation
will always be executed.
While we are at it this commit also adds native support for overlayfs
mounts, as supported by recent kernels.
Cristian Rodríguez [Mon, 11 May 2015 18:37:47 +0000 (15:37 -0300)]
modules-load: fix memory leak
=================================================================
==64281==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x7f623c961c4a in malloc (/usr/lib64/libasan.so.2+0x96c4a)
#1 0x5651f79ad34e in malloc_multiply (/home/crrodriguez/scm/systemd/systemd-modules-load+0x2134e)
#2 0x5651f79b02d6 in strjoin (/home/crrodriguez/scm/systemd/systemd-modules-load+0x242d6)
#3 0x5651f79be1f5 in files_add (/home/crrodriguez/scm/systemd/systemd-modules-load+0x321f5)
#4 0x5651f79be6a3 in conf_files_list_strv_internal (/home/crrodriguez/scm/systemd/systemd-modules-load+0x326a3)
#5 0x5651f79bea24 in conf_files_list_nulstr (/home/crrodriguez/scm/systemd/systemd-modules-load+0x32a24)
#6 0x5651f79ad01a in main (/home/crrodriguez/scm/systemd/systemd-modules-load+0x2101a)
#7 0x7f623c11586f in __libc_start_main (/lib64/libc.so.6+0x2086f)
SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).
This happens due to the wrong cleanup attribute is used (free vs strv_free)
Cristian Rodríguez [Mon, 11 May 2015 18:01:37 +0000 (15:01 -0300)]
shared: Use O_EXCL with O_TMPFILE in open_tmpfile
In this usecase, the file will never be materialized
with linkat().
Thomas Hindoe Paaboel Andersen [Tue, 28 Apr 2015 18:59:36 +0000 (20:59 +0200)]
fsck: add enum with fsck exit codes
Tom Gundersen [Tue, 12 May 2015 17:06:33 +0000 (19:06 +0200)]
udevd: manager - move a few global variables into the Manager object
Tom Gundersen [Tue, 12 May 2015 16:37:04 +0000 (18:37 +0200)]
udevd: pass a Manager objcet to event handlers
Stop relying on global variables in event handlers, and move them
all to a Manager object instead.
Kay Sievers [Tue, 12 May 2015 15:58:59 +0000 (17:58 +0200)]
boot: function parameters are separated by comma
Tom Gundersen [Tue, 12 May 2015 15:21:51 +0000 (17:21 +0200)]
core: drop redundant logging about notification messages
Before:
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message for unit.
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message from PID 195 (READY=1)
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Ggot READY=1
After:
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message from PID 195 (READY=1)
Tom Gundersen [Tue, 12 May 2015 14:57:01 +0000 (16:57 +0200)]
udevd: remove stale comment
Tom Gundersen [Tue, 12 May 2015 14:55:29 +0000 (16:55 +0200)]
udevd: explicitly update queue file before answering to ping
This avoids updating the flag files twice for every loop, and also removes another dependency
in the main-loop, so we are freer to reshufle it as we want.
Tom Gundersen [Tue, 12 May 2015 14:51:31 +0000 (16:51 +0200)]
udevd: explicitly read out uevents we create ourselves
Rather than skippling ctrl handling whenever we have handlede inotify events
(and hence may have synthesized a 'change' event), just call the uevent
handling explicitly from on_inotify() so that the event queue is up-to-date.
Tom Gundersen [Tue, 12 May 2015 12:54:52 +0000 (14:54 +0200)]
udevd: move to sd-event-style event handlers
Tom Gundersen [Mon, 11 May 2015 22:22:29 +0000 (00:22 +0200)]
networkd: network_get - allow udev_device to be NULL
In containers we never have udev devices, so drop the assert.
This fixes an assertion introduced in
af3aa302741b6edb0729925febb5f8bc26721fe3.
Tom Gundersen [Mon, 11 May 2015 20:17:49 +0000 (22:17 +0200)]
udevd: make udev_ctrl_connection global
This allows us to simplify the ctrl_msg handler. Eventually all this global state should move to
a Manager object or so.
Thomas Hindoe Paaboel Andersen [Mon, 11 May 2015 21:52:29 +0000 (23:52 +0200)]
systemctl: fix check for template units
A typo from
7410616c. We want to ignore EINVAL but only catch errors.
Lennart Poettering [Mon, 11 May 2015 20:56:31 +0000 (22:56 +0200)]
update TODO
Lennart Poettering [Mon, 11 May 2015 20:53:54 +0000 (22:53 +0200)]
install: when exporting prefix InstallInfo to become UnitFileInstallInfo
All other types exported from install.h should be namespaces like this,
hence namespace InstallInfo the same way.
Also, remove external forward definition of UnitFileScope type.
Lennart Poettering [Mon, 11 May 2015 20:51:49 +0000 (22:51 +0200)]
core: rename SystemdRunningAs to ManagerRunningAs
It's primarily just a property of the Manager object after all, and we
try to refer to PID 1 as "manager" instead of "systemd", hence let's to
stick to this here too.
Lennart Poettering [Mon, 11 May 2015 20:28:52 +0000 (22:28 +0200)]
unit: move unit_warn_if_dir_nonempty() and friend to unit.c
The call is only used by the mount and automount unit types, but that's
already enough to consider it generic unit functionality, hence move it
out of mount.c and into unit.c.
Lennart Poettering [Mon, 11 May 2015 18:38:21 +0000 (20:38 +0200)]
core,network: major per-object logging rework
This changes log_unit_info() (and friends) to take a real Unit* object
insted of just a unit name as parameter. The call will now prefix all
logged messages with the unit name, thus allowing the unit name to be
dropped from the various passed romat strings, simplifying invocations
drastically, and unifying log output across messages. Also, UNIT= vs.
USER_UNIT= is now derived from the Manager object attached to the Unit
object, instead of getpid(). This has the benefit of correcting the
field for --test runs.
Also contains a couple of other logging improvements:
- Drops a couple of strerror() invocations in favour of using %m.
- Not only .mount units now warn if a symlinks exist for the mount
point already, .automount units do that too, now.
- A few invocations of log_struct() that didn't actually pass any
additional structured data have been replaced by simpler invocations
of log_unit_info() and friends.
- For structured data a new LOG_UNIT_MESSAGE() macro has been added,
that works like LOG_MESSAGE() but prefixes the message with the unit
name. Similar, there's now LOG_LINK_MESSAGE() and
LOG_NETDEV_MESSAGE().
- For structured data new LOG_UNIT_ID(), LOG_LINK_INTERFACE(),
LOG_NETDEV_INTERFACE() macros have been added that generate the
necessary per object fields. The old log_unit_struct() call has been
removed in favour of these new macros used in raw log_struct()
invocations. In addition to removing one more function call this
allows generated structured log messages that contain two object
fields, as necessary for example for network interfaces that are
joined into another network interface, and whose messages shall be
indexed by both.
- The LOG_ERRNO() macro has been removed, in favour of
log_struct_errno(). The latter has the benefit of ensuring that %m in
format strings is properly resolved to the specified error number.
- A number of logging messages have been converted to use
log_unit_info() instead of log_info()
- The client code in sysv-generator no longer #includes core code from
src/core/.
- log_unit_full_errno() has been removed, log_unit_full() instead takes
an errno now, too.
- log_unit_info(), log_link_info(), log_netdev_info() and friends, now
avoid double evaluation of their parameters
Lennart Poettering [Mon, 11 May 2015 18:13:37 +0000 (20:13 +0200)]
core: always initialize ExecParamters.bus_endpoint_fd to -1
Otherwise it might be passed in as 0, which is a valid fd, but usually
does not refer to a real endpoint.
Lennart Poettering [Mon, 11 May 2015 20:08:28 +0000 (22:08 +0200)]
units: order nspawn containers after network.target
This way we know that any bridges and other user-created network devices
are in place, and can be properly added to the container.
In the long run this should be dropped, and replaced by direct calls
inside nspawn that cause the devices to be created when necessary.
Lennart Poettering [Mon, 11 May 2015 18:09:58 +0000 (20:09 +0200)]
util: optimize free_and_strdup() if NOP
Under the assumption that strcmp() is cheaper than memory allocation,
let's avoid the allocation, if the new value is identical to the old.
Lennart Poettering [Thu, 7 May 2015 21:37:32 +0000 (14:37 -0700)]
nspawn: pass on kill signal setting to contaner scope
Let's just pass on what the user set for us.
Lennart Poettering [Thu, 7 May 2015 21:33:12 +0000 (14:33 -0700)]
update TODO
Thomas Hindoe Paaboel Andersen [Mon, 11 May 2015 19:41:31 +0000 (21:41 +0200)]
test-libudev: fix leak in error case
CID# 1297428
Thomas Hindoe Paaboel Andersen [Mon, 11 May 2015 19:01:51 +0000 (21:01 +0200)]
swap: avoid null pointer dereference
CID#1297436
Torstein Husebø [Mon, 11 May 2015 11:49:29 +0000 (13:49 +0200)]
treewide: Correct typos and spell plural of bus consistent
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2015 05:09:53 +0000 (01:09 -0400)]
Generate systemd-fsck-root.service in the initramfs
In the initrafms, generate a systemd-fsck-root.service to replace
systemd-fsck@<sysroot-device>.service. This way, after we transition
to the real root, systemd-fsck-root.service is marked as already done.
This introduces an unnecessary synchronization point, because
systemd-fsck@* is ordered after systemd-fsck-root also in the
initramfs. In practice this shouldn't be a problem.
https://bugzilla.redhat.com/show_bug.cgi?id=1201979
C.f.
956eaf2b8d6c9999024705ddadc7393bc707de02.
Zbigniew Jędrzejewski-Szmek [Sat, 9 May 2015 23:46:15 +0000 (19:46 -0400)]
man: fix typos in previous comimt
Zbigniew Jędrzejewski-Szmek [Sat, 9 May 2015 21:20:51 +0000 (16:20 -0500)]
man: document forwarding to syslog better
https://bugzilla.redhat.com/show_bug.cgi?id=1147651
Cristian Rodríguez [Sat, 9 May 2015 17:08:43 +0000 (14:08 -0300)]
buildsys: *_la_CPPFLAGS takes $(AM_CPPFLAGS) not $(AM_CFLAGS)
Thomas Hindoe Paaboel Andersen [Thu, 7 May 2015 05:26:34 +0000 (07:26 +0200)]
udevd: remove unused function
Tom Gundersen [Wed, 6 May 2015 21:36:36 +0000 (23:36 +0200)]
udevd: don't explicitly count the number of workers
Simply query the size of the hashmap keeping all the worker contexts instead.
Tom Gundersen [Wed, 6 May 2015 21:26:25 +0000 (23:26 +0200)]
udevd: keep workers in a hashmap rather than a list
This makes the code somewhat more readable.
Tom Gundersen [Mon, 27 Apr 2015 09:43:31 +0000 (11:43 +0200)]
udevd: worker - drop reference counting
Make the worker context have the same life-span as the worker process. It is created on fork()
and free'd on SIGCHLD.
The change means that we can get worker_returned() for a worker context that is no longer around,
this is not a problem and we can just drop the message. The only use for worker_returned() is to
know to reschedule events to workers that are still around, so if the worker has already exited
it is not important to keep track of. We still print a debug statement in this case to be on the
safe side.
Thomas Hindoe Paaboel Andersen [Wed, 6 May 2015 17:56:29 +0000 (19:56 +0200)]
device: avoid null pointer dereference
David Herrmann [Wed, 6 May 2015 16:59:03 +0000 (18:59 +0200)]
udev: fix weird coding-style
Eeeew!
Thomas Hindoe Paaboel Andersen [Wed, 6 May 2015 16:37:06 +0000 (18:37 +0200)]
test-libudev: add error handling
CID#1296244
Tom Gundersen [Wed, 6 May 2015 15:36:39 +0000 (17:36 +0200)]
udevd: worker - allow passing NULL to worker_unref()
Tom Gundersen [Tue, 21 Apr 2015 13:53:10 +0000 (15:53 +0200)]
udevd: worker - use _exit() rather than exit()
Follow the coding style and avoid the exit handlers.
Tom Gundersen [Mon, 27 Apr 2015 12:56:21 +0000 (14:56 +0200)]
udevd: modernize error handling
We never return magic exit codes, but just EXIT_FAILUER or EXIT_SUCCESS.
Tom Gundersen [Fri, 17 Apr 2015 21:18:24 +0000 (23:18 +0200)]
udevd: use kernel cmdline parser
Tom Gundersen [Mon, 27 Apr 2015 10:14:38 +0000 (12:14 +0200)]
udevd: worker - move some fields from the worker to the event
Tom Gundersen [Mon, 27 Apr 2015 09:33:41 +0000 (11:33 +0200)]
udevd: worker - introduce worker_attach_event()
Tom Gundersen [Mon, 27 Apr 2015 09:26:47 +0000 (11:26 +0200)]
udevd: worker - make refcounting clearer
Take and drop explicit references where it makes sense.
Tom Gundersen [Mon, 27 Apr 2015 09:11:58 +0000 (11:11 +0200)]
udevd: worker - only allocate the worker struct in the main process
This is not used in the worker, so avoid having to free it there.
Tom Gundersen [Mon, 27 Apr 2015 09:08:38 +0000 (11:08 +0200)]
udevd: rename worker_new() to worker_spawn()
Tom Gundersen [Sat, 25 Apr 2015 23:40:12 +0000 (01:40 +0200)]
udevd: don't track worker exitcode
We used to use this to track failed events so they could be retriggered,
but that is no longer done, so the code can be dropped.
David Herrmann [Wed, 6 May 2015 16:29:41 +0000 (18:29 +0200)]
Update TODO
Susant Sahani [Wed, 6 May 2015 06:15:13 +0000 (11:45 +0530)]
udev: fix coding style
Daniel Buch [Wed, 6 May 2015 08:28:08 +0000 (10:28 +0200)]
systemctl: null-initialize pointer with cleanup attribute
Thomas Hindoe Paaboel Andersen [Wed, 6 May 2015 16:23:11 +0000 (18:23 +0200)]
machinectl: remove unused variable
David Herrmann [Wed, 6 May 2015 16:18:43 +0000 (18:18 +0200)]
bus: don't switch to kdbus if not requested
Whenever systemd is re-executed, it tries to create a system bus via
kdbus. If the system did not have kdbus loaded during bootup, but the
module is loaded later on manually, this will cause two system buses
running (kdbus and dbus-daemon in parallel).
This patch makes sure we never try to create kdbus buses if it wasn't
explicitly requested on the command-line.