]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 years agotest-cgroup-util: add a "test" to print out cg_is_*_wanted() values 4670/head
Zbigniew Jędrzejewski-Szmek [Thu, 23 Feb 2017 00:57:11 +0000 (19:57 -0500)] 
test-cgroup-util: add a "test" to print out cg_is_*_wanted() values

This isn't terribly useful because /sys/fs/cgroup will usually be mounted.
But it at least allows checking if the values make sense in this case.

8 years agocgroup-util: fix the case of default=unified, unified-cgroup-hierarchy=0
Zbigniew Jędrzejewski-Szmek [Thu, 23 Feb 2017 00:55:31 +0000 (19:55 -0500)] 
cgroup-util: fix the case of default=unified, unified-cgroup-hierarchy=0

We should mount the hybrid hierarchy if the user disabled the unified
hierarchy on the kernel command line.

8 years agocgroup-util: cache all cg_is_*_wanted answers, disable /sys/fs/cgroups/unified on...
Zbigniew Jędrzejewski-Szmek [Wed, 22 Feb 2017 17:57:43 +0000 (12:57 -0500)] 
cgroup-util: cache all cg_is_*_wanted answers, disable /sys/fs/cgroups/unified on unified

If we encounter an error in proc cmdline parsing, just treat that as permanent,
i.e. the same as if the option was not specified. Realistically, it is better
to use the same condition for all related mounts, then to have e.g.
/sys/fs/cgroup mounted and /sys/fs/cgroup/unified not. If we find something is
mounted and base our answer on that, cache that result too.

Fix the conditions so that if "unified" is used, make sure any "hybrid" mounts
are not mounted.

8 years agoman: update descriptions of argument-less kernel cmdline args
Zbigniew Jędrzejewski-Szmek [Mon, 20 Feb 2017 01:02:12 +0000 (20:02 -0500)] 
man: update descriptions of argument-less kernel cmdline args

This updates the man page for the changes introduced in 1d84ad944520fc3e062ef518c4db4e1d3a1866af.
"=" is kep if the option is predominantly used with an argument, and dropped
otherwise.

v2:
 - update also description of log_color
 - drop '=' in all cases where it is optional
   (previous rule of dropping it only in some cases was just too arbitrary.)

8 years agoman: describe the cgroup hierarchy kernel commandline options
Zbigniew Jędrzejewski-Szmek [Mon, 20 Feb 2017 00:33:48 +0000 (19:33 -0500)] 
man: describe the cgroup hierarchy kernel commandline options

Fixes #4827.

v2:
- update for the inverted interpration of systemd.legacy_systemd_cgroup_controller

8 years agocore/mount-setup: if unified hierarchy is not supported, fall back to legacy
Zbigniew Jędrzejewski-Szmek [Sun, 19 Feb 2017 20:59:21 +0000 (15:59 -0500)] 
core/mount-setup: if unified hierarchy is not supported, fall back to legacy

We need this to gracefully support older or strangely configured kernels.

v2:
- do not install a callback handler, just embed the right conditions into
  cg_is_*_wanted()

v3:
- fix bug in cg_is_legacy_wanted()

8 years agoRename cg_is_unified_systemd_controller_wanted to cg_is_hybrid_wanted
Zbigniew Jędrzejewski-Szmek [Sun, 19 Feb 2017 20:36:56 +0000 (15:36 -0500)] 
Rename cg_is_unified_systemd_controller_wanted to cg_is_hybrid_wanted

Less typing and doesn't make the table so incredibly wide.

8 years agobuild-sys: default to hybrid cgroup hierarchy
Zbigniew Jędrzejewski-Szmek [Sun, 19 Feb 2017 05:09:31 +0000 (00:09 -0500)] 
build-sys: default to hybrid cgroup hierarchy

It is expected that general-purpose distributions might want to override this.
This commit is made separate from grandparent to make it easy to revert if
needed.

v2:
- use hybrid as the default
  (We tested that the default of unified seems boot correctly everywhere and behave
   correctly in general, but it is incompatible with docker/lxc and probably some
   other tools, so for now we default to hybrid. The new "hybrid" mode should work
   be OK for those tools.)

Fixes #4669.

8 years agobuild.h: include default cgroup hierarchy setting in --version output
Zbigniew Jędrzejewski-Szmek [Sun, 19 Feb 2017 04:28:01 +0000 (23:28 -0500)] 
build.h: include default cgroup hierarchy setting in --version output

This is pretty important, and we print this string during startup, so putting
the default hierarchy information might help with diagnosis if things go awry.

$ ./systemctl --version
systemd 232
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN default-hierarchy=legacy

v2: make the message nicer by including the ./configure option argument
directly in output

8 years agopid1: add ./configure switch to select default cgroup hierarchy
Zbigniew Jędrzejewski-Szmek [Sun, 19 Feb 2017 04:13:15 +0000 (23:13 -0500)] 
pid1: add ./configure switch to select default cgroup hierarchy

The default default is set to "legacy", with "hybrid" and "unified"
being the other two alternatives.

There invert the behaviour for systemd.legacy_systemd_cgroup_controller:
if it is not specified on the kernel command line, "hybrid" is used if
selected as the default. If this option is specified, "hybrid" is used if false,
and full "legacy" if true.

Also make all fields in the configure summary lowercase (unless they are
capitalized names) for consistency.

v2:
- update for the fixed interpreation of systemd.legacy_systemd_cgroup_controller

8 years agocore: keep supporting cgroup hybrid layout from v232 for live upgrades
Tejun Heo [Wed, 23 Nov 2016 17:27:32 +0000 (12:27 -0500)] 
core: keep supporting cgroup hybrid layout from v232 for live upgrades

v232's cgroup hybrid mode mounted v2 on /sys/fs/cgroup/systemd, which
unfortunately broke other tools which expect v1 there.  From v233 on, hybrid
mode instead mounts and uses v2 on /sys/fs/cgroup/unified and keeps
/sys/fs/cgroup/systemd on v1 for compatibility with external tools.  However,
to keep systemd live upgrades working, v233+ should be able to recognize v232
layout and keep using it.

This patch adds v232 hybrid mode support.  If v232 layout is detected,
cg_unified(SYSTEMD_CGRouP_CONTROLLER) keeps returning %true but
cg_hybrid_unified() returns %false.  This keeps process management on cgroup v2
but turns off the parallel layout.

8 years agocore: make hybrid cgroup unified mode keep compat /sys/fs/cgroup/systemd hierarchy
Tejun Heo [Mon, 21 Nov 2016 19:45:53 +0000 (14:45 -0500)] 
core: make hybrid cgroup unified mode keep compat /sys/fs/cgroup/systemd hierarchy

Currently the hybrid mode mounts cgroup v2 on /sys/fs/cgroup instead of the v1
name=systemd hierarchy.  While this works fine for systemd itself, it breaks
tools which expect cgroup v1 hierarchy on /sys/fs/cgroup/systemd.

This patch updates the hybrid mode so that it mounts v2 hierarchy on
/sys/fs/cgroup/unified and keeps v1 "name=systemd" hierarchy on
/sys/fs/cgroup/systemd for compatibility.  systemd itself doesn't depend on the
"name=systemd" hierarchy at all.  All operations take place on the v2 hierarchy
as before but the v1 hierarchy is kept in sync so that any tools which expect
it to be there can keep doing so.  This allows systemd to take advantage of
cgroup v2 process management without requiring other tools to be aware of the
hybrid mode.

The hybrid mode is implemented by mapping the special systemd controller to
/sys/fs/cgroup/unified and making the basic cgroup utility operations -
cg_attach(), cg_create(), cg_rmdir() and cg_trim() - also operate on the
/sys/fs/cgroup/systemd hierarchy whenever the cgroup2 hierarchy is updated.

While a bit messy, this will allow dropping complications from using cgroup v1
for process management a lot sooner than otherwise possible which should make
it a net gain in terms of maintainability.

v2: Fixed !cgns breakage reported by @evverx and renamed the unified mount
    point to /sys/fs/cgroup/unified as suggested by @brauner.

v3: chown the compat hierarchy too on delegation.  Suggested by @evverx.

v4: [zj]
- drop the change to default, full "legacy" is still the default.

8 years agocgroup-util: fix the reversed return value of cg_is_unified_systemd_contoller_wanted
Zbigniew Jędrzejewski-Szmek [Mon, 20 Feb 2017 17:26:53 +0000 (12:26 -0500)] 
cgroup-util: fix the reversed return value of cg_is_unified_systemd_contoller_wanted

