Commit Graph

30301 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 81473e6f20 Merge pull request #6932 from poettering/notify-pam
fix handling of cgroup empty events for Type=notify services
2017-10-02 14:40:10 +02:00
Zbigniew Jędrzejewski-Szmek 53f4c5fa21 hwdb: sort usb classes and vendors
No change, but let's keep the sorting in place as a safeguard for
the future.
2017-10-02 13:19:23 +02:00
Zbigniew Jędrzejewski-Szmek 0a91fd3bd6 hwdb: sort pci classes and vendors
No change, but let's keep the sorting in place as a safeguard for
the future.
2017-10-02 13:19:23 +02:00
Zbigniew Jędrzejewski-Szmek e979e502da hwdb: sort sdio entries
Nothing intersting here.
2017-10-02 13:19:23 +02:00
Zbigniew Jędrzejewski-Szmek e4804bdae6 hwdb: de-duplicate and sort OUI entries
Ignoring duplicate entry: 0001C8 = "THOMAS CONRAD CORP.", "CONRAD CORP."
Ignoring duplicate entry: 080030 = "NETWORK RESEARCH CORPORATION", "ROYAL MELBOURNE INST OF TECH"
Ignoring duplicate entry: 080030 = "NETWORK RESEARCH CORPORATION", "CERN"
→ we have two vendor prefixes with duplicate entries. For the first one,
there are two entries with what appear to be the same company. In the
second case, the same prefix is assigned to three different entities.
I arbitrarily chose to prefer the first entry.
2017-10-02 13:19:23 +02:00
Zbigniew Jędrzejewski-Szmek 53d22844f0 ids_parser: allow specifying which parts to run 2017-10-02 13:19:22 +02:00
Zbigniew Jędrzejewski-Szmek 3a58a43085 hwdb: add a grammar-based generator for vendor/model and class tables
This is rather slow (1 m 45 s on my laptop), but since it'd be only used
once per release, maybe this doesn't matter that much.

Output is identical to ids-update.pl with the set of source files committed in
the grandparent.
2017-10-02 13:19:22 +02:00
Zbigniew Jędrzejewski-Szmek c579960977 hwdb: fix invalid encoding in usb.ids
0xB4 is the code point for "accent acute", but when encoded in utf-8,
is is a multibyte sequence. A single 0xB4 byte is invalid (seems to be
latin1).
2017-10-02 13:19:22 +02:00
Zbigniew Jędrzejewski-Szmek 2a9ba96c67 hwdb: also add the source files to git
Without the original files it's hard to see what changed "upstream", and what
entries were added and removed. Upstream did not keep the entries sorted, and
our processing scripts did not sort the output either, so from just looking at
diffs it's hard to say what changed. So let's keep the original data, at least
for a few update cycles, so get a better handle on the upstream changes.

It's a few hundred kilobytes, so not that big, and text, so it should
compresses well.
2017-10-02 13:19:22 +02:00
Zbigniew Jędrzejewski-Szmek 689f489812 hwdb: update
http://www.uefi.org/uefi-pnp-export is returning an internal server error,
so the previous version was used.
2017-10-02 13:19:21 +02:00
Zbigniew Jędrzejewski-Szmek 91dab98ffc meson-hwdb-update.sh: add -n param to skip downloads
Useful to experiment with the patching part w/o redownloading the files.
2017-10-02 13:19:21 +02:00
Zbigniew Jędrzejewski-Szmek 9e82570e73 meson: rename hwdb update target
ninja -c build hwdb-update

During the initial meson conversion, custom_target:s and run_target:s behaved
the same, and the target name became a top-level command. Now custom_target:s
require the subdir to be included, e.g. we have man/man target to build man pages,
but run_target:s not. So I think this target got a name that is so generic because
of the confusion caused by changing rules. Let's rename it.
2017-10-02 13:19:21 +02:00
Andreas Rammhold ec2ce0c5d7
tree-wide: use `!IN_SET(..)` for `a != b && a != c && …`
The included cocci was used to generate the changes.

