Commit Graph
17694 Commits
Author SHA1 Message Date
Michal Schmidt 0040552704 journal: optimize iteration: skip whole files behind current location
Interleaving of entries from many journal files is expensive. But there
is room for optimization.

We can skip looking into journal files whose entries all lie before the
current iterating location. We can tell if that's the case from looking
at the journal file header. This saves a huge amount of work if one has
many of mostly not interleaved journal files.

On my workstation with 90 journal files in /var/log/journal/ID/
totalling 3.4 GB I get these results:

Before:
$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null

real    5m54.258s
user    2m4.263s
sys     3m48.965s

After:
$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null

real    0m20.518s
user    0m19.989s
sys     0m0.328s

The high "sys" time in the original was caused by putting more stress on
the mmap-cache than it could handle. With the patch the working set
now consists of fewer mmap windows and mmap-cache is not thrashing.

(cherry picked from commit b7c88ab8cc)
2015-01-15 22:27:40 -05:00
WaLyong Cho 99752dd359 unit: update unit dropin paths and time when dropin file is written.
If a unit is set property by "systemctl set-property", a new dropin
file is generated. But the unit's dropin_paths and dropin_mtime are
not updated. So the unit is shown as need daemon reload.
Update unit dropin_paths and dropin_mtime also when dropin file is
written.

(cherry picked from commit adb76a701d)
2015-01-15 22:26:46 -05:00
Dan Winship b9c59587df libsystemd-network: fix writing of routes in dhcp lease file
inet_ntoa() uses a static buffer, so you can't call it twice in the
same fprintf() call.

(cherry picked from commit fbf7dcb588)
2015-01-15 22:25:35 -05:00
Wesley Dawson 5a43885aba journalctl: respect --after-cursor semantics with --follow in all cases
In the case where no entries have been added to the journal after the specified
cursor, set need_seek before the main loop to prevent display of the entry at
said cursor.

(cherry picked from commit 8ee8e53648)
2015-01-15 22:24:40 -05:00
Ross Lagerwall 2e1057e124 cgroup: Handle error when destroying cgroup
If a cgroup fails to be destroyed (most likely because there are still
processes running as part of a service after the main pid exits), don't
free and remove the cgroup unit from the manager.  This fixes a
regression introduced by the cgroup rework in v205 where systemd would
forget about processes still running after the unit becomes inactive.
(This can happen when the main pid exits and KillMode=process or none).

(cherry picked from commit dab5bf8599)

Conflicts:
	src/core/cgroup.c
2015-01-15 22:24:10 -05:00
Michael Marineau f91e7c6532 fstab-generator: Allow mount.usr without mount.usrflags, honor rw/ro
There is no need to require mount.usrflags. The original implementation
assumed that a btrfs subvolume would always be needed but that is not
applicable to systems that do not use btrfs for /usr.

Similar to using rootflags= for the default of mount.usrflags=, append
the classic 'ro' and 'rw' flags to the mount options.

(cherry picked from commit eb5800026d)
2015-01-15 22:22:56 -05:00
Lennart Poettering bbb43c5666 units: make sure container-getty@.service stops restarting when the pts device it is bound to is gone
We only want to restart the getty as long as the pts device is still
around. As soon as it is gone, the service should be removed to.

http://lists.freedesktop.org/archives/systemd-devel/2014-December/026048.html
(cherry picked from commit 68ac53e62f)
2015-01-15 22:22:34 -05:00
Olivier Brunel 709700887f journal: Fix navigating backwards missing entries
With DIRECTION_UP (i.e. navigating backwards) in generic_array_bisect() when the
needle was found as the last item in the array, it wasn't actually processed as
match, resulting in entries being missed.

https://bugs.freedesktop.org/show_bug.cgi?id=86855
(cherry picked from commit 2173cbf847)
2015-01-15 22:21:57 -05:00
Tom Gundersen e76544e97b sd-rtnl: fix bogus warning about dropping 20 bytes from multi-part messages
Nothing was being dropped, we just failed to account for the NLMSG_DONE.

