Commit graph

30458 commits

Author SHA1 Message Date
John Lin 474cca49ee mkosi: set locale to be en_US.UTF-8 (#7244)
Fixes: #7238
2017-11-07 19:17:40 +03:00
Alan Jenkins fec7615c07 core: simplify - don't add jobs to dbus queue if we immediately remove them (#7251)
job_finish_and_invalidate() calls job_free() to destroy jobs (and remove
them from the dbus queue).  So we don't need to add them to the dbus queue
first.

We only want to add jobs to the dbus queue if they're a restart job, which
we're transmogrifying into a start job and putting back into the system.
2017-11-07 19:14:15 +03:00
Alessandro Ghedini 30046d9c89 man: fix reference to gateway hostname (#7258)
Follow-up to commit 1dc92a06e2 which didn't
catch all cases.
2017-11-07 19:13:15 +03:00
Shawn Landden ed440f6be9 condition: detect TOMOYO MAC (#7249)
TOMOYO is a Mandatory Access Control security module for Linux.
Rather than ship rules, TOMOYO features a learning mode.

http://tomoyo.osdn.jp/
http://tomoyo.osdn.jp/2.5/index.html.en
2017-11-07 19:12:36 +03:00
Dimitri John Ledkov 4b742c8acd test: switch to using ext4 instead of ext3 as default fallback fs (#7265)
Using ext3 is not representative anymore, and Ubuntu has stopped shipping
fsck.ext3 in the initramfs.
2017-11-07 17:51:30 +03:00
Lennart Poettering 7a5cb197d8
Merge pull request #7256 from keszybz/add-cii-badge
Add CII badge
2017-11-07 17:47:57 +03:00
Yu Watanabe 85e55d14de tree-wide: do not work in assert() (#7271)
Fixes #7270.
2017-11-07 16:04:20 +03:00
macrothian 0b97f52a33 Fix Dell E7570 hwdb dimensions #7252 (#7263) 2017-11-07 08:28:06 +10:00
Yu Watanabe f907cc1620 timesync: add RootDistanceMaxSec= to timesyncd.conf (#7215)
Closes #7211.
2017-11-05 07:39:34 +01:00
Zbigniew Jędrzejewski-Szmek 8f8dc208be HACKING: add a short description of new unit tests
This is all "should" and "encouraged", since we are not strict with
this, for better or worse.
2017-11-04 21:15:57 +01:00
Zbigniew Jędrzejewski-Szmek 78733a523a README.md: add CII Best Practices badge 2017-11-04 21:15:57 +01:00
Lennart Poettering 6e9834ea0f
Merge pull request #7241 from keszybz/clang-warnings
Fixes for various clang warnings
2017-11-02 19:21:10 +01:00
Susant Sahani 74d42cd923 networkd: remove route - drop route type from netlink message. (#7240)
During startup of networkd we try to drop the configs. While droping
routes we filling ip route type and because of which message like
```
host: Could not drop route: Invalid argument
host: Could not drop route: Invalid argument
```
are shown.

Closed #6929
2017-11-02 21:36:03 +09:00
Zbigniew Jędrzejewski-Szmek 4d11c049a2
Merge pull request #7217 from sourcejedi/stopfail-stop
2 small fixes, stopping mount and service units
2017-11-02 08:25:02 +01:00
Zbigniew Jędrzejewski-Szmek 09571e3ffc test-util: silence clang warning about unaligned access 2017-11-01 23:10:25 +01:00
Zbigniew Jędrzejewski-Szmek 3f6914175c util-lib: mark variable with _unused_ to silence clang warning
_unused_ means "the variable is meant to be possible unused and gcc
will not generate a warning about it", which is exactly what we need here,
since we're only declaring it for the side effect of _cleanup_.
2017-11-01 23:10:25 +01:00
Zbigniew Jędrzejewski-Szmek 5180446051 journal: disable -Waddress-of-packed-member under clang
clang warns about a few sites like this:
../src/journal/journal-file.c:1780:48: warning: taking address of packed member 'entry_offset' of class or structure 'DataObject' may result in an unaligned pointer value [-Waddress-of-packed-member]
                                              &o->data.entry_offset,
                                               ^~~~~~~~~~~~~~~~~~~~
but DataObject.entry_offset will always be 8-byte aligned as long as
the DataObject structure is aligned. Similarly in other cases, the
field is always aligned. Let's just silence the warning to avoid noise.

gcc does not know -Waddress-of-packed-member, and would warn about an unknown
warning, so we need to conditionalize on __clang__.
2017-11-01 23:10:25 +01:00
Zbigniew Jędrzejewski-Szmek ecc3f340ab networkd: fix two format string mismatches
../src/network/networkd-link.c:3577:84: warning: format specifies type 'unsigned char' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
                                route->dst_prefixlen, route->tos, route->priority, route->table, route->lifetime);
                                                                                   ^~~~~~~~~~~~
../src/network/networkd-manager.c:1146:132: warning: format specifies type 'unsigned char' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
                        rule->from_prefixlen, space ? " " : "", to_str, rule->to_prefixlen, rule->tos, rule->fwmark, rule->fwmask, rule->table);
                                                                                                                                   ^~~~~~~~~~~

Also add some line breaks to make it easier to see which argument is for which
part of the format string.
2017-11-01 23:10:21 +01:00
Zbigniew Jędrzejewski-Szmek 3dad3203ab importd: remove IN_SET to avoid ambiguity
clang warns:
../src/import/importd.c:254:70: warning: 'break' is bound to current loop, GCC binds it to the enclosing loop [-Wgcc-compat]
                while ((e < t->log_message + t->log_message_size) && IN_SET(*e, 0, '\n'))
                                                                     ^
Let's just play it safe and not use IN_SET here.
2017-11-01 23:09:05 +01:00
Zbigniew Jędrzejewski-Szmek 1d3e682e12 journald: unitialized variable access
../src/journal/journald-native.c:341:13: warning: variable 'context' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        if (ucred && pid_is_valid(ucred->pid)) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/journal/journald-native.c:350:42: note: uninitialized use occurs here
                                         context, ucred, tv, label, label_len);
                                         ^~~~~~~
../src/journal/journald-native.c:335:31: note: initialize the variable 'context' to silence this warning
        ClientContext *context;
                              ^
                               = NULL

Very nice reporting!

Functions that we call can handle context == NULL, so it's enough to simply
initialize the variable.
2017-11-01 23:08:21 +01:00
Zbigniew Jędrzejewski-Szmek ac097c841e Remove a bunch of unused variables
gcc does not warn about those, because of the _cleanup_ usage.
clang is smarter here.
2017-11-01 23:06:44 +01:00
Alan Jenkins 4cd9fa8176 core: failure to spawn ExecStartPost should not run ExecStop
Failure to spawn ExecStartPost was being handled differently to e.g.
EXIT_FAILURE returned by ExecStartPost.  It looks like this was an
oversight.  Fix to match documented behaviour.

`man systemd.service`:

> Note that if any of the commands specified in ExecStartPre=, ExecStart=,
> or ExecStartPost= fail (and are not prefixed with "-", see above) or time
> out before the service is fully up, execution continues with commands
> specified in ExecStopPost=, the commands in ExecStop= are skipped.
2017-11-01 15:28:50 +00:00
Alan Jenkins 79aafbd122 core: distinguish "Killing"/"Terminating"/"Stopping" for mount unit timeout
Update the timeout warnings for remount and unmount.  For consistency with
mount, for accuracy, and for consistency with their equivalents in
service.c.
2017-11-01 15:28:50 +00:00
Michal Sekletar 41dfa61d35 manager: fix connecting to bus when dbus is actually around (#7205)
manager_connect_bus() is called *before* manager_coldplug(). As a last
thing in service_coldplug() we set service state to
s->deserialized_state, and thus before we do that all services are
inactive and try_connect always evaluates to false. To fix that we must
look at deserialized state instead of current unit state.

Fixes #7146
2017-11-01 10:25:48 +01:00
martingh 723afa4f96 Reverting erroneous changes made of the course of adding a timeout to journal-remote event handling (#7219) 2017-11-01 10:15:38 +01:00
Zbigniew Jędrzejewski-Szmek 7e21459f6d
Merge pull request #7233 from yuwata/meson-fixes
Meson fixes
2017-11-01 10:14:01 +01:00
Yu Watanabe 2e293b4a14 journal-remote: set description to timer_event (#7234)
Follow-up for 5e38eb931f.
2017-11-01 10:13:00 +01:00
Alan Jenkins 0ed782021b
Merge pull request #7226 from sourcejedi/shutdown-misuse-commment
core: remove "misuse" of getpgid() in systemd-shutdown
2017-10-31 10:05:02 +00:00
Yu Watanabe 3bd469546b meson: do not create systemd-user-sessions.service if PAM is disabled
Fixes #7227.
2017-10-31 17:12:36 +09:00
Yu Watanabe 5b316b9ea6 meson: do not include man/meson.build if xsltproc not found
Fixes #7232.
2017-10-31 17:12:21 +09:00
Alan Jenkins 8ef3d66d14
Merge pull request #7218 from matijaskala/patch-4
fix compile errors on musl
2017-10-30 17:42:33 +00:00
Alan Jenkins 3448a96980 core: remove "misuse" of getpgid() in systemd-shutdown
Using `kill()`  with a signal of 0 is a slightly more documented idiom for
checking whether a process still exists.  It is mentioned explicitly in
man pages.  This avoids the need to comment the call as "misuse".
A comment is still necessary - in fact this idiom is even more confusing if
you don't know how it works.  But it's easy enough to explain.
2017-10-30 16:10:37 +00:00
aeywalee 75bcbcf2e7 Add sd_bus_message_new and sd_bus_message_seal as public functions (#6609) 2017-10-30 16:08:46 +01:00
Zbigniew Jędrzejewski-Szmek ecd9ded89b
Merge pull request #6996 from poettering/discover-block-device
add nspawn image discovery on block devices
2017-10-30 16:05:20 +01:00
Hans de Goede 14d89e3232 hwdb: Update GP-electronic T701 accel mount settings (#7220)
The GP-electronic T701 has its LCD panel mounted upside-down, initially
my plan was to fix this by transparently rotating the image in the i915
driver (my "drm/i915: Deal with upside-down mounted LCD" patch), but
that approach has been rejected instead the kernel will now export
a "panel orientation" property on the drm-connector for the panel and
let userspace deal with it.

Since the upside-down-ness of the panel is now no longer transparently
hidden from userspace, the current accel mount quirk for the T701 needs
to be updated to take the upside-down-ness into account.
2017-10-30 14:33:54 +01:00
Yu Watanabe 21df96c0b0 resolved: change newline position in stub-resolv.conf (#7216)
Follow-up for e6b2d948f8.
2017-10-30 10:34:41 +01:00
Matija Skala d7e454ba9c fix includes
sys/wait.h is needed for WEXITED macro

poll.h is more portable than sys/poll.h
2017-10-30 10:32:45 +01:00
Matija Skala 5a10b4d6bf fix compile error on musl
name '__in6_u.__u6_addr32' is specific to glibc

use 's6_addr32' macro instead
2017-10-30 10:15:31 +01:00
Lennart Poettering 64d2753a87
Merge pull request #7212 from whot/master
hwdb: add a hwdb for custom ID_INPUT_* overrides
2017-10-30 10:12:12 +01:00
Maciej S. Szmigiero 27b8198e13 rules: add Freescale IMX serial ports name to serial port udev rule (#7203)
Freescale IMX SoCs serial ports driven by kernel "imx-uart" driver have
names of "ttymxcN", let's add this pattern to an udev rule for serial
ports so they will have proper ownership applied.
2017-10-30 09:59:31 +01:00
Zbigniew Jędrzejewski-Szmek 8a4b13c5cb treewide: unify identical definitions of polkit_agent_open_if_enabled() (#7187)
Follows the same pattern as pager_open() now.
2017-10-30 09:57:53 +01:00
Peter Hutterer 0fbe78ac7a hwdb: add UC-Logic 20160N pad to the ID_INPUT hwdb
Missing the x/y axes usually exported for pad devices (for historical reaons)
and thus not recognised as tablet (pad).

Fixes #7197
See also https://bugs.freedesktop.org/show_bug.cgi?id=103395
2017-10-30 10:58:57 +10:00
Peter Hutterer ffac30349e hwdb: add a hwdb file to override ID_INPUT assignments
The input_id builtin assigns the various ID_INPUT based on the exported evdev
bits. In some cases, the device may not have the properties required to label
a device as one specific type but the physical form factor is clear.
e.g. in the case of #7197 it's a tablet pad that does not have x/y axes which
the kernel exports for pads for historical reasons.

A custom override is needed, best to be solved with a hwdb entry.

Related #7197
2017-10-30 10:57:18 +10:00
Alan Jenkins f630daaae9 man: systemd.offline-updates: remove link to the doc it obsoletes (#7189)
https://www.freedesktop.org/wiki/Software/systemd/SystemUpdates/

> This document has been replaced by systemd.offline-updates(7) man page.

It's weird to visit the first "see also", and find that it is what the manpage replaces (and looks very similar).  Surely we should remove this link.
2017-10-27 10:15:40 +02:00
Lars Karlitski cc25a67e2a journalctl: add --output-fields= (#7181)
This option allows restricting the shown fields in the output modes that
would normally show all fields. It allows clients that are only
interested in a subset of the fields to access those more efficiently.
Also, it makes the resulting size of the output more predictable.

It has no effect on the various `short` output modes, because those
already only show a subset of the fields.
2017-10-27 12:10:47 +09:00
Yu Watanabe a8caf8b251 Merge pull request #7066 from poettering/specifier-update
extend unit file specifier expansion a bit + add a test for it
2017-10-27 12:09:26 +09:00
Lennart Poettering 1c8ac41c65 update TODO 2017-10-26 18:01:28 +02:00
Lennart Poettering 9672b58398 test: add simple test for validating some of the unit specifiers we support
(Also, sort list of test unit files in meson.build alphabetically, to
make future additions more systematic)
2017-10-26 18:01:04 +02:00
Lennart Poettering 14068e17f3 core: add support for expanding state/cache/log directory root in unit files
This augments %t which already resolves to the runtime directory root, and
should be useful for units that want to pass any of these paths in
command line arguments.

Example:

ExecStart=/usr/bin/mydaemon --datadir=%S/mydaemon

Why not expose a specifier resolving directly to the configured
state/runtime/cache/log dir? Three reasons:

1. Specifiers should be independent of configuration of the unit itself,
   and StateDirectory= and friends are unit configuration.  See
   03fc9c723c and related work.

2. We permit multiple StateDirectory= values per unit, and it hence
   wouldn't be clear which one is passed.

3. We already have %t for the runtime directory root, and we should
   continue with the same scheme.
2017-10-26 17:59:09 +02:00
Lennart Poettering 3992bce17f update TODO 2017-10-26 17:54:56 +02:00