]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 years agoRemove snapshot unit type 1841/head
Zbigniew Jędrzejewski-Szmek [Sun, 8 Nov 2015 13:12:54 +0000 (14:12 +0100)] 
Remove snapshot unit type

Snapshots were never useful or used for anything. Many systemd
developers that I spoke to at systemd.conf2015, didn't even know they
existed, so it is fairly safe to assume that this type can be deleted
without harm.

The fundamental problem with snapshots is that the state of the system
is dynamic, devices come and go, users log in and out, timers fire...
and restoring all units to some state from the past would "undo"
those changes, which isn't really possible.

Tested by creating a snapshot, running the new binary, and checking
that the transition did not cause errors, and the snapshot is gone,
and snapshots cannot be created anymore.

New systemctl says:
Unknown operation snapshot.
Old systemctl says:
Failed to create snapshot: Support for snapshots has been removed.

IgnoreOnSnaphost settings are warned about and ignored:
Support for option IgnoreOnSnapshot= has been removed and it is ignored

http://lists.freedesktop.org/archives/systemd-devel/2015-November/034872.html

10 years agoMerge pull request #1835 from poettering/grabbag-of-stuff
Daniel Mack [Tue, 10 Nov 2015 20:01:35 +0000 (21:01 +0100)] 
Merge pull request #1835 from poettering/grabbag-of-stuff

Lots of small fixes

10 years agoMerge pull request #1785 from ssahani/word
Lennart Poettering [Tue, 10 Nov 2015 18:55:30 +0000 (19:55 +0100)] 
Merge pull request #1785 from ssahani/word

core: unit deps port to extract_first_word

10 years agoMerge pull request #1834 from filbranden/testexecute2
Lennart Poettering [Tue, 10 Nov 2015 18:49:51 +0000 (19:49 +0100)] 
Merge pull request #1834 from filbranden/testexecute2

test-execute: Fix systemd escaping and shell issues (v2)

10 years agoMerge pull request #1793 from filbranden/extract1
Lennart Poettering [Tue, 10 Nov 2015 18:43:09 +0000 (19:43 +0100)] 
Merge pull request #1793 from filbranden/extract1

More refactorings in extract_first_word

10 years agoMerge pull request #1783 from vcaputo/still_make_progress_when_throttling
Lennart Poettering [Tue, 10 Nov 2015 18:33:27 +0000 (19:33 +0100)] 
Merge pull request #1783 from vcaputo/still_make_progress_when_throttling

core: still make progress when throttling the manager loop

10 years agoMerge pull request #1812 from evverx/test-fixes
Lennart Poettering [Tue, 10 Nov 2015 18:31:22 +0000 (19:31 +0100)] 
Merge pull request #1812 from evverx/test-fixes

tests: various fixes

10 years agotests: various fixes 1812/head
Evgeny Vereshchagin [Sun, 8 Nov 2015 22:00:34 +0000 (22:00 +0000)] 
tests: various fixes

* remove journal flushing (systemd-journal-flush.service runs journalctl --flush on boot)
* use sh -c and PATH instead of @SYSTEMCTL@ expansion
* remove unnecessary semicolons etc

10 years agocore: unit deps port to extract_first_word 1785/head
Susant Sahani [Thu, 5 Nov 2015 05:26:13 +0000 (10:56 +0530)] 
core: unit deps port to extract_first_word

10 years agoMerge pull request #1823 from whot/hwdb-updates
Lennart Poettering [Tue, 10 Nov 2015 16:46:28 +0000 (17:46 +0100)] 
Merge pull request #1823 from whot/hwdb-updates

Updated axis ranges/resolutions for Lenovo T510 and Dell Inspiron N5040

10 years agoupdate TODO 1835/head
Lennart Poettering [Tue, 10 Nov 2015 16:36:10 +0000 (17:36 +0100)] 
update TODO

10 years agoparse-util: really refuse parsing negative values as positive ones, even on x86-32
Lennart Poettering [Tue, 10 Nov 2015 16:27:16 +0000 (17:27 +0100)] 
parse-util: really refuse parsing negative values as positive ones, even on x86-32

strtoull() doesn't make it particularly easy to detect passed-in
negative numbers, as it silently converts them to positive ones without
generating any error. Since we are not interested in negative values we
should hence explicitly filter them out by looking at the string
directly and returning ERANGE if we see a leading "-".