(cherry picked from commit 0e707326fc)
2015-01-15 22:21:37 -05:00
Felipe Sateler fe1c5578e6 man: fix reference to obsolete command "systemctl dump"
https://bugs.freedesktop.org/show_bug.cgi?id=87020
(cherry picked from commit 030512b244)
2015-01-15 22:20:48 -05:00
Lennart Poettering 809b89b87b man: there's actually no "fail" fstab option, but only "nofail"
(cherry picked from commit deb6120920)
2015-01-15 22:20:29 -05:00
Marcel Holtmann 4b34a844de hwdb: Update database of Bluetooth company identifiers
(cherry picked from commit 9624f0c154)
2015-01-15 22:18:38 -05:00
Michal Sekletar a44b8d63d4 selinux: figure out selinux context applied on exec() before closing all fds
We need original socket_fd around otherwise mac_selinux_get_child_mls_label
fails with -EINVAL return code. Also don't call setexeccon twice but rather pass
context value of SELinuxContext option as an extra argument.

(cherry picked from commit 9008e1ac92)
2015-01-15 22:18:11 -05:00
Michal Sekletar 6c3f564c05 units: skip mounting /dev/hugepages if we don't have CAP_SYS_ADMIN
Preparation for allowing systemd to run gracefully in containers lacking
CAP_SYS_ADMIN.

(cherry picked from commit fe0b9cd3ba)
2015-01-15 22:17:54 -05:00
Michael Biebl 87452f45f1 vconsole: don't hard-code systemd-vconsole-setup binary path
(cherry picked from commit 3b0ed75c35)
2015-01-15 22:16:55 -05:00
Lennart Poettering b5a585d946 nspawn: correct EEXIST check when creating directory to mount /tmp in
https://bugs.freedesktop.org/show_bug.cgi?id=86309
(cherry picked from commit 04a9193940)

Conflicts:
	src/nspawn/nspawn.c
2015-01-15 22:15:53 -05:00
Lennart Poettering d5fd522652 libudev: set errno properly in all error conditions of udev_device_new_from_syspath()
(cherry picked from commit 154e6f233a)
2015-01-15 22:13:51 -05:00
Umut Tezduyar Lindskog a190bc1bd4 man: BusName= is not optional for Type!=bus
http://lists.freedesktop.org/archives/systemd-devel/2014-November/025492.html
(cherry picked from commit f4e9cdbc62)
2015-01-15 22:12:53 -05:00
Chris Atkinson b9be8fa63c man: delete ZX as sole compression; "Compress=" as boolean
In man journald.conf, removes reference to XZ as sole form of
compression. See commit d89c8fdf48.

In man coredump.conf, clarifies that "Compression=" controls existence,
not type, of compression.

(cherry picked from commit 442f7f1553)
2015-01-15 22:12:41 -05:00
Ross Lagerwall 22c6f3e58f cgroup-util: Don't send SIGCONT after SIGKILL
(cherry picked from commit dc8962da74)
2015-01-15 22:10:35 -05:00
Ronny Chevalier ef13fe7cbc man: document that we set both soft and hard limits for Limit directives
See
http://cgit.freedesktop.org/systemd/systemd/tree/src/core/load-fragment.c#n1100

(cherry picked from commit 6067b34a1f)
2015-01-15 22:10:10 -05:00
Ronny Chevalier a191513317 man: fix typos
(cherry picked from commit 536256fc91)
2015-01-15 22:09:56 -05:00
Ronny Chevalier 59f1e63be7 man: document equivalence between Limit directives and ulimit
See https://bugs.freedesktop.org/show_bug.cgi?id=80341

(cherry picked from commit b8825fff7b)
2015-01-15 22:09:49 -05:00
Chris Mayo cdc45292fb man: fix link to systemd-networkd-wait-online.service in systemd-networkd.service(8)
(cherry picked from commit da80c219d7)
2015-01-15 22:09:18 -05:00
Alison Chaiken 85061b0c53 delta: Fix broken separator support
systemd-delta man page promises that multiple types of deltas will be
concatenated if they are listed with a comma as separator.  Replace
FOREACH_WORD() with FOREACH_WORD_SEPARATOR() to restore the functionality.

(cherry picked from commit d0a2e1c364)
2015-01-15 22:08:39 -05:00
Chris Atkinson b93ea2decf man: update description of default extension for isolate
(cherry picked from commit 507e28d844)
2015-01-15 22:06:01 -05:00
Zbigniew Jędrzejewski-Szmek 0a5e13d4be delta: diff returns 1 when files differ, ignore this
https://bugs.debian/org/771397
(cherry picked from commit 820d3acfe9)

Conflicts:
	src/quotacheck/quotacheck.c