Thanks to @flo-wer for pointing this case out.
2017-10-02 13:09:56 +02:00
Andreas Rammhold 3742095b27
tree-wide: use IN_SET where possible
In addition to the changes from #6933 this handles cases that could be
matched with the included cocci file.
2017-10-02 13:09:54 +02:00
Lennart Poettering 5aaeeffb5f man: document that PAMName= and NotifyAccess=all don't mix well.
See: #6045
2017-10-02 12:58:42 +02:00
Lennart Poettering b13ddbbcf3 service: accept the fact that the three xyz_good() functions return ints
Currently, all three of cgroup_good(), main_pid_good(),
control_pid_good() all return an "int" (two of them propagate errors).
It's a good thing to keep the three functions similar, so let's leave it
at that, but then let's clean up the invocation of the three functions
so that they always clearly acknowledge that the return value is not a
bool, but potentially negative.
2017-10-02 12:58:42 +02:00
Lennart Poettering 019be28676 service: drop _pure_ decorator on static function
The compiler should be good enough to figure this out on its own if this
is a static function, and it makes control_pid_good() an outlier anyway,
and decorators like this tend to bitrot. Hence, to keep things simple
and automatic, let's just drop the decorator.
2017-10-02 12:58:42 +02:00
Lennart Poettering 3c751b1bfa service: a cgroup empty notification isn't reason enough to go down
The processes associated with a service are not just the ones in its
cgroup, but also the control and main processes, which might possibly
live outside of it, for example if they transitioned into their own
cgroups because they registered a PAM session of their own. Hence, if we
get a cgroup empty notification always check if the main PID is still
around before taking action too eagerly.

Fixes: #6045
2017-10-02 12:58:42 +02:00
Lennart Poettering 07697d7ec5 service: add explanatory comments to control_pid_good() and cgroup_good()
Let's add a similar comment to each as we already have for
main_pid_good(), emphasizing that these functions are supposed to be
have very similar.
2017-10-02 12:58:42 +02:00
Lennart Poettering 51894d706f service: fix main_pid_good() comment
We don't actually return -1, don't claim that.
2017-10-02 12:58:37 +02:00
Alan Jenkins 2d4b910383 units: DefaultDependencies already implies conflict with shutdown.target
(and system-update.target does not have DefaultDependencies=no)
2017-09-30 22:02:05 +01:00
Alan Jenkins 0b9ad5bf2e units: add missing Before=shutdown.target for units which it Conflicts
There's a few services missing this ordering.