Fixes: #1829
10 years agojournald: dispatch SIGTERM/SIGINT with a low priority
Lennart Poettering [Tue, 10 Nov 2015 15:53:00 +0000 (16:53 +0100)] 
journald: dispatch SIGTERM/SIGINT with a low priority

Let's make sure to process all queued log data before exiting, so that
we don't unnecessary lose messages when shutting down.

https://github.com/systemd/systemd/pull/1812#issuecomment-155149871

10 years agocore: accept time units for time-based resource limits
Lennart Poettering [Tue, 10 Nov 2015 15:52:52 +0000 (16:52 +0100)] 
core: accept time units for time-based resource limits

Let's make sure "LimitCPU=30min" can be parsed properly, following the
usual logic how we parse time values. Similar for LimitRTTIME=.

While we are at it, extend a bit on the man page section about resource
limits.

Fixes: #1772
10 years agocore: when parsing resource limits, be more careful with types and corner cases
Lennart Poettering [Tue, 10 Nov 2015 15:10:24 +0000 (16:10 +0100)] 
core: when parsing resource limits, be more careful with types and corner cases

Let's not convert RLIM_INFINITY to "unsigned long long" and then back to
rlim_t, but let's leave it in the right type right-away.

Parse resource limits as 64 bit in all cases, as according to the man
page that's what libc does anyway.

Make sure setting a resource limit to (uint64_t) -1 results in a parsing
error, and isn't implicitly converted to RLIM_INFINITY.

10 years agocore: simplify parsing of capability bounding set settings
Lennart Poettering [Tue, 10 Nov 2015 15:08:03 +0000 (16:08 +0100)] 
core: simplify parsing of capability bounding set settings

Let's generate a simple error, and that's it. Let's not try to be smart
and record the last word that failed.

Also, let's make sure we don't compare numeric values with 0 by relying
on C's downgrade-to-bool feature, as suggested in CODING_STYLE.

10 years agotime-util: add parse_time(), which is like parse_sec() but allows specification of...
Lennart Poettering [Tue, 10 Nov 2015 15:04:37 +0000 (16:04 +0100)] 
time-util: add parse_time(), which is like parse_sec() but allows specification of default time unit if none is specified

This is useful if we want to parse RLIMIT_RTTIME values where the common
UNIX syntax is without any units but refers to a non-second unit (µs in
this case), but where we want to allow specification of units.

10 years agodefs: rework CONF_DIRS_NULSTR() macro
Lennart Poettering [Tue, 10 Nov 2015 14:57:21 +0000 (15:57 +0100)] 
defs: rework CONF_DIRS_NULSTR() macro

The macro is generically useful for putting together search paths, hence
let's make it truly generic, by dropping the implicit ".d" appending it
does, and leave that to the caller. Also rename it from
CONF_DIRS_NULSTR() to CONF_PATHS_NULSTR(), since it's not strictly about
dirs that way, but any kind of file system path.

Also, mark CONF_DIR_SPLIT_USR() as internal macro by renaming it to
_CONF_PATHS_SPLIT_USR() so that the leading underscore indicates that
it's internal.

10 years agocgls: when showing root slice, put -.slice at top of tree
Lennart Poettering [Mon, 9 Nov 2015 23:37:19 +0000 (00:37 +0100)] 
cgls: when showing root slice, put -.slice at top of tree

10 years agocgls: suppress output of controller name, if it's the systemd one
Lennart Poettering [Mon, 9 Nov 2015 23:36:57 +0000 (00:36 +0100)] 
cgls: suppress output of controller name, if it's the systemd one

10 years agovirt: make sure that we detect unknown container managers as VIRTUALIZATION_CONTAINER...
Lennart Poettering [Mon, 9 Nov 2015 22:47:29 +0000 (23:47 +0100)] 
virt: make sure that we detect unknown container managers as VIRTUALIZATION_CONTAINER_OTHER

If we don't know a container manager, we should consider it as "other"
rather than as no container manager at all, to provide a somwhat useful
upgrade path.

10 years agoCODING_STYLE: elaborate on usage of C99 fixed size integer types
Lennart Poettering [Mon, 9 Nov 2015 22:47:16 +0000 (23:47 +0100)] 
CODING_STYLE: elaborate on usage of C99 fixed size integer types