2015-01-15 22:05:54 -05:00
Tom Gundersen 9c521fc99e shared: install - report error if mask symlink can not be marked for removal
(cherry picked from commit 56e73b34ce)
2015-01-15 22:01:36 -05:00
Tom Gundersen 48da391c5e shared: time-dst - ensure nulstr is null terminated
Fixes CID #1237772.

(cherry picked from commit 681f9718ce)
2015-01-15 22:01:19 -05:00
Tom Gundersen 748231b3ac udev: rules - ignore the lack of trailing newline
Also accept '\r' as newline character.

This dropps warnings of the type:

  invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
  on line 26, starting at character 25 ('')

(cherry picked from commit 9f5ecdb0b1)
2015-01-15 21:59:51 -05:00
Tom Gundersen e521e552db udev: rules - print the first invalid character
The current code would print the character following the first invalid
character.

Given an udev rules-file without a trailing newline we would otherwise print
garbage:

  invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
  on line 26, starting at character 25 ('m')

This is now changed to print

  invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
  on line 26, starting at character 25 ('')

(still not very good as printing \0 just gives the empty string)

(cherry picked from commit 6501b52d35)
2015-01-15 21:59:51 -05:00
Tom Gundersen da8e1184c5 udev: rules - modernise add_rule a bit
(cherry picked from commit 84198c1892)
2015-01-15 21:59:51 -05:00
Peter Hutterer 954224a866 udevadm hwdb: discard extra leading whitespaces in hwdb
Currently a property in the form of
  FOO=bar
is stored as " FOO=bar", i.e. the property name contains a leading space.
That's quite hard to spot.

This patch discards all extra whitespaces but the first one which is required
by libudev's hwdb_add_property.

[zj: modify the check a bit]

https://bugs.freedesktop.org/show_bug.cgi?id=82311
(cherry picked from commit 36afca67b6)
2015-01-15 21:59:01 -05:00
Michal Schmidt e9d6d338e5 core: fix return value in error path after sd_event_add_io() failure
sd_event_add_io() does not set errno, it returns negative errno.

Noticed during log_*_errno conversions.

(cherry picked from commit 895b3a7b44)

Conflicts:
	src/core/manager.c
2015-01-15 21:57:29 -05:00
Zbigniew Jędrzejewski-Szmek 368add064e Revert "systemctl: append default suffix only if none present"
This reverts a chunk out of commit 5e03c6e3b5
which was trying to pass NULL to the the '.service' default. Anyway,
it seems better to be explicit.

(cherry picked from commit e80733be33)
2015-01-15 21:55:57 -05:00
Zbigniew Jędrzejewski-Szmek 2d686078fe systemctl: append default suffix only if none present
Simplify unit_name_mangle() and unit_name_mangle_with_suffix() to
always behave the same, and only append a suffix if there is no
type suffix. If a user says 'isolate blah.device' it is better to
return an error that the type cannot be isolated, than to try to
isolate blah.device.target.

(cherry picked from commit 5e03c6e3b5)
2015-01-15 21:55:34 -05:00
Martin Pitt d52dba7e3f hostnamectl: Exit with zero on success
In show_all_names(), bus_map_all_properties() returns 1 on success which is
then used as the return code of show_all_names() and eventually main(). Exit
with zero in main() on all nonnegative results to guard against similar errors.

(cherry picked from commit 5567fafbc9)
2015-01-15 21:54:58 -05:00
Zbigniew Jędrzejewski-Szmek 026e565b97 sysv-generator: advertise the man page
(cherry picked from commit aad0a2c800)
2015-01-15 21:52:32 -05:00
Zbigniew Jędrzejewski-Szmek 69527fc068 man: add systemd-sysv-generator(8)
In principle SysV stuff is only for compatibility, but we are stuck
with it for the forseeable future, so documentation might as well
be provided.

https://bugs.debian.org/771172
(cherry picked from commit f509443af5)
2015-01-15 21:52:12 -05:00
Ivan Shapovalov 6b16f733e9 unit-name: fix escaping logic in unit_name_mangle_with_suffix()
Make screened character set consistent with unit_name_mangle() by splitting off
the escaping loop into a separate function.

Before this fix, unit names such as `foo@bar.target` would get transformed
into `foo\x40bar.target` when unit_name_mangle_with_suffix() is used.

https://bugs.freedesktop.org/show_bug.cgi?id=86711
(cherry picked from commit 0c124f8b2c)
2015-01-15 21:48:09 -05:00
Andrej Manduch 4e1091e706 journalctl: print all possible lines immediately with --follow + --since
When I tryed to run journalctl with --follow and --since arguments it
behaved very strangely.
First It prints logs from what I specified in --since argument, then
printed 10 lines (as is default in --follow) and when app put something
new in to log journalctl printed everithing from the last printed line.

