Lennart Poettering [Tue, 19 May 2015 15:56:44 +0000 (17:56 +0200)]
core: sd_bus_error() already checks for NULL, no need to duplicate check
Lennart Poettering [Tue, 19 May 2015 15:40:50 +0000 (17:40 +0200)]
core: reinstate propagation of stop/restart jobs via RequsiteOf dependencies
This reverts the primary effect of
be7d9ff730cb88d7c6a869dd5c47754c78ceaef2.
After all Requisite= should be close to Requires=, without the one
exception that it doesn't pull in dependencies on start. However,
reverse deps on stop/restart should be treated the same way as for
Restart=, and this is already documented in the man page, hence stick to
it.
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032049.html
Jan Synacek [Tue, 19 May 2015 12:26:09 +0000 (14:26 +0200)]
util: fix typo
Lennart Poettering [Tue, 19 May 2015 15:19:27 +0000 (17:19 +0200)]
mount: properly check for mounts currently in /proc/self/mountinfo
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032059.html
Lennart Poettering [Tue, 19 May 2015 14:57:33 +0000 (16:57 +0200)]
Update TODO
Lennart Poettering [Tue, 19 May 2015 14:41:14 +0000 (16:41 +0200)]
unit: drop support for pre-v44 job serialization
No distro ships that old systemd versions anyway, hence let's drop
support for live-upgrades for them. Offline updates are still supported.
And live-upgrades will only lose the job queue, hence basically still
work...
Lennart Poettering [Tue, 19 May 2015 14:23:14 +0000 (16:23 +0200)]
core: also enforce ratelimiter if we stop a unit due to BindsTo=
This extends on
bea355dac94e82697aa98e25d80ee4248263bf92, and extends
the ratelimiter to not only be used for StopWhenUnneeded=1 units but
also for units that have BindsTo= on a unit that is dead.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030224.html
Lennart Poettering [Tue, 19 May 2015 14:03:01 +0000 (16:03 +0200)]
core: use bitfield where possible
Lennart Poettering [Tue, 19 May 2015 14:02:51 +0000 (16:02 +0200)]
update TODO
Lennart Poettering [Tue, 19 May 2015 14:00:24 +0000 (16:00 +0200)]
core: enforce a ratelimiter when stopping units due to StopWhenUnneeded=1
Otherwise we might end up in an endless stop loop.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030224.html
Lennart Poettering [Tue, 19 May 2015 13:42:03 +0000 (15:42 +0200)]
unit: fix unit_check_unneeded() dependency iteration
Fixes a regression introduced in
be7d9ff730cb88d7c6a869dd5c47754c78ceaef2.
Lennart Poettering [Tue, 19 May 2015 11:50:36 +0000 (13:50 +0200)]
mount: don't claim a device is gone from /proc/self/mountinfo before it is gone from *all* lines
Devices might be referenced by multiple mount points in
/proc/self/mountinfo, hence we should consider them unmounted only after
they disappeared from all lines, not just from one.
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032026.html
Martin Pitt [Sun, 17 May 2015 13:07:47 +0000 (15:07 +0200)]
device: create units with intended "found" value
Change device_found_node() to also create a .device unit if a device is not
known by udev; this is the case for "tentative" devices picked up by mountinfo
(DEVICE_FOUND_MOUNT). With that we can record the "found" attribute on the
unit.
Change device_setup_unit() to also accept a NULL udev_device, and don't
add the extra udev information in that case.
Previously device_found_node() would not create a .device unit, and
unit_add_node_link() would then create a "dead" stub one via
manager_load_unit(), so we lost the "found" attribute and unmounted everything
from that device.
https://launchpad.net/bugs/1444402
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031658.html
Martin Pitt [Tue, 19 May 2015 05:49:56 +0000 (07:49 +0200)]
hostname: Allow comments in /etc/hostname
The hostname(1) tool allows comments in /etc/hostname. Introduce a new
read_hostname_config() in hostname-util which reads a hostname configuration
file like /etc/hostname, strips out comments, whitespace, and cleans the
hostname. Use it in hostname-setup.c and hostnamed and remove duplicated code.
Update hostname manpage. Add tests.
https://launchpad.net/bugs/1053048
Thomas Hindoe Paaboel Andersen [Tue, 19 May 2015 04:45:52 +0000 (06:45 +0200)]
core: fix OOM checks in dbus-unit
CID#1299014
Thomas Hindoe Paaboel Andersen [Tue, 19 May 2015 04:33:54 +0000 (06:33 +0200)]
test-hashmap: fix an assert
CID#1299016
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2015 02:34:07 +0000 (22:34 -0400)]
man: explain UseDomains a bit more
https://bugs.freedesktop.org/show_bug.cgi?id=85397
Lennart Poettering [Mon, 18 May 2015 23:32:40 +0000 (01:32 +0200)]
update TODO
Lennart Poettering [Mon, 18 May 2015 23:27:33 +0000 (01:27 +0200)]
update TODO
Lennart Poettering [Mon, 18 May 2015 23:24:28 +0000 (01:24 +0200)]
core: introduce seperate reverse dependencies for Requires= and Requisite=
This allows us to ensure that Requisite= dependencies never cause
propagation between units, while Requires= dependencies might.
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031742.html
Lennart Poettering [Mon, 18 May 2015 22:35:02 +0000 (00:35 +0200)]
journalctl: unify how we free boot id lists a bit
Instead of use LIST_FOREACH_SAFE, just use the same, seperate destructor
everywhere.
Lennart Poettering [Mon, 18 May 2015 22:25:45 +0000 (00:25 +0200)]
journalctl: clean up how we log errors
All functions should either log the errors they run into, or only return
them in which case the caller should log them.
Make sure this rule is followed, so that each error is logged precisely
once, and neither never, nor more than once.
Lennart Poettering [Mon, 18 May 2015 22:24:27 +0000 (00:24 +0200)]
journalctl: rename boot_id_t to BootId
So far we tried to reserve the _t suffix to types we use like a value in
contrast to types we use as objects, hence let's do this in journalctl
too.
Lennart Poettering [Mon, 18 May 2015 22:22:56 +0000 (00:22 +0200)]
journalctl: lstat() should suffice if we call canonicalize_file_name() first
Lennart Poettering [Mon, 18 May 2015 21:54:05 +0000 (23:54 +0200)]
journalctl: free all command line argument objects
let's try to be valgrind clean
Lennart Poettering [Mon, 18 May 2015 21:50:34 +0000 (23:50 +0200)]
journalctl: only have a single exit path from main()
That way we can be sure we execute the destructors properly, and can be
valgrind-clean.
Jan Janssen [Fri, 1 May 2015 13:15:16 +0000 (15:15 +0200)]
journalctl: Improve boot ID lookup
This method should greatly improve offset based lookup, by simply jumping
from one boot to the next boot. It starts at the journal head to get the
a boot ID, makes a _BOOT_ID match and then comes from the opposite
journal direction (tail) to get to the end that boot. After flushing the matches
and advancing the journal from that exact position, we arrive at the start
of next boot. Rinse and repeat.
This is faster than the old method of aggregating the full boot listing just
so we can jump to a specific boot, which can be a real pain on big journals
just for a mere "-b -1" case.
As an additional benefit --list-boots should improve slightly too, because
it does less seeking.
Note that there can be a change in boot order with this lookup method
because it will use the order of boots in the journal, not the realtime stamp
stored in them. That's arguably better, though.
Another deficiency is that it will get confused with boots interleaving in the
journal, therefore, it will refuse operation in --merge, --file and --directory mode.
https://bugs.freedesktop.org/show_bug.cgi?id=72601
Tom Gundersen [Mon, 18 May 2015 15:21:03 +0000 (17:21 +0200)]
udevd: main - use _exit() when daemonizing
Makes it a bit clearer what is going on, rather than jumping to the end of main().
No functional change.
Tom Gundersen [Mon, 18 May 2015 15:19:38 +0000 (17:19 +0200)]
udevd: main - reshuffle
First parse config, then sanitize environment before donig any further setup.
No functional change.
Tom Gundersen [Mon, 18 May 2015 15:18:46 +0000 (17:18 +0200)]
udevd: rename on_reque_{exit,reload} to on_sig{term,chld}
No functional change.
Tom Gundersen [Mon, 18 May 2015 15:17:07 +0000 (17:17 +0200)]
udevd: introduce on_event_timeout{,_warning}
This uses kill_and_sigcont() instead of kill(), otherwise no functional change.
Tom Gundersen [Mon, 18 May 2015 15:07:04 +0000 (17:07 +0200)]
udevd: process all SIGCHLD events every time the handler is invoked
We were returning rather than continuing in some cases. The intention
was always to fully process all pending events before returning
from the SIGCHLD handler. Restore this behaviour.
Tom Gundersen [Wed, 13 May 2015 09:39:45 +0000 (11:39 +0200)]
udevd: init/exit the builtins in manager_new/free
No functional change.
Tom Gundersen [Tue, 12 May 2015 19:16:47 +0000 (21:16 +0200)]
udevd: move file descriptors to Manager
No functional change.
Lennart Poettering [Mon, 18 May 2015 21:38:47 +0000 (23:38 +0200)]
resolved: allow DnsAnswer objects with no space for RRs
They might be created as result of merged answer sets, hence accept
them.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030834.html
Lennart Poettering [Mon, 18 May 2015 21:23:17 +0000 (23:23 +0200)]
resolved: fix crash when shutting down
Reported by Cristian Rodríguez
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031626.html
Alban Crequy [Mon, 18 May 2015 14:45:30 +0000 (16:45 +0200)]
nspawn: close extra fds before execing init
When systemd-nspawn gets exec*()ed, it inherits the followings file
descriptors:
- 0, 1, 2: stdin, stdout, stderr
- SD_LISTEN_FDS_START, ... SD_LISTEN_FDS_START+LISTEN_FDS: file
descriptors passed by the system manager (useful for socket
activation). They are passed to the child process (process leader).
- extra lock fd: rkt passes a locked directory as an extra fd, so the
directory remains locked as long as the container is alive.
systemd-nspawn used to close all open fds except 0, 1, 2 and the
SD_LISTEN_FDS_START..SD_LISTEN_FDS_START+LISTEN_FDS. This patch delays
the close just before the exec so the nspawn process (parent) keeps the
extra fds open.
This patch supersedes the previous attempt ("cloexec extraneous fds"):
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031608.html
Lennart Poettering [Mon, 18 May 2015 19:52:26 +0000 (21:52 +0200)]
ata_id: drop spurious space
Lennart Poettering [Mon, 18 May 2015 16:47:22 +0000 (18:47 +0200)]
CODING_STYLE: document that we should avoid kernel types like u32
Alban Crequy [Mon, 18 May 2015 10:20:28 +0000 (12:20 +0200)]
core: Private*/Protect* options with RootDirectory
When a service is chrooted with the option RootDirectory=/opt/..., then
the options PrivateDevices, PrivateTmp, ProtectHome, ProtectSystem must
mount the directories under $RootDirectory/{dev,tmp,home,usr,boot}.
The test-ns tool can test setup_namespace() with and without chroot:
$ sudo TEST_NS_PROJECTS=/home/lennart/projects ./test-ns
$ sudo TEST_NS_CHROOT=/home/alban/debian-tree TEST_NS_PROJECTS=/home/alban/debian-tree/home/alban/Documents ./test-ns
Lennart Poettering [Mon, 18 May 2015 15:27:37 +0000 (17:27 +0200)]
kmod-setup: conditionalize kmod autoloading properly
Load kdbus.ko only if we are built with kdbus, and load ip_tables.ko
only if we are built with iptables support.
Lennart Poettering [Mon, 18 May 2015 15:10:07 +0000 (17:10 +0200)]
util: split all hostname related calls into hostname-util.c
Lennart Poettering [Mon, 18 May 2015 14:35:24 +0000 (16:35 +0200)]
README: document that we prefer if CONFIG_CHECKPOINT_RESTORE is turned on, for the kcmp() syscall
Karel Zak [Mon, 18 May 2015 10:30:37 +0000 (12:30 +0200)]
fstab-generator: add x-systemd.requires and x-systemd.requires-mounts-for
Currently we have no way how to specify dependencies between fstab
entries (or another units) in the /etc/fstab. It means that users are
forced to bypass fstab and write .mount units manually.
The patch introduces new systemd fstab options:
x-systemd.requires=<PATH>
- to specify dependence an another mount (PATH is translated to unit name)
x-systemd.requires=<UNIT>
- to specify dependence on arbitrary UNIT
x-systemd.requires-mounts-for=<PATH ...>
- to specify dependence on another paths, implemented by
RequiresMountsFor=. The option may be specified more than once.
For example two bind mounts where B depends on A:
/mnt/test/A /mnt/test/A none bind,defaults
/mnt/test/A /mnt/test/B none bind,x-systemd.requires=/mnt/test/A
More complex example with overlay FS where one mount point depends on
"low" and "upper" directories:
/dev/sdc1 /mnt/low ext4 defaults
/dev/sdc2 /mnt/high ext4 defaults
overlay /mnt/merged overlay lowerdir=/mnt/low,upperdir=/mnt/high/data,workdir=/mnt/high/work,x-systemd.requires-mounts-for=/mnt/low,x-systemd.requires-mounts-for=mnt/high
https://bugzilla.redhat.com/show_bug.cgi?id=812826
https://bugzilla.redhat.com/show_bug.cgi?id=1164334
Mantas Mikulėnas [Mon, 18 May 2015 08:18:10 +0000 (11:18 +0300)]
buildsys: actually install 70-pointingstick.hwdb
Hans de Goede [Mon, 18 May 2015 07:54:00 +0000 (09:54 +0200)]
hwdb: Add trackpoint sensitivity setting for Thinkpad X230 tablet
This model needs the trackpoint sensitivity to be boosted to not be too slow
to be usable, see: https://bugzilla.redhat.com/show_bug.cgi?id=1200717
Eric Cook [Mon, 18 May 2015 05:02:43 +0000 (01:02 -0400)]
zsh-completion: make the arrays _sys_active_units, _sys_startable_units and _sys_restartable_units local to the completer.
Eric Cook [Mon, 18 May 2015 07:19:59 +0000 (03:19 -0400)]
zsh-completion: removing more pointless forks
I seem to have forgot about _systemctl_active_units().
Eric Cook [Mon, 18 May 2015 05:02:41 +0000 (01:02 -0400)]
zsh-completion: less forking in _systemctl_failed_units() and make the array `_sys_failed_units' local to the completer.
Eric Cook [Mon, 18 May 2015 05:02:40 +0000 (01:02 -0400)]
zsh-completion: less forking in _systemctl_get_template_names()
Eric Cook [Mon, 18 May 2015 05:02:39 +0000 (01:02 -0400)]
zsh-completion: actually complete template names for subcommands enable, reenable and disable.
compadd's -a option treats non-option arguments as arrays. So
$(_systemctl_get_template_names) expands to some words that aren't
legal array names. Even if there were, they would be empty; thus adding
nothing.
deduplicated a few functions too.
Eric Cook [Mon, 18 May 2015 05:02:38 +0000 (01:02 -0400)]
zsh-completion: actually run _filter_units_by_property when creating the arrays _sys_(re|)startable_units
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2015 04:58:24 +0000 (00:58 -0400)]
Use "new" --job-mode= option in more places
--irreversible/--ignore-dependencies/--fail are deprececated since
4dc5b821ae737914499119e29811fc3346e3d97c.
Also add shell completions for --jobs-mode.
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.