10 years agoman: fix reference to description of time span syntax
Lennart Poettering [Mon, 9 Nov 2015 22:46:40 +0000 (23:46 +0100)] 
man: fix reference to description of time span syntax

10 years agotest-execute: Fix systemd escaping and shell issues 1834/head
Filipe Brandenburger [Sun, 8 Nov 2015 18:19:45 +0000 (10:19 -0800)] 
test-execute: Fix systemd escaping and shell issues

In most cases, systemd requires escaping $ (for systemd variable
substitution) and % (for specifiers) by doubling them. This was somewhat
of an issue in tests like exec-environment*.service where systemd was
doing the substitutions and we were not really checking that those were
available in the actual environment of the command. Fix that.

Expressions such as `exit $(test ...)` are incorrect. They only work
because $(test ...) will produce no output, so the command will become a
bare "exit" which will exit with the status of the latest executed
command which turns out to be the test... The direct approach is simply
calling "test" as the last command, for which the shell will propagate
the exit status.

One situation where this was breaking tests was on `exit $(test ...) &&
$(test ...) && $(test ...)` where the second and third tests were not
really executing, since the first command is actually `exit` so && was
doing nothing there. Fixed it by just using `test ... && test ... &&
test ...` as it was initially intended.

Pass -x to all shell executions for them to produce useful debugging
output to stderr. Consequently, removed most of the explicit `echo`s
that are no longer needed.

Mark all units as Type=oneshot explicitly.

Also made sure all shell variables are properly quoted.

v2: Added an explicit LC_ALL=C to ionice invocations since some locales
(such as French) will add a space before the colon in the output.

Tested by running `sudo ./test-execute` and confirming all tests enabled
on my system (essentially all of them except for the s390 one) passed.
Tweaked the variables or options or expected values and confirmed the
tests do indeed fail when the values are not exactly the expected ones.

v2: Also tested with `LANG=fr_FR.UTF-8 sudo ./test-execute` to confirm
it still works in a different locale.

10 years agoMerge pull request #1825 from ssahani/ipv61-1
Tom Gundersen [Tue, 10 Nov 2015 14:03:37 +0000 (15:03 +0100)] 
Merge pull request #1825 from ssahani/ipv61-1

networkd: add support to configure IPv6 hop limit

10 years agoMerge pull request #1827 from davidreynolds/use_extract_first_word
Tom Gundersen [Tue, 10 Nov 2015 13:46:53 +0000 (14:46 +0100)] 
Merge pull request #1827 from davidreynolds/use_extract_first_word

conf-parser: use extract_first_word

10 years agoMerge pull request #1830 from jsynacek/journalctl-time
Tom Gundersen [Tue, 10 Nov 2015 13:46:02 +0000 (14:46 +0100)] 
Merge pull request #1830 from jsynacek/journalctl-time

man/journalctl: mention systemd.time(7) where appropriate

10 years agoMerge pull request #1831 from keszybz/todo-trimming
Tom Gundersen [Tue, 10 Nov 2015 13:43:42 +0000 (14:43 +0100)] 
Merge pull request #1831 from keszybz/todo-trimming

Todo trimming

10 years agoMerge pull request #1735 from thom311/master
Tom Gundersen [Tue, 10 Nov 2015 13:41:35 +0000 (14:41 +0100)] 
Merge pull request #1735 from thom311/master

lldp: avoid compiler warnings in lldp_tfl_package_read* functions

10 years agoman: describe the reason why runlevels are obsolete 1831/head
Zbigniew Jędrzejewski-Szmek [Sun, 8 Nov 2015 14:15:07 +0000 (15:15 +0100)] 
man: describe the reason why runlevels are obsolete

Put it at the top of the file, where it's hard to miss.

Also add the mapping of runlevel → target because since it is now
static.

I'm not adding runlevel(7), because we do not want to make obsolete
stuff even more prominent.

10 years agoman: tweak description of machinectl show
Zbigniew Jędrzejewski-Szmek [Sun, 8 Nov 2015 14:13:45 +0000 (15:13 +0100)] 
man: tweak description of machinectl show

Also, machinectl status is anything but terse. Remove "terse".

10 years agoTODO: update for lz4/xz stuff
Zbigniew Jędrzejewski-Szmek [Sun, 8 Nov 2015 14:13:24 +0000 (15:13 +0100)] 
TODO: update for lz4/xz stuff

No point in fixing xz now that lz4 is the default.