1d84ad944520fc3e062ef518c4db4e1 reversed the meaning of the option.
The kernel command line option has the opposite meaning to the function,
i.e. specifying "legacy=yes" means "unifed systemd controller=no".

8 years agocore: make SYSTEMD_CGROUP_CONTROLLER a special string
Tejun Heo [Mon, 21 Nov 2016 19:45:53 +0000 (14:45 -0500)] 
core: make SYSTEMD_CGROUP_CONTROLLER a special string

SYSTEMD_CGROUP_CONTROLLER is currently defined as "name=systemd" which cgroup
utility functions interpret as a named cgroup hierarchy with the specified
named.  With the planned cgroup hybrid mode changes, SYSTEMD_CGROUP_CONTROLLER
would map to different hierarchy names.

This patch makes SYSTEMD_CGROUP_CONTROLLER a special string "_systemd" which is
substituted to "name=systemd" by the cgroup utility functions.  This allows the
callers to address the systemd hierarchy without actually specifying the
hierarchy name allowing the cgroup utility functions to map it to whatever is
appropriate.

Note that SYSTEMD_CGROUP_CONTROLLER was already special on full unified cgroup
hierarchy even before this patch.

8 years agocore: simplify cg_[all_]unified()
Tejun Heo [Mon, 21 Nov 2016 19:45:53 +0000 (14:45 -0500)] 
core: simplify cg_[all_]unified()

cg_[all_]unified() test whether a specific controller or all controllers are on
the unified hierarchy.  While what's being asked is a simple binary question,
the callers must assume that the functions may fail any time, which
unnecessarily complicates their usages.  This complication is unnecessary.
Internally, the test result is cached anyway and there are only a few places
where the test actually needs to be performed.

This patch simplifies cg_[all_]unified().

* cg_[all_]unified() are updated to return bool.  If the result can't be
  decided, assertion failure is triggered.  Error handlings from their callers
  are dropped.

* cg_unified_flush() is updated to calculate the new result synchrnously and
  return whether it succeeded or not.  Places which need to flush the test
  result are updated to test for failure.  This ensures that all the following
  cg_[all_]unified() tests succeed.

* Places which expected possible cg_[all_]unified() failures are updated to
  call and test cg_unified_flush() before calling cg_[all_]unified().  This
  includes functions used while setting up mounts during boot and
  manager_setup_cgroup().

8 years agonspawn: fix cgroup mode detection
Tejun Heo [Mon, 21 Nov 2016 19:45:53 +0000 (14:45 -0500)] 
nspawn: fix cgroup mode detection

cgroup mode detection is broken in two different ways.

* detect_unified_cgroup_hierarchy() is called too nested in outer_child().
  sync_cgroup() which is used by run() also needs to know the requested cgroup
  mode but it's currently always getting CGROUP_UNIFIED_UNKNOWN.  This makes it
  skip syncing the inner cgroup hierarchy on some config combinations.

   $ cat /proc/self/cgroup | grep systemd
   1:name=systemd:/user.slice/user-0.slice/session-c1.scope

   $ UNIFIED_CGROUP_HIERARCHY=0 SYSTEMD_NSPAWN_USE_CGNS=0 systemd-nspawn -M container
   ...
   [root@container ~]# cat /proc/self/cgroup | grep systemd
   1:name=systemd:/machine.slice/machine-container.x86_64.scope
   $ exit

   $ UNIFIED_CGROUP_HIERARCHY=1 SYSTEMD_NSPAWN_USE_CGNS=0 systemd-nspawn -M container
   [root@container ~]# cat /proc/self/cgroup | grep 0::
   0::/
   $ exit

  Note how the unified hierarchy case's path is not synchronized with the host.
  This for example can cause issues when there are multiple such containers.

  Fixed by moving detect_unified_cgroup_hierarchy() invocation to main().

* inner_child() was invoking cg_unified_flush().  inner_child() executes fully
  scoped and can't determine which cgroup mode the host was in.  It doesn't
  make sense to keep flushing the detected mode when the host mode can't
  change.

  Fixed by replacing cg_unified_flush() invocations in outer_child() and
  inner_child() with one in main().