How to reproduce:
1. run: journalctl -m --since 14:00 --follow
Then you'll see 10 lines of logs since 14:00. After that wait until some
app add something in the journal or just run `systemd-cat echo test`
2. After that journalctl will print every single line since 14:00 and will
follow as expected.

As long as --since and --follow will eventually print all relevant
lines, I seen no reason why not to print them right away and not after
first new message in journal.

Relevant bugzillas:
        https://bugs.freedesktop.org/show_bug.cgi?id=71546
        https://bugs.freedesktop.org/show_bug.cgi?id=64291

(cherry picked from commit 70af7b8ada)
2015-01-15 21:47:27 -05:00
Zbigniew Jędrzejewski-Szmek b82afb1d84 swap: restore support for nofail
systemd stops adding automatic dependencies on swap.target to swap
units. If a dependency is required, it has to be added by unit
configuration. fstab-generator did that already, except that now it is
modified to create a Requires or Wants type dependency, depending on
whether nofail is specified in /etc/fstab. This makes .swap units
obey the nofail/noauto options more or less the same as .mount units.

Documentation is extended to clarify that, and to make
systemd.mount(5) and system.swap(5) more similar. The gist is not
changed, because current behaviour actually matches existing
documentation.

https://bugs.freedesktop.org/show_bug.cgi?id=86488
(cherry picked from commit 5607d856b8)
2015-01-15 21:28:27 -05:00
Michal Schmidt 52e53d5c1e core: fix assertion failure in checking a transaction with a JOB_NOP
Several functions called from transaction_activate() need to correctly
handle the case where a JOB_NOP job is being checked against a unit's
pending job. The assumption that JOB_NOP never merges with other job
types was correct, but since the job_type_is_*() functions are
implemented using the merge lookup, they need to special-case JOB_NOP
to avoid hitting assertion failures.

(cherry picked from commit 7e803f5ecf)
2015-01-15 21:25:39 -05:00
Tom Gundersen 8381c0eab7 resolved: fix typo in sd_notify() call
(cherry picked from commit b37d45c9ab)
2015-01-15 21:23:52 -05:00
Zbigniew Jędrzejewski-Szmek 9de44ece7d gpt-auto-generator: properly ignore value
A negative return code was treated as a true value.

(cherry picked from commit 8086ffacdb)
2015-01-15 21:22:06 -05:00
Zbigniew Jędrzejewski-Szmek fe74e6931e manager: only issue overmount warning when the check succeeded
If for any reason the check failed (selinux?), we would still issue
the warning. Check the return status.

(cherry picked from commit 056edeb910)
2015-01-15 21:03:51 -05:00
Lukas Nykryn e36091f179 dbus: return non-zero return value in the case that prefix won't match
strv_extend returns 0 in the case of success which means that
else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0)
        log_warning("Unknown serialization item '%s'", l);
will be printed when value is added correctly.

(cherry picked from commit f44b9efcec)
2015-01-15 21:03:08 -05:00
Zbigniew Jędrzejewski-Szmek 91d90659f7 man: reword list-dependencies description
The previous version was a bit too vague. It is better
to simply list all dependency types that are followed.

Previous version also made an emphasis on dependencies introduced by
configuration.  But this command (or systemd) don't care about this
distinction between configured and automatically added dependencies at
all. This distinctionis removed from the main description, and an
explanatory paragraph is added to remind the user that all
dependencies are shown, no matter where they come from.

(cherry picked from commit f6375e8376)
2015-01-15 21:02:24 -05:00
Zbigniew Jędrzejewski-Szmek b021aa55d5 systemctl: show BindsTo/BoundBy in list-dependencies
Suggested-by: Peter Mattern <matternp@arcor.de>

http://lists.freedesktop.org/archives/systemd-devel/2014-November/025437.html
(cherry picked from commit c469089cf6)
2015-01-15 21:02:09 -05:00
Richard Schütz 796d3d6e35 nspawn: ignore EEXIST when mounting tmpfs
commit 79d80fc146 introduced a regression that
prevents mounting a tmpfs if the mount point already exits in the container's
root file system. This commit fixes the problem by ignoring EEXIST.

(cherry picked from commit 6c2d07020f)
2015-01-15 21:01:48 -05:00