10 years agoman/journalctl: mention systemd.time(7) where appropriate 1830/head
Jan Synacek [Tue, 10 Nov 2015 12:05:48 +0000 (13:05 +0100)] 
man/journalctl: mention systemd.time(7) where appropriate

Original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1182661

10 years agoconf-parser: use extract_first_word 1827/head
David Reynolds [Tue, 10 Nov 2015 07:45:26 +0000 (23:45 -0800)] 
conf-parser: use extract_first_word

10 years agohwdb: add axis range corrections for Lenovo T510 1823/head
Peter Hutterer [Mon, 9 Nov 2015 06:30:54 +0000 (16:30 +1000)] 
hwdb: add axis range corrections for Lenovo T510

From https://bugzilla.redhat.com/show_bug.cgi?id=1247958

10 years agoman: add man for IPV6 hop limit 1825/head
Susant Sahani [Tue, 10 Nov 2015 03:59:24 +0000 (09:29 +0530)] 
man: add man for IPV6 hop limit

10 years agonetworkd: Add support to configure IPV6 hop limit
Susant Sahani [Tue, 10 Nov 2015 03:56:38 +0000 (09:26 +0530)] 
networkd: Add support to configure IPV6 hop limit

This patch adds support to configure IPV6 hop limit.

For example:
/proc/sys/net/ipv6/conf/wlp3s0/hop_limit

10 years agohwdb: add Dell Inspiron N5040 touchpad corrections
Peter Hutterer [Mon, 2 Nov 2015 21:35:43 +0000 (07:35 +1000)] 
hwdb: add Dell Inspiron N5040 touchpad corrections

From https://bugzilla.redhat.com/show_bug.cgi?id=1275070

10 years agohwdb: sort the brand names alphabetically
Peter Hutterer [Mon, 2 Nov 2015 21:32:35 +0000 (07:32 +1000)] 
hwdb: sort the brand names alphabetically

10 years agoMerge pull request #1790 from endocode/kayrus/fix_man_kernel_cl
Lennart Poettering [Tue, 10 Nov 2015 00:01:51 +0000 (01:01 +0100)] 
Merge pull request #1790 from endocode/kayrus/fix_man_kernel_cl

Fixed kernel-command-line links

10 years agoMerge pull request #1629 from ssahani/vxlan
Tom Gundersen [Mon, 9 Nov 2015 22:36:59 +0000 (23:36 +0100)] 
Merge pull request #1629 from ssahani/vxlan

networkd: vxlan add option to set FDB entries

10 years agoMerge pull request #1821 from darkcircle/ko-catalog-translation
Lennart Poettering [Mon, 9 Nov 2015 22:19:37 +0000 (23:19 +0100)] 
Merge pull request #1821 from darkcircle/ko-catalog-translation

l10n: add a new Korean translation for the catalog

10 years agoMerge pull request #1820 from michich/errno-v2
Daniel Mack [Mon, 9 Nov 2015 20:56:49 +0000 (21:56 +0100)] 
Merge pull request #1820 from michich/errno-v2

[v2] treewide: treatment of errno and other cleanups

10 years agoadd a new Korean translation for the catalog 1821/head
Seong-ho Cho [Mon, 9 Nov 2015 20:08:44 +0000 (05:08 +0900)] 
add a new Korean translation for the catalog

10 years agoMerge pull request #1762 from endocode/dongsu/l10n-ko-msgs
Lennart Poettering [Mon, 9 Nov 2015 19:09:49 +0000 (20:09 +0100)] 
Merge pull request #1762 from endocode/dongsu/l10n-ko-msgs

po: update Korean translation

10 years agotreewide: apply errno.cocci 1820/head
Michal Schmidt [Thu, 5 Nov 2015 12:44:20 +0000 (13:44 +0100)] 
treewide: apply errno.cocci

with small manual cleanups for style.

10 years agococcinelle: additional errno.cocci hunk
Michal Schmidt [Thu, 5 Nov 2015 12:44:18 +0000 (13:44 +0100)] 
coccinelle: additional errno.cocci hunk

rewrites:
  log_error_errno(errno, ...);
  return -errno;
into:
  return log_error_errno(errno, ...);

10 years agococcinelle: errno.cocci improvements
Michal Schmidt [Thu, 5 Nov 2015 12:44:17 +0000 (13:44 +0100)] 
coccinelle: errno.cocci improvements