8 years agojournalctl: add reference to sd-id128(3) to output (#5382)
Lucas Werkmeister [Sat, 18 Feb 2017 21:36:25 +0000 (22:36 +0100)] 
journalctl: add reference to sd-id128(3) to output (#5382)

SD_ID128_MAKE is clearly not a standard C macro, so let’s point the user
to its documentation to let them know which header they need and what
they can then do with MESSAGE_XYZ.

8 years agoman: sd-id128: fix journalctl option name (#5381)
Lucas Werkmeister [Sat, 18 Feb 2017 21:34:28 +0000 (22:34 +0100)] 
man: sd-id128: fix journalctl option name (#5381)

--new-id works because it’s an unambiguous prefix, but the full option
name is --new-id128.

8 years agoMerge pull request #5369 from poettering/nspawn-resolved
Zbigniew Jędrzejewski-Szmek [Sat, 18 Feb 2017 16:54:34 +0000 (11:54 -0500)] 
Merge pull request #5369 from poettering/nspawn-resolved

fixes for running nspawn+resolved in combination

8 years agounits: order systemd-nspawn@.service after systemd-resolved.service 5369/head
Lennart Poettering [Thu, 16 Feb 2017 16:57:30 +0000 (17:57 +0100)] 
units: order systemd-nspawn@.service after systemd-resolved.service

This way, the nspawn internal check whether resolved is running will
succeed if it is enabled.

Fixes: #4649
8 years agonspawn: tweak check whether resolved is around a bit
Lennart Poettering [Thu, 16 Feb 2017 16:56:10 +0000 (17:56 +0100)] 
nspawn: tweak check whether resolved is around a bit

Let's check D-Bus instead of files in /run to see if resolved is
running. This is a bit nicer as bus names are automatically cleaned up
when resolved dies, which is not the case for files in /run.

See: #4649

8 years agounits: enable resolved bus activation though a symlink in /etc
Lennart Poettering [Thu, 16 Feb 2017 16:48:48 +0000 (17:48 +0100)] 
units: enable resolved bus activation though a symlink in /etc

The change:
-/usr/lib/systemd/system/dbus-org.freedesktop.resolve1.service
+/etc/systemd/system/dbus-org.freedesktop.resolve1.service

If resolved is disabled, without this, talking to the resolved bus API will
activate it regardless whether it is enabled or not, let's fix that.

8 years agotest: re-drop assumption that /run is a mount point (#5377)
Martin Pitt [Fri, 17 Feb 2017 20:29:02 +0000 (21:29 +0100)] 
test: re-drop assumption that /run is a mount point (#5377)

Commit 436e916ea introduced the assumption into test-stat-util that /run
is a tmpfs mount point. This is not the case in build chroots such as
Fedora's mock or Debian's sbuild. So only assert that /run is a tmpfs
and not a btrfs if /run is actually a mount point. This will then still
be asserted with installed tests.

8 years agosystemctl: show extra args if defined (#5379)
Adrián López [Fri, 17 Feb 2017 20:27:45 +0000 (21:27 +0100)] 
systemctl: show extra args if defined (#5379)

8 years agoMerge pull request #5373 from poettering/coredump-timestamp-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 20:23:52 +0000 (15:23 -0500)] 
Merge pull request #5373 from poettering/coredump-timestamp-fixes

various coredump fixes

8 years agoMerge pull request #5347 from poettering/local-nta
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 20:00:36 +0000 (15:00 -0500)] 
Merge pull request #5347 from poettering/local-nta

more resolved fixes

8 years agomissing: add renameat2() definition for 64bit arm (#5378)
Lennart Poettering [Fri, 17 Feb 2017 18:10:09 +0000 (19:10 +0100)] 
missing: add renameat2() definition for 64bit arm (#5378)

Following a similar commit in casync:

https://github.com/systemd/casync/pull/10

8 years agoMerge pull request #5275 from ssahani/fix-dropin-net-section
Lennart Poettering [Fri, 17 Feb 2017 17:03:04 +0000 (18:03 +0100)] 
Merge pull request #5275 from ssahani/fix-dropin-net-section

networkd: fix drop-in conf directory configs overwriting each other

8 years agoudev: fix id_net_name_path for virtio-ccw interfaces (#5357)
Viktor Mihajlovski [Fri, 17 Feb 2017 15:18:01 +0000 (16:18 +0100)] 
udev: fix id_net_name_path for virtio-ccw interfaces (#5357)

The CCW id_net_name_path detection didn't account for virtio
interfaces on the CCW bus. As a result the default interface
names for virtio-ccw interfaces would use the old eth<x>
format instead of enc<busid>.

Since virtio-pci interface naming follows the naming rules
of the parent bus, the names_ccw() logic was changed to apply
the CCW interface naming rules to virtio interfaces as well,
e.g. enc2000 for an interface with a CCW bus id 0.0.2000.
As virtio interfaces are apt to get the otherwise unusual
CCW bus id 0.0.0000, the last '0' is now preserved in this
case.

The virtio subsystem skipping loop has been moved from
names_pci() into a function skip_virtio() that can be reused
for all bus types with virtio network devices.

Since virtio-ccw interfaces use single CCW addresses the ccwgroup
requirement was relaxed and the C definitions were changed
accordingly.

8 years agonetwork: change condition in if testing section presence 5275/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 14:34:25 +0000 (09:34 -0500)] 
network: change condition in if testing section presence

section_line and filename should be set together or not at all. Change the
if to test filename, since it's the first of the pair and it seems more natural
to test that.

8 years agonetworkd: immediately transfer ownership of route->section
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 14:26:10 +0000 (09:26 -0500)] 
networkd: immediately transfer ownership of route->section

The code was not incorrect previously, but I think it's easier to follow the
ownership (and the code is more likely to remain correct when updated later on),
if freeing of NetworkConfigSection* is immediately made the responsibility of
route_free(), so instead of relying on route_free() not freeing ->section
if adding to the network hashmap failed, make this freeing unconditional.

8 years agoMerge pull request #5333 from poettering/machined-copy-files-userns
Lennart Poettering [Fri, 17 Feb 2017 12:51:58 +0000 (13:51 +0100)] 
Merge pull request #5333 from poettering/machined-copy-files-userns

machined userns fixes

8 years agoMerge pull request #5366 from poettering/default-hostname-fix
Lennart Poettering [Fri, 17 Feb 2017 12:51:27 +0000 (13:51 +0100)] 
Merge pull request #5366 from poettering/default-hostname-fix

fallback hostname fixes

8 years agoman: document that user namespacing complicates file copies 5333/head
Lennart Poettering [Thu, 16 Feb 2017 13:38:05 +0000 (14:38 +0100)] 
man: document that user namespacing complicates file copies

8 years agocoredump: store the full coredump kernel context in xattrs on the coredump file 5373/head
Lennart Poettering [Fri, 17 Feb 2017 10:34:29 +0000 (11:34 +0100)] 
coredump: store the full coredump kernel context in xattrs on the coredump file

We didn't include the resource limit field, add it.

8 years agocoredump: when reconstructing original kernel coredump context, chop off trailing...
Lennart Poettering [Fri, 17 Feb 2017 10:31:07 +0000 (11:31 +0100)] 
coredump: when reconstructing original kernel coredump context, chop off trailing zeroes

Our coredump handler operates on a "context" supplied by the kernel via
the core_pattern arguments. When we pass off a coredump for processing
to coredumpd we pass along enough information for this context to be
reconstructed. This information is passed in the usual journal fields,
and that means we extended the 1s granularity timestamp to 1µs
granularity by appending 6 zeroes. We need to chop them off again when
reconstructing the original kernel context.

Fixes: #4779
8 years agoudevd: use signal_to_string() instead of strsignal() at one place
Lennart Poettering [Fri, 17 Feb 2017 10:18:22 +0000 (11:18 +0100)] 
udevd: use signal_to_string() instead of strsignal() at one place

strsignal() sucks, as it tries to generate human readable strings from
something that isn't really human readable by concept. Let's use
signal_to_string() instead, making this more grokkable. Difference is:
SIGINT gets translated → "SIGINT" rather than → "Interrupted".

8 years agocoredump: include signal name in journal metadata
Lennart Poettering [Fri, 17 Feb 2017 10:10:35 +0000 (11:10 +0100)] 
coredump: include signal name in journal metadata

(Note that we only do this for the journal metadata, not for the xattrs,
as the xattrs are only supposed to store the original 1:1 info we
acquired from the kernel.)

8 years agocoredump: fix handling of special crashes
Lennart Poettering [Fri, 17 Feb 2017 09:59:21 +0000 (10:59 +0100)] 
coredump: fix handling of special crashes

When we encounter a "special" crash we should not continue processing it
the usual way.

8 years agoresolved: try to authenticate SOA on negative replies 5347/head
Lennart Poettering [Wed, 15 Feb 2017 19:05:27 +0000 (20:05 +0100)] 
resolved: try to authenticate SOA on negative replies

For caching negative replies we need the SOA TTL information. Hence,
let's authenticate all auxiliary SOA RRs through DS requests on all
negative requests.

8 years agoresolved: extend various timeouts
Lennart Poettering [Wed, 15 Feb 2017 18:56:59 +0000 (19:56 +0100)] 
resolved: extend various timeouts

Let's increase a number of timeouts as they apparently are too short for
some real-world lookups.

See:

https://github.com/systemd/systemd/issues/4003#issuecomment-279842616

In particular we change the following timeouts:

1) The first UDP retry we increase 500ms → 750ms. This is a good idea,
   since some servers need relatively long responses for trivial lookups,
   and giving up our first attempt also has the effect of trying a
   different server for the next attempt which has the side effect that
   we'll run two down-grade iterations in parallel, on both servers.
   Hence, let's give servers a bit more time in the first iteration.

2) Permit 24 retries instead of just 16 per transactions. If we end up
   downgrading all the way down to UDP for a lookup we already need 5
   iterations for that. If we want permit a couple of lost packages for
   each (let's say 4), then we already need 20 iterations.

3) Increase the overall query timeout on the service side to 60s (from
   45s), simply because very long and slow DNSSEC + CNAME chains (such as
   us.ynuf.alipay.com) hit this boundary too easily. The client side
   timeout for the bus method call is increased to 90s, in order to have
   room for the dbus reply to go through

8 years agoresolved: initialize all return values on successful exit of dns_cache_lookup()
Lennart Poettering [Wed, 15 Feb 2017 18:55:34 +0000 (19:55 +0100)] 
resolved: initialize all return values on successful exit of dns_cache_lookup()

Following our coding style on success we should initialize all return
parameters of a function. We missed to cases for dns_cache_lookup() (but
covered all others), fix them too.

8 years agoresolved: show rcode in debug output for incoming replies
Lennart Poettering [Wed, 15 Feb 2017 18:54:32 +0000 (19:54 +0100)] 
resolved: show rcode in debug output for incoming replies

This is the most important piece of information of replies, hence show
this in the first log message about it.

(Wireshark shows it too in the short summary, hence this definitely
makes sense...)

8 years agoresolved: don't downgrade feature level if we get RCODE on UDP level
Lennart Poettering [Wed, 15 Feb 2017 17:53:25 +0000 (18:53 +0100)] 
resolved: don't downgrade feature level if we get RCODE on UDP level

Retrying a transaction via TCP is a good approach for mitigating
packet loss. However, it's not a good away way to fix a bad RCODE if we
already downgraded to UDP level for it. Hence, don't do this.

This is a small tweak only, but shortens the time we spend on
downgrading when a specific domain continously returns a bad rcode.

8 years agoresolved: cache SERVFAIL responses for 30s
Lennart Poettering [Wed, 15 Feb 2017 17:28:23 +0000 (18:28 +0100)] 
resolved: cache SERVFAIL responses for 30s

Some domains (such as us.ynuf.alipay.com) almost appear as if they actively
want to sabotage our DNSSEC work. Specifically, they unconditionally
return SERVFAIL on SOA lookups and always only after a 1s delay (at
least). This is pretty bad for our validation logic, as we use SOA
lookups to distuingish zones from non-terminal names. Moreover, SERVFAIL
is an error that is typically returned if we send requests a server
doesn't grok, and thus is reason for us to downgrade our protocol and
try again. In case of these zones this means we'll accept the SERVFAIL
response only after a full iterative downgrade to our lowest feature
level: TCP. In combination with the 1s delays this has the effect of
making us hit our transaction timeout way to easily.

As first attempt to improve the situation: let's start caching SERVFAIL
responses in our cache, after the full downgrade for a short period of
time.

Conceptually this is exposed as "weird rcode" caching, but for now we
only consider SERVFAIL a "weird rcode" worthy of caching. Later on we
might want to add more.

8 years agoresolved: lengthen timeout for TCP transactions
Lennart Poettering [Wed, 15 Feb 2017 17:24:46 +0000 (18:24 +0100)] 
resolved: lengthen timeout for TCP transactions

When we are doing a TCP transaction the kernel will automatically resend
all packets for us, there's no need to do that ourselves. Hence:
increase the timeout for TCP transactions substantially, to give the
kernel enough time to connect to the peer, without interrupting it when
we become impatient.

8 years agoresolved: when DNSSEC mode is disabled, don't go beyond EDNS0 feature level
Lennart Poettering [Wed, 15 Feb 2017 15:01:53 +0000 (16:01 +0100)] 
resolved: when DNSSEC mode is disabled, don't go beyond EDNS0 feature level

There's no point in talking to a server in DNSSEC mode when we don't
actually want to verify anything.

See: #5352

8 years agoresolved: when accepted a query candidate as final answer, propagate authentication...
Lennart Poettering [Wed, 15 Feb 2017 14:29:05 +0000 (15:29 +0100)] 
resolved: when accepted a query candidate as final answer, propagate authentication bool even on failure

Let's make sure that if we accept a query candidate, then let's also
propagate the authenticated flag for it, so that we can properly report
back to the clients whether lookups failed due to non-existance that can
be proven.

8 years agoresolved: propagate AD bit for NXDOMAIN into stub replies
Lennart Poettering [Wed, 15 Feb 2017 14:13:32 +0000 (15:13 +0100)] 
resolved: propagate AD bit for NXDOMAIN into stub replies

When we managed to prove non-existance of a name, then we should
properly propagate this to clients by setting the AD bit on NXDOMAIN.

See: #4621

8 years agoresolved: automatically downgrade reply bits on send
Lennart Poettering [Tue, 14 Feb 2017 18:25:47 +0000 (19:25 +0100)] 
resolved: automatically downgrade reply bits on send

Doesn't really change anything, but makes things a bit simpler to read.

8 years agoresolved: when the dns server feature level grace period elapses, flush caches
Lennart Poettering [Tue, 14 Feb 2017 17:20:34 +0000 (18:20 +0100)] 
resolved: when the dns server feature level grace period elapses, flush caches

The cache might contain all kinds of unauthenticated data that we really
shouldn't be using if we upgrade our feature level and suddenly are able
to get authenticated data again.

Might fix: #4866

8 years agoresolved: fix NSEC proofs for missing TLDs
Lennart Poettering [Tue, 14 Feb 2017 16:54:30 +0000 (17:54 +0100)] 
resolved: fix NSEC proofs for missing TLDs

For the wildcard NSEC check we need to generate an "asterisk" domain, by
prepend the common ancestor with "*.". So far we did that with a simple
strappenda() which is fine for most domains, but doesn't work if the
common ancestor is the root domain as we usually write that as "." in
normalized form, and "*." joined with "." is "*.." and not "*." as it
should be.

Hence, use the clean way out, let's just use dns_name_concat() which
only exists precisely for this reason, to properly concatenate labels.

There's a good chance this actually fixes #5029, as this NSEC proof is
triggered by lookups in the TLD "example", which doesn't exist in the
Internet.

8 years agoresolved: make sure configured NTAs affect subdomains too
Lennart Poettering [Tue, 14 Feb 2017 16:28:17 +0000 (17:28 +0100)] 
resolved: make sure configured NTAs affect subdomains too

This ensures that configured NTAs exclude not only the listed domain but
also all domains below it from DNSSEC validation -- except if a positive
trust anchor is defined below (as suggested by RFC7647, section 1.1)

Fixes: #5048
8 years agomachined: refuse bind mounts on containers that have user namespaces applied
Lennart Poettering [Thu, 16 Feb 2017 12:59:13 +0000 (13:59 +0100)] 
machined: refuse bind mounts on containers that have user namespaces applied

As the kernel won't map the UIDs this is simply not safe, and hence we
should generate a clean error and refuse it.

We can restore this feature later should a "shiftfs" become available in
the kernel.

8 years agomachined: properly propagate long-running operation errors
Lennart Poettering [Mon, 13 Feb 2017 18:39:31 +0000 (19:39 +0100)] 
machined: properly propagate long-running operation errors

Actually initialize the "error" structure with the error we got

8 years agomachined: when copying files from/to userns containers chown to root
Lennart Poettering [Mon, 13 Feb 2017 18:24:01 +0000 (19:24 +0100)] 
machined: when copying files from/to userns containers chown to root

This changes the file copy logic of machined to set the UID/GID of all
copied files to 0 if the host and container do not share the same user
namespace.

Fixes: #4078
8 years agocopy: change the various copy_xyz() calls to take a unified flags parameter
Lennart Poettering [Mon, 13 Feb 2017 18:00:22 +0000 (19:00 +0100)] 
copy: change the various copy_xyz() calls to take a unified flags parameter

This adds a unified "copy_flags" parameter to all copy_xyz() function
calls, replacing the various boolean flags so far used. This should make
many invocations more readable as it is clear what behaviour is
precisely requested. This also prepares ground for adding support for
more modes later on.

8 years agomachinectl: tweak address output in "machinectl status"
Lennart Poettering [Mon, 13 Feb 2017 16:23:58 +0000 (17:23 +0100)] 
machinectl: tweak address output in "machinectl status"

With this change we'll not show an "Addresses" field for machines that
we don't know any addresses for.

This changes print_addresses() to never suffix its output with a
newline, leaving that to the caller. That's a good idea since depending
on who the caller is, different rules apply: if no addresses are found,
then the list view still wants a newline, but the status view does not.

This also changes the function to return the number of found addresses,
which can be used to decide when to add a newline or not.

8 years agomachined: expose "UID shift" concept for containers
Lennart Poettering [Fri, 10 Feb 2017 18:44:09 +0000 (19:44 +0100)] 
machined: expose "UID shift" concept for containers

UID/GID mapping with userns can be arbitrarily complex. Let's break this
down to a single admin-friendly parameter: let's expose the UID/GID
shift of a container via a new bus call for each container, and let's
show this as part of "machinectl status" if it is not 0.

This should work for pretty much all real-life full OS container setups
(i.e. the stuff machined is suppose to be useful for).  For everything
else we generate a clean error, clarifying that we can't expose the
mapping.

8 years agoresolved: default to the compile-time fallback hostname 5366/head
Lennart Poettering [Thu, 16 Feb 2017 11:04:51 +0000 (12:04 +0100)] 
resolved: default to the compile-time fallback hostname

This changes resolved to use the compile-time fallback hostname the
configured one is not set. Note that if the local hostname is set to
"localhost" then we'll instead default to "linux" here, as for
mDNS/LLMNR exposing "localhost" is actively dangerous.

8 years agocore: when booting up, initialize hostname to compile-time fallback hostname
Lennart Poettering [Thu, 16 Feb 2017 11:03:39 +0000 (12:03 +0100)] 
core: when booting up, initialize hostname to compile-time fallback hostname

When /etc/hostname isn't set, default to the configured compile-time
fallback hostname instead of "localhost" for the kernel hostname.

8 years agohostname-util: default to the compile time default hostname in gethostname_malloc()
Lennart Poettering [Thu, 16 Feb 2017 11:02:17 +0000 (12:02 +0100)] 
hostname-util: default to the compile time default hostname in gethostname_malloc()

Currently, if the hostname is not set gethostname_malloc() defaults to
the "sysname", which is "linux" on Linux. Let's change that to also
honour the compile-time fallback hostname as specified on the configure
command line.

8 years agoMerge pull request #5338 from mbiebl/fix-install-tests-target
Evgeny Vereshchagin [Fri, 17 Feb 2017 08:38:23 +0000 (11:38 +0300)] 
Merge pull request #5338 from mbiebl/fix-install-tests-target

Fix "make install-tests" when srcdir != builddir, fix valgrind-tests

8 years agoExport NVMe WWID udev attribute (#5348)
Keith Busch [Fri, 17 Feb 2017 07:46:06 +0000 (00:46 -0700)] 
Export NVMe WWID udev attribute (#5348)

We need this for multipath support without relying on NVMe to SCSI
translations.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agovirt: Update cache if the detected vm is virtualbox (#5364)
Benjamin Robin [Fri, 17 Feb 2017 07:45:30 +0000 (08:45 +0100)] 
virt: Update cache if the detected vm is virtualbox (#5364)

8 years agoman: mention machines.target in systemd.special(7) (#5371)
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 07:44:26 +0000 (02:44 -0500)] 
man: mention machines.target in systemd.special(7) (#5371)

Also sort <refsynopsisdiv>.

8 years agobuild-sys: drop now-unneeded $SYSTEMD_TEST_DATA when running tests 5338/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 04:00:03 +0000 (23:00 -0500)] 
build-sys: drop now-unneeded $SYSTEMD_TEST_DATA when running tests

8 years agotest: drop TEST_DATA_DIR, fold into get_testdata_dir()
Martin Pitt [Wed, 15 Feb 2017 22:37:25 +0000 (23:37 +0100)] 
test: drop TEST_DATA_DIR, fold into get_testdata_dir()

Drop the TEST_DATA_DIR macro as this was using alloca() within a
function call which is allegedly unsafe. So add a "suffix" argument to
get_testdata_dir() instead and call that directly.

8 years agotest: show error message if $SYSTEMD_TEST_DATA does not exist
Martin Pitt [Wed, 15 Feb 2017 07:52:17 +0000 (08:52 +0100)] 
test: show error message if $SYSTEMD_TEST_DATA does not exist

Rename get_exe_relative_testdata_dir() to get_testdata_dir() and move
the env var check into that, so that everything interesting happens at
the same place.

8 years agotests: look for tests relative to source dir when running from build dir
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 00:43:51 +0000 (19:43 -0500)] 
tests: look for tests relative to source dir when running from build dir

automake helpfully sets a few variables for during build. When our executable
is in a directory underneath $(abs_top_builddir), we know that we're in the
build environment $(abs_top_srcdir) contains the sources, and test data is
under $(abs_top_srcdir)/test. This remains true no matter where the build
directory is relative to the source directory. It also works if the test
executable is invoked as ./test-whatever or .libs/test-whatever, since the
relative path is not used at all.

When running from outside of the build directory, we should be running from the
installed location and we can look for ../testdata relative to the location of
the exe file.

Of course, $SYSTEMD_TEST_DATA always overrides this logic.

8 years agoRename $TEST_DIR to $SYSTEMD_TEST_DATA, document it
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 00:17:38 +0000 (19:17 -0500)] 
Rename $TEST_DIR to $SYSTEMD_TEST_DATA, document it

TEST_DIR is rather generic, and we prefix all variables used by installed
executables with "SYSTEMD_".

8 years agotest: setup test data dir before fake runtime dir
Martin Pitt [Tue, 14 Feb 2017 21:33:52 +0000 (22:33 +0100)] 
test: setup test data dir before fake runtime dir

That way, if the test directory does not exist we don't leave behind
temporary files (as in that case or on test failure the cleanup actions
don't run).

8 years agotest: clarify error message if test data directory does not exist
Martin Pitt [Tue, 14 Feb 2017 07:58:19 +0000 (08:58 +0100)] 
test: clarify error message if test data directory does not exist

When trying to directly run a test executable in the build tree without
setting $TEST_DIR, some tests fail with a non-obvious error message.
Print an useful one instead.

8 years agotest: run valgrind-tests under $TESTS_ENVIRONMENT
Martin Pitt [Tue, 14 Feb 2017 07:47:29 +0000 (08:47 +0100)] 
test: run valgrind-tests under $TESTS_ENVIRONMENT

Otherwise we are missing $TEST_DIR for the test data and run the test
against the system-installed binaries and keyboard/locale maps.

8 years agobuild-sys: fix "make install-tests" when srcdir != builddir
Michael Biebl [Tue, 14 Feb 2017 04:38:51 +0000 (05:38 +0100)] 
build-sys: fix "make install-tests" when srcdir != builddir

Follow-up for 4f8425b8d5a3fb2e5ec24b77f1a7a95db55f532c

8 years agoMerge pull request #5370 from evverx/fix-test-journal-importer
Martin Pitt [Thu, 16 Feb 2017 20:35:13 +0000 (21:35 +0100)] 
Merge pull request #5370 from evverx/fix-test-journal-importer

build-sys: treat journal-data/journal-[12].txt as TEST_DATA_FILES

8 years agonss: fix error to ERANGE for nss calls with too little buffer space (#5365)
Lennart Poettering [Thu, 16 Feb 2017 20:29:09 +0000 (21:29 +0100)] 
nss: fix error to ERANGE for nss calls with too little buffer space (#5365)

This is a follow-up for #5359, fixing the error codes in a similar way
for the other NSS modules.

(user/group lookup calls don't have h_errnop, hence we don't update that
in those cases)

8 years agobuild-sys: add exec-privatedevices-[yes|no]-capability-sys-rawio to TEST_DATA_FILES 5370/head
Evgeny Vereshchagin [Thu, 16 Feb 2017 19:28:17 +0000 (19:28 +0000)] 
build-sys: add exec-privatedevices-[yes|no]-capability-sys-rawio to TEST_DATA_FILES

This is a follow-up for 625d8769fa6394a30

8 years agobuild-sys: treat journal-data/journal-[12].txt as TEST_DATA_FILES
Evgeny Vereshchagin [Thu, 16 Feb 2017 19:17:19 +0000 (19:17 +0000)] 
build-sys: treat journal-data/journal-[12].txt as TEST_DATA_FILES

Fixes:
```
Found container virtualization none.
Assertion 'imp.fd >= 0' failed at ../src/test/test-journal-importer.c:43, function test_basic_parsing(). Aborting.
FAIL: test-journal-importer (code: 134)
```
See https://github.com/systemd/systemd/pull/5366#issuecomment-280353804

8 years agohwdb update
Lennart Poettering [Thu, 16 Feb 2017 17:15:55 +0000 (18:15 +0100)] 
hwdb update

8 years agoMerge pull request #4526 from keszybz/coredump-python
Lennart Poettering [Thu, 16 Feb 2017 10:24:03 +0000 (11:24 +0100)] 
Merge pull request #4526 from keszybz/coredump-python

Collect interpreter backtraces in systemd-coredump

8 years agolibsystemd-network: ipv4ll probe conflict counter (#5361)
Jason Reeder [Thu, 16 Feb 2017 10:14:38 +0000 (04:14 -0600)] 
libsystemd-network: ipv4ll probe conflict counter (#5361)

A bug exists where the conflict counter is cleared
regardless of whether or not the next probe attempt leads to
a successful address acquisition. This causes 'bursts' of
MAX_CONFLICTS probes followed by a delay of
RATE_LIMIT_INTERVAL instead of a single probe each
RATE_LIMIT_INTERVAL when beyond MAX_CONFLICTS.

The conflict counter should only be cleared after an
address is successfully acquired. This commit achieves that
goal.

From RFC3927:
A host should maintain a counter of the number of address
conflicts it has experienced in the process of trying to
acquire an address, and if the number of conflicts exceeds
MAX_CONFLICTS then the host MUST limit the rate at which it
probes for new addresses to no more than one new address per
RATE_LIMIT_INTERVAL.  This is to prevent catastrophic ARP
storms in pathological failure cases, such as a rogue host
that answers all ARP probes, causing legitimate hosts to go
into an infinite loop attempting to select a usable address.

Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
8 years agonss-resolve: Fix assertion in ifindex_to_scopeid. (#5360)
Maarten de Vries [Thu, 16 Feb 2017 10:00:49 +0000 (11:00 +0100)] 
nss-resolve: Fix assertion in ifindex_to_scopeid. (#5360)

8 years agonss-resolve: report ERANGE for small buffers. (#5359)
Maarten de Vries [Thu, 16 Feb 2017 09:52:04 +0000 (10:52 +0100)] 
nss-resolve: report ERANGE for small buffers. (#5359)

The correct error code to report when a provided buffer is too small is
ERANGE. This is recognized by glibc, which will then try again with a
larger buffer. The old behaviour of reporting ENOMEM has no special
meaning for glibc. The error will simply be propagated to the
application, and a later retry will trigger the same error again.

Additionally, h_errnop must be set to NETDB_INTERNAL to have glibc look
at errnop for details.

More information at:
https://www.gnu.org/software/libc/manual/html_node/NSS-Modules-Interface.html

8 years agonetworkd: fix drop-in conf directory configs overwriting each other
Susant Sahani [Wed, 15 Feb 2017 04:30:35 +0000 (10:00 +0530)] 
networkd: fix drop-in conf directory configs overwriting each other

Now we track the sections for example [Address] via line number.
Which was fine till we din't had dropins dir. If we have multiple
sections which have the ideantical line number in diffrent files
we are overwriting these since line number is the key.

This patch fixes this by taking filename and line number as key.
This fixes [Address] and [Route] section overwriting.

fixes: #5141

8 years agovirt: swap order of cpuid and dmi again, but properly detect oracle (#5355)
Christian Hesse [Wed, 15 Feb 2017 22:51:31 +0000 (23:51 +0100)] 
virt: swap order of cpuid and dmi again, but properly detect oracle (#5355)

This breaks again, this time for setups where Qemu is not reported via DMI for whatever
reason. So swap order of cpuid and dmi again, but properly detect oracle.

See issue #5318.

8 years agotest-ipcrm: use configured nobody user name (#5350)
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 09:22:22 +0000 (04:22 -0500)] 
test-ipcrm: use configured nobody user name (#5350)

"nfsnobody" is now obsolete.

8 years agocoredump: add note about lack of rollback on oom 4526/head
Zbigniew Jędrzejewski-Szmek [Mon, 16 Jan 2017 01:25:35 +0000 (20:25 -0500)] 
coredump: add note about lack of rollback on oom

8 years agocoredumpctl: display non-coredump coredump entries too
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 18:34:31 +0000 (13:34 -0500)] 
coredumpctl: display non-coredump coredump entries too

$ ./coredumpctl --no-pager -1
TIME                            PID   UID   GID SIG COREFILE EXE
Sun 2016-11-06 10:10:51 EST   29514  1002  1002   - -        /usr/bin/python3.5

$ ./coredumpctl info 29514
           PID: 29514 (python3)
           UID: 1002 (zbyszek)
           GID: 1002 (zbyszek)
        Reason: ZeroDivisionError
     Timestamp: Sun 2016-11-06 10:10:51 EST (3h 22min ago)
  Command Line: python3 systemd_coredump_exception_handler.py
    Executable: /usr/bin/python3.5
 Control Group: /user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
          Unit: user@1002.service
     User Unit: gnome-terminal-server.service
         Slice: user-1002.slice
     Owner UID: 1002 (zbyszek)
       Boot ID: 1531fd22ec84429e85ae888b12fadb91
    Machine ID: 519a16632fbd4c71966ce9305b360c9c
      Hostname: laptop
       Storage: none
       Message: Process 29514 (systemd_coredump_exception_handler.py) of user zbyszek failed with ZeroDivisionError: division by

                Traceback (most recent call last):
                  File "systemd_coredump_exception_handler.py", line 134, in <module>
                    g()
                  File "systemd_coredump_exception_handler.py", line 133, in g
                    f()
                  File "systemd_coredump_exception_handler.py", line 131, in f
                    div0 = 1 / 0
                ZeroDivisionError: division by zero

                Local variables in innermost frame:
                  a=3
                  h=<function f at 0x7efdc14b6ea0>

8 years agotree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 17:48:23 +0000 (12:48 -0500)] 
tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID

Embedding sd_id128_t's in constant strings was rather cumbersome. We had
SD_ID128_CONST_STR which returned a const char[], but it had two problems:
- it wasn't possible to statically concatanate this array with a normal string
- gcc wasn't really able to optimize this, and generated code to perform the
  "conversion" at runtime.
Because of this, even our own code in coredumpctl wasn't using
SD_ID128_CONST_STR.

Add a new macro to generate a constant string: SD_ID128_MAKE_STR.
It is not as elegant as SD_ID128_CONST_STR, because it requires a repetition
of the numbers, but in practice it is more convenient to use, and allows gcc
to generate smarter code:

$ size .libs/systemd{,-logind,-journald}{.old,}
   text    data     bss     dec     hex filename
1265204  149564    4808 1419576  15a938 .libs/systemd.old
1260268  149564    4808 1414640  1595f0 .libs/systemd
 246805   13852     209  260866   3fb02 .libs/systemd-logind.old
 240973   13852     209  255034   3e43a .libs/systemd-logind
 146839    4984      34  151857   25131 .libs/systemd-journald.old
 146391    4984      34  151409   24f71 .libs/systemd-journald

It is also much easier to check if a certain binary uses a certain MESSAGE_ID:

$ strings .libs/systemd.old|grep MESSAGE_ID
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x

$ strings .libs/systemd|grep MESSAGE_ID
MESSAGE_ID=c7a787079b354eaaa9e77b371893cd27
MESSAGE_ID=b07a249cd024414a82dd00cd181378ff
MESSAGE_ID=641257651c1b4ec9a8624d7a40a9e1e7
MESSAGE_ID=de5b426a63be47a7b6ac3eaac82e2f6f
MESSAGE_ID=d34d037fff1847e6ae669a370e694725
MESSAGE_ID=7d4958e842da4a758f6c1cdc7b36dcc5
MESSAGE_ID=1dee0369c7fc4736b7099b38ecb46ee7
MESSAGE_ID=39f53479d3a045ac8e11786248231fbf
MESSAGE_ID=be02cf6855d2428ba40df7e9d022f03d
MESSAGE_ID=7b05ebc668384222baa8881179cfda54
MESSAGE_ID=9d1aaa27d60140bd96365438aad20286

8 years agocoredumpctl: just use argv instead of building a temporary set
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 16:29:31 +0000 (11:29 -0500)] 
coredumpctl: just use argv instead of building a temporary set

No functional change, and we don't lose match order.

8 years agoman: describe systemd-coredump --backtrace
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 15:48:15 +0000 (10:48 -0500)] 
man: describe systemd-coredump --backtrace

8 years agocoredump: with --backtrace accept a journal entry on stdin
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 15:06:32 +0000 (10:06 -0500)] 
coredump: with --backtrace accept a journal entry on stdin

The entry must be a single entry in the journal export format, including the
terminating double newline. The MESSAGE field is now generated on the sender
side.

The advantage is that the reporter can easily pass additional metadata.
Continuing with the example of the python excepthook:

COREDUMP_PYTHON_EXECUTABLE=/usr/bin/python3
COREDUMP_PYTHON_VERSION=3.5.2 (default, Sep 14 2016, 11:28:32)
                        [GCC 6.2.1 20160901 (Red Hat 6.2.1-1)]
COREDUMP_PYTHON_THREAD_INFO=sys.thread_info(name='pthread', lock='semaphore', version='NPTL 2.24')
COREDUMP_PYTHON_EXCEPTION_TYPE=ZeroDivisionError
COREDUMP_PYTHON_EXCEPTION_VALUE=division by zero
MESSAGE=Process 29514 (systemd_coredump_exception_handler.py) of user zbyszek failed with ZeroDivisionError: division by zero

        Traceback (most recent call last):
          File "systemd_coredump_exception_handler.py", line 134, in <module>
            g()
          File "systemd_coredump_exception_handler.py", line 133, in g
            f()
          File "systemd_coredump_exception_handler.py", line 131, in f
            div0 = 1 / 0
        ZeroDivisionError: division by zero

        Local variables in innermost frame:
          a=3
          h=<function f at 0x7efdc14b6ea0>

One consideration is whether to use the Journal Export Format, or send packets
over a UNIX socket instead. The advantage of current solution is that although
parsing is more complicated on the receiver side, it is much easier to use on the
sender side. I hope this can be used by various languages for which writing
binary structures to a UNIX socket is harder and more likely to be done wrong
than piping of a simple textyish format.

8 years agotest-journal-importer: add a test case with broken input
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 05:01:17 +0000 (01:01 -0400)] 
test-journal-importer: add a test case with broken input

8 years agotest-journal-importer: new test file to check the newly exported importer code
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 03:27:00 +0000 (23:27 -0400)] 
test-journal-importer: new test file to check the newly exported importer code

Only one test case is added, but it is enough to check basic sanity of the
code (single-line and binary fields and trusted fields, allocation and freeing).

8 years agoMove export format parsing from src/journal-remote/ to src/basic/
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 02:40:54 +0000 (22:40 -0400)] 
Move export format parsing from src/journal-remote/ to src/basic/

No functional change.

8 years agocoredump: implement logging of external backtraces with --backtrace
Zbigniew Jędrzejewski-Szmek [Mon, 31 Oct 2016 02:42:44 +0000 (22:42 -0400)] 
coredump: implement logging of external backtraces with --backtrace

This is useful for example for Python progams. By installing a python
sys.execepthook we can store the backtrace in the journal. We gather the
backtrace in the python process, and call systemd-coredump to attach additional
fields (COREDUMP_COMM, COREDUMP_EXE, COREDUMP_UNIT, COREDUMP_USER_UNIT,
COREDUMP_OWNER_UID, COREDUMP_SLICE, COREDUMP_CMDLINE, COREDUMP_CGROUP,
COREDUMP_OPEN_FDS, COREDUMP_PROC_STATUS, COREDUMP_PROC_MAPS,
COREDUMP_PROC_LIMITS, COREDUMP_PROC_MOUNTINFO, COREDUMP_CWD, COREDUMP_ROOT,
COREDUMP_ENVIRON, COREDUMP_CONTAINER_CMDLINE). This could also be done in the
python process, but doing this in systemd-coredump saves quite a bit of
duplicate work and unifies the handling of various tricky fields like
COREDUMP_CONTAINER_CMDLINE in one place.

(Of course this applies to any other language which does not dump cores
but wants to log a traceback, e.g. ruby.)

journal entry:
    _TRANSPORT=journal
    _UID=1002
    _GID=1002
    _CAP_EFFECTIVE=0
    _AUDIT_LOGINUID=1002
    _SYSTEMD_OWNER_UID=1002
    _SYSTEMD_SLICE=user-1002.slice
    _SYSTEMD_USER_SLICE=-.slice
    _SELINUX_CONTEXT=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
    _BOOT_ID=1531fd22ec84429e85ae888b12fadb91
    _MACHINE_ID=519a16632fbd4c71966ce9305b360c9c
    _HOSTNAME=laptop
    _AUDIT_SESSION=1
    _SYSTEMD_UNIT=user@1002.service
    _SYSTEMD_INVOCATION_ID=3c4238d790a44aca9576ecdb2c7576d3
    COREDUMP_UNIT=user@1002.service
    COREDUMP_USER_UNIT=gnome-terminal-server.service
    COREDUMP_UID=1002
    COREDUMP_GID=1002
    COREDUMP_OWNER_UID=1002
    COREDUMP_SLICE=user-1002.slice
    COREDUMP_CGROUP=/user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
    COREDUMP_PROC_LIMITS=Limit                     Soft Limit           Hard Limit           Units
                         Max cpu time              unlimited            unlimited            seconds
                         Max file size             unlimited            unlimited            bytes
                         Max data size             unlimited            unlimited            bytes
                         Max stack size            8388608              unlimited            bytes
                         Max core file size        unlimited            unlimited            bytes
                         Max resident set          unlimited            unlimited            bytes
                         Max processes             15413                15413                processes
                         Max open files            4096                 4096                 files
                         Max locked memory         65536                65536                bytes
                         Max address space         unlimited            unlimited            bytes
                         Max file locks            unlimited            unlimited            locks
                         Max pending signals       15413                15413                signals
                         Max msgqueue size         819200               819200               bytes
                         Max nice priority         0                    0
                         Max realtime priority     0                    0
                         Max realtime timeout      unlimited            unlimited            us
    COREDUMP_PROC_CGROUP=1:name=systemd:/
                         0::/user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
    COREDUMP_PROC_MOUNTINFO=17 39 0:17 / /sys rw,nosuid,nodev,noexec,relatime shared:6 - sysfs sysfs rw,seclabel
                            18 39 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:5 - proc proc rw
                            19 39 0:6 / /dev rw,nosuid shared:2 - devtmpfs devtmpfs rw,seclabel,size=1972980k,nr_inodes=493245,mode=755
                            20 17 0:18 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:7 - securityfs securityfs rw
                            21 19 0:19 / /dev/shm rw,nosuid,nodev shared:3 - tmpfs tmpfs rw,seclabel
                            22 19 0:20 / /dev/pts rw,nosuid,noexec,relatime shared:4 - devpts devpts rw,seclabel,gid=5,mode=620,ptmxmode=000
                            23 39 0:21 / /run rw,nosuid,nodev shared:12 - tmpfs tmpfs rw,seclabel,mode=755
                            24 17 0:22 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime shared:8 - cgroup2 cgroup rw
                            25 17 0:23 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:9 - pstore pstore rw,seclabel
                            36 17 0:24 / /sys/kernel/config rw,relatime shared:10 - configfs configfs rw
                            39 0 0:26 /root / rw,relatime shared:1 - btrfs /dev/mapper/fedora-root2 rw,seclabel,ssd,space_cache,subvolid=257,subvol=/root
                            26 17 0:16 / /sys/fs/selinux rw,relatime shared:11 - selinuxfs selinuxfs rw
                            27 19 0:15 / /dev/mqueue rw,relatime shared:13 - mqueue mqueue rw,seclabel
                            28 18 0:30 / /proc/sys/fs/binfmt_misc rw,relatime shared:14 - autofs systemd-1 rw,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13663
                            29 17 0:7 / /sys/kernel/debug rw,relatime shared:15 - debugfs debugfs rw,seclabel
                            30 19 0:31 / /dev/hugepages rw,relatime shared:16 - hugetlbfs hugetlbfs rw,seclabel
                            31 18 0:32 / /proc/fs/nfsd rw,relatime shared:17 - nfsd nfsd rw
                            32 28 0:33 / /proc/sys/fs/binfmt_misc rw,relatime shared:18 - binfmt_misc binfmt_misc rw
                            57 39 0:34 / /tmp rw,relatime shared:19 - tmpfs none rw,seclabel
                            61 57 0:35 / /tmp/test rw,relatime shared:20 - autofs systemd-1 rw,fd=48,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18251
                            59 39 8:1 / /boot rw,relatime shared:21 - ext4 /dev/sda1 rw,seclabel,data=ordered
                            60 39 253:2 / /home rw,relatime shared:22 - ext4 /dev/mapper/fedora-home rw,seclabel,data=ordered
                            65 39 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime shared:23 - rpc_pipefs sunrpc rw
                            136 23 0:39 / /run/user/1002 rw,nosuid,nodev,relatime shared:91 - tmpfs tmpfs rw,seclabel,size=397432k,mode=700,uid=1002,gid=1002
                            211 23 0:41 / /run/user/42 rw,nosuid,nodev,relatime shared:163 - tmpfs tmpfs rw,seclabel,size=397432k,mode=700,uid=42,gid=42
                            329 136 0:44 / /run/user/1002/gvfs rw,nosuid,nodev,relatime shared:277 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1002,group_id=1002
                            287 61 253:3 / /tmp/test rw,relatime shared:236 - ext4 /dev/mapper/fedora-test rw,seclabel,data=ordered
                            217 23 0:42 / /run/user/1000 rw,nosuid,nodev,relatime shared:168 - tmpfs tmpfs rw,seclabel,size=397432k,mode=700,uid=1000,gid=1000
                            225 217 0:43 / /run/user/1000/gvfs rw,nosuid,nodev,relatime shared:175 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1000,group_id=1000
    COREDUMP_ROOT=/
    PRIORITY=2
    CODE_FILE=src/coredump/coredump.c
    SYSLOG_IDENTIFIER=lt-systemd-coredump
    _COMM=lt-systemd-core
    _SYSTEMD_CGROUP=/user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
    _SYSTEMD_USER_UNIT=gnome-terminal-server.service
    MESSAGE_ID=1f4e0a44a88649939aaea34fc6da8c95
    CODE_FUNC=process_traceback
    COREDUMP_COMM=python3
    COREDUMP_EXE=/usr/bin/python3.5
    COREDUMP_CMDLINE=python3 systemd_coredump_exception_handler.py
    COREDUMP_CWD=/home/zbyszek/src/systemd-coredump-python
    COREDUMP_RLIMIT=-1
    COREDUMP_OPEN_FDS=0:/dev/pts/1
                      pos: 0
                      flags: 0102002
                      mnt_id: 22

                      1:/dev/pts/1
                      pos: 0
                      flags: 0102002
                      mnt_id: 22

                      2:/dev/pts/1
                      pos: 0
                      flags: 0102002
                      mnt_id: 22
    CODE_LINE=1284
    COREDUMP_SIGNAL=ZeroDivisionError: division by zero
    COREDUMP_ENVIRON=LANG=en_US.utf8
                     DISPLAY=:0
                     ...
                     MANWIDTH=90
                     LC_MESSAGES=en_US.utf8
                     PYTHONPATH=.
                     _=/usr/bin/python3
    COREDUMP_PID=14498
    COREDUMP_PROC_STATUS=Name: python3
                         Umask: 0002
                         State: S (sleeping)
                         Tgid: 14498
                         Ngid: 0
                         Pid: 14498
                         PPid: 16245
                         TracerPid: 0
                         Uid: 1002 1002 1002 1002
                         Gid: 1002 1002 1002 1002
                         FDSize: 64
                         Groups:
                         NStgid: 14498
                         NSpid: 14498
                         NSpgid: 14498
                         NSsid: 16245
                         VmPeak:    34840 kB
                         VmSize:    34792 kB
                         VmLck:        0 kB
                         VmPin:        0 kB
                         VmHWM:     9332 kB
                         VmRSS:     9332 kB
                         RssAnon:     4872 kB
                         RssFile:     4460 kB
                         RssShmem:        0 kB
                         VmData:     5012 kB
                         VmStk:      136 kB
                         VmExe:        4 kB
                         VmLib:     5452 kB
                         VmPTE:       84 kB
                         VmPMD:       12 kB
                         VmSwap:        0 kB
                         HugetlbPages:        0 kB
                         Threads: 1
                         SigQ: 0/15413
                         SigPnd: 0000000000000000
                         ShdPnd: 0000000000000000
                         SigBlk: 0000000000000000
                         SigIgn: 0000000001001000
                         SigCgt: 0000000180000002
                         CapInh: 0000000000000000
                         CapPrm: 0000000000000000
                         CapEff: 0000000000000000
                         CapBnd: 0000003fffffffff
                         CapAmb: 0000000000000000
                         Seccomp: 0
                         Cpus_allowed: f
                         Cpus_allowed_list: 0-3
                         Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
                         Mems_allowed_list: 0
                         voluntary_ctxt_switches: 2
                         nonvoluntary_ctxt_switches: 47
    COREDUMP_PROC_MAPS=55cb7b7fe000-55cb7b7ff000 r-xp 00000000 00:1a 5289186                    /usr/bin/python3.5
                       55cb7b9ff000-55cb7ba00000 r--p 00001000 00:1a 5289186                    /usr/bin/python3.5
                       55cb7ba00000-55cb7ba01000 rw-p 00002000 00:1a 5289186                    /usr/bin/python3.5
                       55cb7c007000-55cb7c189000 rw-p 00000000 00:00 0                          [heap]
                       7f4da2d51000-7f4da2d54000 r-xp 00000000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2d54000-7f4da2f53000 ---p 00003000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f53000-7f4da2f54000 r--p 00002000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f54000-7f4da2f55000 rw-p 00003000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f55000-7f4da2f5d000 r-xp 00000000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f5d000-7f4da315c000 ---p 00008000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da315c000-7f4da315d000 r--p 00007000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da315d000-7f4da315f000 rw-p 00008000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da315f000-7f4da319f000 rw-p 00000000 00:00 0
                       7f4da319f000-7f4da31a4000 r-xp 00000000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da31a4000-7f4da33a3000 ---p 00005000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a3000-7f4da33a4000 r--p 00004000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a4000-7f4da33a6000 rw-p 00005000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a6000-7f4da33a9000 r-xp 00000000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a9000-7f4da35a8000 ---p 00003000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da35a8000-7f4da35a9000 r--p 00002000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da35a9000-7f4da35aa000 rw-p 00003000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da35aa000-7f4da362a000 rw-p 00000000 00:00 0
                       7f4da362a000-7f4da362c000 r-xp 00000000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da362c000-7f4da382b000 ---p 00002000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da382b000-7f4da382c000 r--p 00001000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da382c000-7f4da382e000 rw-p 00002000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da382e000-7f4da39ee000 rw-p 00000000 00:00 0
                       7f4da39ee000-7f4da3bab000 r-xp 00000000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3bab000-7f4da3daa000 ---p 001bd000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3daa000-7f4da3dae000 r--p 001bc000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3dae000-7f4da3db0000 rw-p 001c0000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3db0000-7f4da3db4000 rw-p 00000000 00:00 0
                       7f4da3db4000-7f4da3ebc000 r-xp 00000000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da3ebc000-7f4da40bb000 ---p 00108000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da40bb000-7f4da40bc000 r--p 00107000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da40bc000-7f4da40bd000 rw-p 00108000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da40bd000-7f4da40bf000 r-xp 00000000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da40bf000-7f4da42be000 ---p 00002000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da42be000-7f4da42bf000 r--p 00001000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da42bf000-7f4da42c0000 rw-p 00002000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da42c0000-7f4da42c3000 r-xp 00000000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da42c3000-7f4da44c2000 ---p 00003000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da44c2000-7f4da44c3000 r--p 00002000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da44c3000-7f4da44c4000 rw-p 00003000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da44c4000-7f4da44dc000 r-xp 00000000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da44dc000-7f4da46dc000 ---p 00018000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da46dc000-7f4da46dd000 r--p 00018000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da46dd000-7f4da46de000 rw-p 00019000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da46de000-7f4da46e2000 rw-p 00000000 00:00 0
                       7f4da46e2000-7f4da4917000 r-xp 00000000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4917000-7f4da4b17000 ---p 00235000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4b17000-7f4da4b1c000 r--p 00235000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4b1c000-7f4da4b7f000 rw-p 0023a000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4b7f000-7f4da4baf000 rw-p 00000000 00:00 0
                       7f4da4baf000-7f4da4bd4000 r-xp 00000000 00:1a 4844897                    /usr/lib64/ld-2.24.so
                       7f4da4bdf000-7f4da4c10000 rw-p 00000000 00:00 0
                       7f4da4c10000-7f4da4c61000 r--p 00000000 00:1a 5225117                    /usr/lib/locale/pl_PL.utf8/LC_CTYPE
                       7f4da4c61000-7f4da4d91000 r--p 00000000 00:1a 4844827                    /usr/lib/locale/en_US.utf8/LC_COLLATE
                       7f4da4d91000-7f4da4d95000 rw-p 00000000 00:00 0
                       7f4da4dc1000-7f4da4dc2000 r--p 00000000 00:1a 4844832                    /usr/lib/locale/en_US.utf8/LC_NUMERIC
                       7f4da4dc2000-7f4da4dc3000 r--p 00000000 00:1a 4844795                    /usr/lib/locale/en_US.utf8/LC_TIME
                       7f4da4dc3000-7f4da4dc4000 r--p 00000000 00:1a 4844793                    /usr/lib/locale/en_US.utf8/LC_MONETARY
                       7f4da4dc4000-7f4da4dc5000 r--p 00000000 00:1a 4844830                    /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
                       7f4da4dc5000-7f4da4dc6000 r--p 00000000 00:1a 4844847                    /usr/lib/locale/en_US.utf8/LC_PAPER
                       7f4da4dc6000-7f4da4dc7000 r--p 00000000 00:1a 4844831                    /usr/lib/locale/en_US.utf8/LC_NAME
                       7f4da4dc7000-7f4da4dc8000 r--p 00000000 00:1a 4844790                    /usr/lib/locale/en_US.utf8/LC_ADDRESS
                       7f4da4dc8000-7f4da4dc9000 r--p 00000000 00:1a 4844794                    /usr/lib/locale/en_US.utf8/LC_TELEPHONE
                       7f4da4dc9000-7f4da4dca000 r--p 00000000 00:1a 4844792                    /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
                       7f4da4dca000-7f4da4dd1000 r--s 00000000 00:1a 4845203                    /usr/lib64/gconv/gconv-modules.cache
                       7f4da4dd1000-7f4da4dd2000 r--p 00000000 00:1a 4844791                    /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
                       7f4da4dd2000-7f4da4dd4000 rw-p 00000000 00:00 0
                       7f4da4dd4000-7f4da4dd5000 r--p 00025000 00:1a 4844897                    /usr/lib64/ld-2.24.so
                       7f4da4dd5000-7f4da4dd6000 rw-p 00026000 00:1a 4844897                    /usr/lib64/ld-2.24.so
                       7f4da4dd6000-7f4da4dd7000 rw-p 00000000 00:00 0
                       7ffd24da1000-7ffd24dc2000 rw-p 00000000 00:00 0                          [stack]
                       7ffd24de8000-7ffd24dea000 r--p 00000000 00:00 0                          [vvar]
                       7ffd24dea000-7ffd24dec000 r-xp 00000000 00:00 0                          [vdso]
                       ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
    COREDUMP_TIMESTAMP=1477877460000000
    MESSAGE=Process 14498 (python3) of user 1002 failed with ZeroDivisionError: division by zero:

            Traceback (most recent call last):
              File "systemd_coredump_exception_handler.py", line 89, in <module>
                g()
              File "systemd_coredump_exception_handler.py", line 88, in g
                f()
              File "systemd_coredump_exception_handler.py", line 86, in f
                div0 = 1 / 0  # pylint: disable=W0612
            ZeroDivisionError: division by zero

            Local variables in innermost frame:
              h=<function f at 0x7f4da3606e18>
              a=3
    _PID=14499
    _SOURCE_REALTIME_TIMESTAMP=1477877460025975

8 years agocoredump: split out metadata gathering to a separate function
Zbigniew Jędrzejewski-Szmek [Sun, 30 Oct 2016 21:37:38 +0000 (17:37 -0400)] 
coredump: split out metadata gathering to a separate function

In preparation for subsequenct changes...

Various stack allocations are changed to use the heap. This might be minimally
slower, but probably doesn't matter. The upside is that we will now properly
free all memory that is allocated.

8 years agoHACKING: mkosi is now packaged for Fedora
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 02:21:17 +0000 (22:21 -0400)] 
HACKING: mkosi is now packaged for Fedora

Also dnf requires sudo.

8 years agoMerge pull request #4733 from poettering/binds-to
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 04:06:50 +0000 (23:06 -0500)] 
Merge pull request #4733 from poettering/binds-to

When we are about to start a unit, check the deps again.