Also remove a duplicate Conflicts=shutdown.target from
systemd-volatile-root.service.
2017-09-30 22:01:42 +01:00
Piotr Drąg 965d824031 catalog: update Polish translation (#6947) 2017-09-30 14:39:29 +02:00
Alan Jenkins 6f6d1a8a6a units: add missing ordering deps for Conflicts= of emergency.service
1. If we exited emergency mode immediately, we don't want to have an
   irreversible stop job still running for syslog.socket.  I _suspect_ that
   can't happen, but let's not waste effort working out exactly why it's
   impossible and not just very improbable.

2. Similarly, it seems undesirable to have rescue.service and
   emergency.service both running with an open FD of /dev/console, for
   however short a period.
2017-09-29 17:35:44 +01:00
Alan Jenkins 950d8fcdd9 units: express Conflict in syslog.socket instead of emergency.service
Note this commit only changes how the code is expressed; it does not change
the existence of any dependency.

The `Conflicts=` was added in 3136ec90, "Stop syslog.socket when entering
emergency mode".  The discussion in the issue #266 raised concerns that
this might be needed for other units, but failed to point out why
syslog.socket is special.  The reason is that syslog.socket has
DefaultDepedencies=no, so it does not get Requires=sysinit.target like
other socket units do.  But syslog.service does require sysinit.target,
among other things.

We don't have many socket, path, or timer units with
DefaultDependencies=no, and I don't think any of the triggered services
have such additional hard dependencies as syslog.service does.

It is much less confusing if we keep this `Conflicts=` in the same file as
the `DefaultDependencies=no` which made it necessary.
2017-09-29 17:34:55 +01:00
Alan Jenkins a3b22cc596 units: do not kill rescue shell when machines.target is started
The original aim of this commit is that starting machines.target from the
rescue shell would not kill the rescue shell and lock you out of the
system.

This is similar to commit 6579a622, for the conflict between
sysinit.target and the _emergency_ shell.  That particular commit
introduced an ordering cycle and will need to be reverted and/or
fixed.  This one does not, because it does not need to introduce any new
dependencies.

The reason why this commit is allowable also has it's own merit:

machines.target was not marked as AllowIsolate.  Also, the point of
containers is to not escape them...  I don't think we want to promote
machines.target as a default target or similar; you would generally want
some system service to allow you to shut down the machine, for example.  I
don't see this approach used in CoreOS, nor in Fedora Atomic Host; we are
missing any positive examples of its utility.

Requires=basic.target / After=basic.target can be removed for the same
reason.
2017-09-29 17:32:14 +01:00
Lennart Poettering a4f3375d72 resolved: synthesize records for the full local hostname, too
This was forgotten, let's add it too, so that the llmnr, mdns and full
hostname RRs are all synthesized if needed.
2017-09-29 18:05:51 +02:00
Lennart Poettering 2855b6c39c resolved: make sure a non-existing PTR record never gets mangled into NODATA
Previously, if a PTR query is seen for a non-existing record, we'd
generate an empty response (but not NXDOMAIN or so). Fix that. If we
have no data about an IP address, then let's say so, so that the
original error is returned, instead of anything synthesized.

Fixes: #6543
2017-09-29 18:02:31 +02:00
Lennart Poettering acf06088d3 resolved: when there is no gateway, make sure _gateway results in NXDOMAIN
Let's ensure that "no gateway" translates to "no domain", instead of an
empty reply. This is in line with what nss-myhostname does in the same
case, hence let's unify behaviour here of nss-myhostname and resolved.
2017-09-29 18:01:04 +02:00
Lennart Poettering 21a13ab054 sd-bus: drop bloom fields
These fields are unused since kdbus support has been removed.
2017-09-29 17:58:11 +02:00
Lennart Poettering 532f808fd1 sd-bus: drop match cookie concept
THe match cookie was used by kdbus to identify matches we install
uniquely. But given that kdbus is gone, the cookie serves no process
anymore, let's kill it.
2017-09-29 17:57:34 +02:00
Lennart Poettering e28d086553 sd-bus: when showing brief message info show error name in debug out put too
When debug logging is enabled we show brief information about every bus
message we send or receieve. Pretty much all information is shown,
except for the error name if a message is an error (interestingly we do
print the error text however). Fix that, and add the error name as well.
2017-09-29 17:48:29 +02:00
Lennart Poettering 894fcf91ed Merge pull request #6942 from keszybz/remove-sys
Remove sys if necessary
2017-09-29 15:48:23 +02:00
Lennart Poettering 7941e2189b mount-util: add fusectl to list of API VFS 2017-09-29 14:36:33 +02:00
Lennart Poettering 154d22695a dissect: split list of discard-supporting fs out into mount-util.c
Let's manage the list of file systems that do a specific thing at one
place, following similar naming.

No functional changes.
2017-09-29 14:36:29 +02:00
Lennart Poettering 896f937f58 dissect: automatically mark partitions read-only that have a read-only file system
Specifically, squashfs and iso9660 are always read-only, hence make sure
we never even think about mounting them writable.
2017-09-29 14:36:29 +02:00
Zbigniew Jędrzejewski-Szmek 0bca795456 sys-script: remove output directory if it exists
meson will occasionally call us even though the output directory
exists. Let's just nuke and recreate in that case.
2017-09-29 12:28:25 +02:00
Zbigniew Jędrzejewski-Szmek 227ef9bc38 create-sys-script: adapt to separate build dir, modernize, add more checks
The script wasn't apparently used since the switch to meson, because
it required the sys subdirectory to be present in the same subdirectory
where the output script is located.

Let's use f-strings to make the whole thing more readable. Add some
extra checks.
2017-09-29 12:27:21 +02:00
John Lin 01a65d4180 man: move non-target units together (#6934) 2017-09-28 19:56:50 +02:00
Zbigniew Jędrzejewski-Szmek 56d50ab1d3 meson: move library version defines to the top (#6939) 2017-09-28 19:24:16 +02:00
Lennart Poettering e88fe88877 Merge pull request #6936 from poettering/news-235
News 235
2017-09-28 19:22:55 +02:00
Lennart Poettering aecc6f6b34 Merge pull request #6933 from yuwata/use_in_set
use IN_SET macro
2017-09-28 19:22:09 +02:00
Lennart Poettering 63950427ab meson: bump release to 235 2017-09-28 11:29:52 +02:00
Lennart Poettering fa991fb72b add some more things to TODO 2017-09-28 11:26:11 +02:00
Lennart Poettering fccf5419e8 prepare NEWS for 235 2017-09-28 11:26:02 +02:00
Yu Watanabe 945c2931bb libsystemd: use IN_SET macro 2017-09-28 17:37:59 +09:00
Lennart Poettering cd4826e0e6 Merge pull request #6924 from andir/vrf-dhcpv4
networkd: use VRFs routing table for DHCP routes
2017-09-28 09:46:03 +02:00
Franck Bui 7e760b79ad udev-rules: all values can contain escaped double quotes now (#6890)
This is primarly useful to support escaped double quotes in PROGRAM or
IMPORT{program} directives.

The only possibilty before this patch was to use an external shell script but
this seems too cumbersome for trivial logics such as

 PROGRAM=="/bin/sh -c 'FOO=\"%s{model}\"; echo ${FOO:0:4}'"

or any similar shell constructs that needs to deals with patterns including
whitespaces.

As it's the case for single quote and for directives running a program, words
within escaped double quotes will be considered as a single argument.

Fixes: #6835
2017-09-28 08:53:46 +02:00
Zbigniew Jędrzejewski-Szmek 9500b9209b Merge pull request #6928 from poettering/cgroup-empty-race
rework cgroup empty notification handling (i.e. a fix for #6608)
2017-09-28 08:48:21 +02:00
Yu Watanabe 74dead3461 networkd: use assert_not_reached() 2017-09-28 15:38:50 +09:00