Apply to all log_*_errno loglevels.

10 years agoMerge pull request #1798 from evverx/fix-test-udev
Lennart Poettering [Mon, 9 Nov 2015 17:33:22 +0000 (18:33 +0100)] 
Merge pull request #1798 from evverx/fix-test-udev

test-udev: small fixes

10 years agoMerge pull request #1799 from jengelh/doc
Lennart Poettering [Mon, 9 Nov 2015 17:16:21 +0000 (18:16 +0100)] 
Merge pull request #1799 from jengelh/doc

doc: typo and ortho fixes

10 years agoMerge pull request #1807 from michich/boot-timer
Lennart Poettering [Mon, 9 Nov 2015 16:30:58 +0000 (17:30 +0100)] 
Merge pull request #1807 from michich/boot-timer

core/timer: in containers OnBootSec should count from container startup

10 years agoMerge pull request #1794 from karelzak/size_limit
Lennart Poettering [Mon, 9 Nov 2015 16:02:12 +0000 (17:02 +0100)] 
Merge pull request #1794 from karelzak/size_limit

core: support IEC suffixes for RLIMIT stuff

10 years agoMerge pull request #1817 from iaguis/nspawn-custom-service-3
Lennart Poettering [Mon, 9 Nov 2015 15:50:57 +0000 (16:50 +0100)] 
Merge pull request #1817 from iaguis/nspawn-custom-service-3

nspawn: support custom container service name

10 years agodetect-virt: add rkt app container runtime 1817/head
Iago López Galeiras [Mon, 9 Nov 2015 13:37:43 +0000 (14:37 +0100)] 
detect-virt: add rkt app container runtime

10 years agonspawn: support custom container service name
Iago López Galeiras [Mon, 9 Nov 2015 10:32:34 +0000 (11:32 +0100)] 
nspawn: support custom container service name

We were hardcoding "systemd-nspawn" as the value of the $container env
variable and "nspawn" as the service string in machined registration.

This commit allows the user to configure it by setting the
$SYSTEMD_NSPAWN_CONTAINER_SERVICE env variable when calling
systemd-nspawn.

If $SYSTEMD_NSPAWN_CONTAINER_SERVICE is not set, we use the string
"systemd-nspawn" for both, fixing the previous inconsistency.

10 years agoMerge pull request #1796 from michaelolbrich/journal-size
Lennart Poettering [Mon, 9 Nov 2015 13:31:51 +0000 (14:31 +0100)] 
Merge pull request #1796 from michaelolbrich/journal-size

journal: reduce minimum journal file size to 512 KiB

10 years agocore/timer: in containers OnBootSec should count from container startup 1807/head
Michal Schmidt [Sat, 7 Nov 2015 14:09:31 +0000 (15:09 +0100)] 
core/timer: in containers OnBootSec should count from container startup

In Fedora dnf-makecache.timer specifies OnBootSec=10min, but it fired
during boot in systemd-nspawn, because the clock ticks since the host's
boot.

Fix it by treating OnBootSec the same as OnStartupSec when running in
a container.

10 years agoMerge pull request #1801 from chuyd/fix-typos
Daniel Mack [Sat, 7 Nov 2015 11:31:34 +0000 (12:31 +0100)] 
Merge pull request #1801 from chuyd/fix-typos

test: Fix typo in TEST-03-JOBS/test-jobs.sh

10 years agoMerge pull request #1803 from phomes/unused-var
Daniel Mack [Sat, 7 Nov 2015 11:31:23 +0000 (12:31 +0100)] 
Merge pull request #1803 from phomes/unused-var

core: remove unused variable

10 years agocore: remove unused variable 1803/head
Thomas Hindoe Paaboel Andersen [Sat, 7 Nov 2015 10:03:11 +0000 (11:03 +0100)] 
core: remove unused variable

unused since 7b2313f5

10 years agotest: Fix typo in TEST-03-JOBS/test-jobs.sh 1801/head
Jesus Ornelas Aguayo [Fri, 6 Nov 2015 19:01:21 +0000 (13:01 -0600)] 
test: Fix typo in TEST-03-JOBS/test-jobs.sh

Fix typo s/enqueueing/enqueuing/

Signed-off-by: Jesus Ornelas Aguayo <jesus.ornelas.aguayo@intel.com>
10 years agoMerge pull request #1795 from msekletar/networkd-forward
Ronny Chevalier [Fri, 6 Nov 2015 17:14:24 +0000 (18:14 +0100)] 
Merge pull request #1795 from msekletar/networkd-forward

networkd: fix option name in log message

10 years agoMerge pull request #1800 from evverx/fix-test-execute
Ronny Chevalier [Fri, 6 Nov 2015 15:59:05 +0000 (16:59 +0100)] 
Merge pull request #1800 from evverx/fix-test-execute

test-execute: don't use /usr/bin/uname. use sh and PATH

10 years agotest-execute: don't use /usr/bin/uname. use sh and PATH 1800/head
Evgeny Vereshchagin [Fri, 6 Nov 2015 15:42:06 +0000 (15:42 +0000)] 
test-execute: don't use /usr/bin/uname. use sh and PATH

10 years agoFixed kernel-command-line links 1790/head
kayrus [Thu, 5 Nov 2015 14:38:19 +0000 (15:38 +0100)] 
Fixed kernel-command-line links

10 years agodoc: use expanded forms for written style 1799/head
Jan Engelhardt [Mon, 26 Oct 2015 14:45:12 +0000 (15:45 +0100)] 
doc: use expanded forms for written style

10 years agodoc: correct orthography, word forms and missing/extraneous words
Jan Engelhardt [Sun, 3 Aug 2014 05:11:37 +0000 (07:11 +0200)] 
doc: correct orthography, word forms and missing/extraneous words

10 years agotest-udev: small fixes 1798/head
Evgeny Vereshchagin [Fri, 6 Nov 2015 12:06:23 +0000 (12:06 +0000)] 
test-udev: small fixes

* print '\n' on error
* use UDEVLIBEXECDIR (udev_rules_new uses it too)

10 years agodoc: correct punctuation and improve typography in documentation
Jan Engelhardt [Sun, 3 Aug 2014 05:11:12 +0000 (07:11 +0200)] 
doc: correct punctuation and improve typography in documentation

10 years agojournal: reduce minimum journal file size to 512 KiB 1796/head
Michael Olbrich [Fri, 6 Nov 2015 10:32:34 +0000 (11:32 +0100)] 
journal: reduce minimum journal file size to 512 KiB

For low end embedded systems 4 MiB for each journal file is a lot of
memory. Journald will use at least 512 KiB even if JOURNAL_FILE_SIZE_MIN is
set to less than that so just use 512 KiB.

10 years agocore: support IEC suffixes for RLIMIT stuff 1794/head
Karel Zak [Fri, 6 Nov 2015 10:06:52 +0000 (11:06 +0100)] 
core: support IEC suffixes for RLIMIT stuff

Let's make things more user-friendly and support for example

  LimitAS=16G

rather than force users to always use LimitAS=16106127360.

The change is relevant for options:

  [Default]Limit{FSIZE,DATA,STACK,CORE,RSS,AS,MEMLOCK,MSGQUEUE}

The patch introduces config_parse_bytes_limit(), it's the same as
config_parse_limit() but uses parse_size() tu support the suffixes.

Addresses: https://github.com/systemd/systemd/issues/1772

10 years agonetworkd: fix option name in log message 1795/head
Michal Sekletar [Fri, 6 Nov 2015 09:51:34 +0000 (10:51 +0100)] 
networkd: fix option name in log message

10 years agoextract-word: Skip coalesced separators in place 1793/head
Filipe Brandenburger [Fri, 6 Nov 2015 05:57:26 +0000 (21:57 -0800)] 
extract-word: Skip coalesced separators in place

Just skip them in place, instead of setting separator=true. We only do
that in a single place (while finding a separator outside of quote or
backslash states) so we don't really need a separate state for it.

Tested that no regressions were introduced in test-extract-word. Ran a
full `make check` and also installed the binaries on a test system and
did not see any issues related to parsing unit files or starting units
after a reboot.

10 years agoextract-word: Do not re-evaluate the state on each parsed character
Filipe Brandenburger [Fri, 6 Nov 2015 05:51:24 +0000 (21:51 -0800)] 
extract-word: Do not re-evaluate the state on each parsed character

Use inner loops to keep processing the same state, except when there is
a state change, then break back to the outer loop so that the correct
branch can be selected again.

Tested that no regressions were introduced in test-extract-word.

10 years agoextract-word: increment pointer p and keep c in sync in for loop
Filipe Brandenburger [Fri, 6 Nov 2015 05:41:04 +0000 (21:41 -0800)] 
extract-word: increment pointer p and keep c in sync in for loop

This will make it easier to use inner loops to keep looping in the same
state, by just updating p and c in the same way in the inner loops.

Tested that no regressions were created in test-extract-word.

10 years agoextract-word: Check for early bail out before inspecting separators
Filipe Brandenburger [Fri, 6 Nov 2015 05:31:29 +0000 (21:31 -0800)] 
extract-word: Check for early bail out before inspecting separators

It's a pretty small optimization but doesn't hurt...

Tested with test-extract-word.

10 years agoextract-word: replace an use of `goto` with structured code
Filipe Brandenburger [Fri, 6 Nov 2015 05:17:11 +0000 (21:17 -0800)] 
extract-word: replace an use of `goto` with structured code

Using `goto` might be appropriate for the "finish" cases but it was
really not necessary at this point of the code... Just use if/else
blocks to accomplish the same.

Confirmed that the test cases in test-extract-word keep working as
expected.

10 years agoextract-word: move start block outside the for loop
Filipe Brandenburger [Wed, 4 Nov 2015 04:13:11 +0000 (20:13 -0800)] 
extract-word: move start block outside the for loop

This block runs once before all the other handling, so move it outside
the main loop and put it in its own loop until it's finished doing its
job.

Tested by confirming `make check` (and particularly test-extract-word)
still passes and by booting a system with binaries including this
commit.

10 years agosd-resolve: simplify pthread_join() call
Michal Schmidt [Thu, 5 Nov 2015 12:44:15 +0000 (13:44 +0100)] 
sd-resolve: simplify pthread_join() call

POSIX says:
The pthread_join() function shall not return an error code of [EINTR].

10 years agotimesync: return negative errno from manager_adjust_clock() on error
Michal Schmidt [Thu, 5 Nov 2015 12:44:14 +0000 (13:44 +0100)] 
timesync: return negative errno from manager_adjust_clock() on error

10 years agonspawn: save errno before reopening log after exec failure
Michal Schmidt [Thu, 5 Nov 2015 12:44:12 +0000 (13:44 +0100)] 
nspawn: save errno before reopening log after exec failure

10 years agonspawn: no fake errno
Michal Schmidt [Thu, 5 Nov 2015 12:44:11 +0000 (13:44 +0100)] 
nspawn: no fake errno

The S_ISREG test does not set errno, so don't use it in the error
message.

10 years agonspawn: simplify error returns
Michal Schmidt [Thu, 5 Nov 2015 12:44:10 +0000 (13:44 +0100)] 
nspawn: simplify error returns

Use the "return log_error_errno(...)" idiom to have fewer curly braces.

The last hunk also fixes the return value of setup_journal(), but the
fix has no practical effect.

10 years agolibsystemd-network: inet_pton does not set errno on parsing error
Michal Schmidt [Thu, 5 Nov 2015 12:44:10 +0000 (13:44 +0100)] 
libsystemd-network: inet_pton does not set errno on parsing error

it would set errno only for an invalid address family.

Also fix a copy&paste error in one error string.

10 years agoimport: report error before losing errno
Michal Schmidt [Thu, 5 Nov 2015 12:44:09 +0000 (13:44 +0100)] 
import: report error before losing errno

unlink() may change errno, so report the error from rename() first, then
unlink.

10 years agofirstboot: fix errno sign
Michal Schmidt [Thu, 5 Nov 2015 12:44:08 +0000 (13:44 +0100)] 
firstboot: fix errno sign

10 years agojournal: posix_fallocate() does not set errno
Michal Schmidt [Thu, 5 Nov 2015 12:44:07 +0000 (13:44 +0100)] 
journal: posix_fallocate() does not set errno

manpage says:
 posix_fallocate() returns zero on success, or an error number on
 failure. Note that errno is not set.

10 years agotreewide: use the negative error codes returned by our functions
Michal Schmidt [Thu, 5 Nov 2015 12:44:06 +0000 (13:44 +0100)] 
treewide: use the negative error codes returned by our functions

Our functions return negative error codes.
Do not rely on errno being set after calling our own functions.

10 years agojournal: fix incorrect errno reporting
Michal Schmidt [Thu, 5 Nov 2015 12:44:06 +0000 (13:44 +0100)] 
journal: fix incorrect errno reporting

pread() returns -1 on error and sets errno. Do not use the -1 as errno.

10 years agojournal: use int64_t instead of long for catalog file size
Michal Schmidt [Thu, 5 Nov 2015 12:44:05 +0000 (13:44 +0100)] 
journal: use int64_t instead of long for catalog file size

This replaces the use of ftell() with ftello() for 64-bit size on all
archs.

Also drops a pointless check for NULL before calling strbuf_cleanup().

10 years agojournal: drop unnecessary write_catalog() parameter
Michal Schmidt [Thu, 5 Nov 2015 12:44:04 +0000 (13:44 +0100)] 
journal: drop unnecessary write_catalog() parameter

write_catalog() use the hashmap only to get its size. The size is
already given in parameter 'n'.

10 years agolog: whitespace style fix
Michal Schmidt [Thu, 5 Nov 2015 12:44:03 +0000 (13:44 +0100)] 
log: whitespace style fix

10 years agotty-ask-password-agent: fix typo in error message
Michal Schmidt [Thu, 5 Nov 2015 12:44:01 +0000 (13:44 +0100)] 
tty-ask-password-agent: fix typo in error message

10 years agocore: still make progress when throttling the manager loop 1783/head
Vito Caputo [Thu, 5 Nov 2015 01:32:16 +0000 (17:32 -0800)] 
core: still make progress when throttling the manager loop

Don't simply continue after sleeping, it potentially puts us in a state
of spinning doing nothing slowly, if the ratelimit_test() keeps
detecting the need for limiting.

Observed in vms after the host had been suspended for a while, on resume
systemd entered a loop of making zero progress spamming the console
with:
[431942.850090] systemd[1]: Looping too fast. Throttling execution a
little.

I see no reason to have a continue here, the intention should be to
throttle execution, not circumvent it altogether.

10 years agoMerge pull request #1761 from ssahani/word
Lennart Poettering [Wed, 4 Nov 2015 19:16:14 +0000 (20:16 +0100)] 
Merge pull request #1761 from ssahani/word

core: parse socket port to extract_first_word

10 years agoMerge pull request #1778 from rhdrjones/detect-virt
Lennart Poettering [Wed, 4 Nov 2015 19:11:17 +0000 (20:11 +0100)] 
Merge pull request #1778 from rhdrjones/detect-virt

detect-virt: one fix and arm/aarch64 dmi detection

10 years agoMerge pull request #1780 from evverx/fix-install-dbus
Ronny Chevalier [Wed, 4 Nov 2015 19:07:23 +0000 (20:07 +0100)] 
Merge pull request #1780 from evverx/fix-install-dbus

test-functions: fix dbus-1 installation

10 years agotest-functions: fix dbus-1 installation 1780/head
Evgeny Vereshchagin [Wed, 4 Nov 2015 18:33:37 +0000 (18:33 +0000)] 
test-functions: fix dbus-1 installation

The basic setup for the well-known system and session buses is
now done in read-only files in ${datadir} (normally /usr/share).
See the NEWS entry for 1.9.18 for details.

http://cgit.freedesktop.org/dbus/dbus/tree/NEWS

10 years agodetect-virt: dmi: look for KVM 1778/head
Andrew Jones [Tue, 3 Nov 2015 19:31:03 +0000 (13:31 -0600)] 
detect-virt: dmi: look for KVM

Some guests (ARM, AArch64, x86-RHEL) have 'KVM' in the product name.
Look for that first in order to more precisely report "kvm" when
detecting a QEMU/KVM guest. Without this patch we report "qemu",
even if KVM acceleration is in use on ARM/AArch64 guests.

I've only tested a backported version of this and the previous
patch on an AArch64 guest (which worked). Of course it would be
nice to get regression testing on all guest types that depend on
dmi done.

10 years agoarm/aarch64: detect-virt: check dmi
Andrew Jones [Tue, 3 Nov 2015 18:10:13 +0000 (12:10 -0600)] 
arm/aarch64: detect-virt: check dmi

ARM/AArch64 guests now have SMBIOS tables populated (when boot
with a late enough QEMU and a late enough AAVMF is used as the
bootloader). Furthermore, when booting ARM/AArch64 guests with
ACPI, the DT detection obviously no longer works, so we need
dmi detection.