Commit Graph

35146 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 9259d0e23e TODO: remove entry
Swap on luks works great. Nothing to do here.
2018-10-08 18:21:00 +02:00
Zbigniew Jędrzejewski-Szmek e8f1d00d69 shared/sleep-config: add switches to kill specific sleep modes
/etc/systemd/sleep.conf gains four new switches:
AllowSuspend=, AllowHibernation=, AllowSuspendThenHibernate=, AllowHybridSleep=.

Disabling specific modes was already possible by masking suspend.target,
hibernate.target, suspend-then-hibernate.target, or hybrid-sleep.target.
But this is not convenient for distributions, which want to set some defaults
based on what they want to support. Having those available as configuration
makes it easy to put a config file in /usr/lib/systemd/sleep.conf.d/ that
overrides the defaults and gives instructions how to undo that override.
2018-10-08 18:21:00 +02:00
Zbigniew Jędrzejewski-Szmek 5fdf2d51c2 shared/sleep-config: forbid hibernation if resume= is not configured 2018-10-08 18:20:58 +02:00
Zbigniew Jędrzejewski-Szmek edf43e3df7 test-sleep: print function names 2018-10-08 17:05:32 +02:00
Zbigniew Jędrzejewski-Szmek 9a135c084a basic/proc-cmdline: allow parsing of cmdline from a string
Comes with tests.

Also add direct test for $SYSTEMD_PROC_CMDLINE.

In test-proc-cmdline, "true" was masquerading as PROC_CMDLINE_STRIP_RD_PREFIX,
fix that. Also, reorder functions to match call order.
2018-10-08 17:05:19 +02:00
Zbigniew Jędrzejewski-Szmek 1af294fc82 Drop empty lines in proc-cmdline.c 2018-10-08 17:05:18 +02:00
Zbigniew Jędrzejewski-Szmek 2d3bfb6904 shared/bootspec: remember the full path to boot entry and use it in logging
It's much easier to understand what is going on when the full path is
logged.
2018-10-08 17:05:17 +02:00
Zbigniew Jędrzejewski-Szmek 1b20d88987 Move logic to find default sd-boot entry from systemctl to shared
In preparation for use in other places. No functional change.
2018-10-08 16:06:26 +02:00
Zbigniew Jędrzejewski-Szmek e83419d043 hib-res-generator: add "noresume"
This is an override parameter, to totally skip dehiberanation.
2018-10-08 16:06:16 +02:00
Zbigniew Jędrzejewski-Szmek a79858bfd1 hib-res-generator: open logging before emitting the first message
Also add a debug message when we are not in initrd, because it can be
confusing why nothing is happenning.
2018-10-08 16:06:05 +02:00
Zbigniew Jędrzejewski-Szmek 0307ea49c7 Add $SYSTEMD_IN_INITRD=yes|no override for debugging 2018-10-08 16:04:51 +02:00
Lennart Poettering 12580bc3ed bootspec: rename "filename" field to "id"
This follows the renaming done a few commits earlier too systemd-boot
itself.

Also, let's show the ID, since it's useful.
2018-09-27 17:31:37 +02:00
Lennart Poettering 195b36cf21 bootspec: fix include lines
List all files we use definitions from.
2018-09-27 17:31:37 +02:00
Lennart Poettering 2f3db9c907 uft8: add comment, requested by @keszybz 2018-09-27 17:21:18 +02:00
Lennart Poettering 328756170e update TODO 2018-09-27 17:11:40 +02:00
Zbigniew Jędrzejewski-Szmek b6de93096e
Merge pull request #10173 from poettering/sd-boot-utf
the utf8.c changes from PR #9437 (i.e. the boot counting PR)
2018-09-27 08:21:20 +02:00
Lennart Poettering ff6c6cc117 nspawn: when --quiet is passed, simply downgrade log messages to LOG_DEBUG (#10181)
With this change almost all log messages that are suppressed through
--quiet are not actually suppressed anymore, but simply downgraded to
LOG_DEBUG. Previously we did it this way for some log messages and fully
suppressed them for others. With this it's pretty much systematic.

Inspired by #10122.
2018-09-26 23:40:39 +02:00
Susant Sahani 6cf0a20491 udev/net: add support for the equivalent of "ethtool advertise" to .link files
This work adds support for the equivalent of "ethtool advertise" to .link files?
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030112.html
2018-09-26 22:21:42 +02:00
Franck Bui 4885626b56 emergency: make sure console password agents don't interfere with the emergency shell
If for any reason local-fs.target fails at startup while a password is
requested by systemd-cryptsetup@.service, we end up with the emergency shell
competing with systemd-ask-password-console.service for the console.

This patch makes sure that:

 - systemd-ask-password-console.service is stopped before entering in emergency
   mode so it won't make any access to the console while the emergency shell is
   running.

 - systemd-ask-password-console.path is also stopped so any attempts to restart
   systemd-cryptsetup in the emergency shell won't restart
   systemd-ask-password-console.service and kill the emergency shell.

 - systemd-ask-password-wall.path is stopped so
   systemd-ask-password-wall.service won't be started as this service pulls
   the default dependencies in.

Fixes: #10131
2018-09-26 18:13:32 +02:00
Evgeny Vereshchagin 89f180201c nspawn: chown() the legacy hierarchy when it's used in a container
This is a follow-up to 720f0a2f3c.

Closes https://github.com/systemd/systemd/issues/10026
Closes https://github.com/systemd/systemd/issues/9563
2018-09-26 17:29:17 +02:00
Anita Zhang c87700a133 Make Watchdog Signal Configurable
Allows configuring the watchdog signal (with a default of SIGABRT).
This allows an alternative to SIGABRT when coredumps are not desirable.

Appropriate references to SIGABRT or aborting were renamed to reflect
more liberal watchdog signals.

Closes #8658
2018-09-26 16:14:29 +02:00
Lennart Poettering ee8d493cbd
Merge pull request #10158 from keszybz/seccomp-log-tightening
Seccomp log tightening
2018-09-26 15:56:32 +02:00
Lennart Poettering 0eeba7a39f
Merge pull request #10168 from keszybz/coverity-fixes
Coverity fixes
2018-09-26 15:37:22 +02:00
Patrik Flykt dd5ab7d913 networkd-dhcp6: Set initial value of route to NULL
Start with route set to NULL should there be no route created. Remove
the explicit route_free as the _cleanup_ will take care of that after
the continue;.
2018-09-26 15:15:37 +02:00
Yu Watanabe 0fbc35524c libsystemd: add missing 'global' specifier in libsystemd.sym 2018-09-25 23:30:58 +02:00
William Douglas 6d7b543342 RFC tmpfiles: Allow configuration to ignore execution errors
This is an implementation that covers making errors encountered when writing
file content optionally fatal. If this is something that folks would want I'll
add handling of this for all the other directives. I'd appreciate suggestions
on how this might better be structured as well (use of a goto fail or such) as
I'm not super happy with the approach.
2018-09-25 23:30:30 +02:00
Zbigniew Jędrzejewski-Szmek 97c7469bbe
Merge pull request #10169 from poettering/putenv-error-handling
add missing putenv() error handling
2018-09-25 19:50:49 +02:00
Lennart Poettering 80b0a59729 utf8: add utf8_to_utf16() helper 2018-09-25 15:57:47 +02:00
Lennart Poettering 2ac2ff3fc1 utf8: let's update utf16_to_utf8() a bit
Let's change utf16_to_utf8() prototype to refer to utf16 chars with char16_t rather than void

Let's not cast away a "const" needlessly.

Let's add a few comments.

Let's fix the calculations of the buffer size to allocate, and how long
to run the loop in case of uneven byte numbers
2018-09-25 15:57:47 +02:00
Lennart Poettering 7c42185784 utf8: change return type of utf8_encoded_expected_len() to size_t
After all it returns a lengths of a string in chars, and hence should
return size_t, exactly like strlen().
2018-09-25 15:57:47 +02:00
Lennart Poettering 07667be733 utf8: modernize utf16 inline calls a bit
Let's fix an indentation issue.

Let's avoid yoda comparisons.

Let's drop unnecessary ().

Let's make sure we convert 16bit values to 32bit before shifting them by
10bit to the left, to avoid overflows.

Let's avoid comparisons between signed literals and unsigned variables,
in particular if the literals are outside of the minimum range C
requires for "int".
2018-09-25 15:57:47 +02:00
Lennart Poettering e71fb4b302 utf8: update utf8_is_valid() a bit
Let's avoid a few casts in the function. Also, let's drop the "const"
when returning the string, for similar reasons as strchr() and friends
drop it: so that we don't add a const if the user passes in a non-const
string.
2018-09-25 15:57:47 +02:00
Lennart Poettering 2b5d05fdfe
Merge pull request #10088 from keszybz/man-systemctl-return
man: add a description of systemctl return codes
2018-09-25 12:35:36 +02:00
Lennart Poettering 7c428bb5d5
Merge pull request #10059 from yuwata/env-exec-directory
core: introduce $RUNTIME_DIRECTORY= or friends
2018-09-25 12:34:30 +02:00
Lennart Poettering 653d469519 exec-util: add missing logging call
This function logs about all errors, but one case was forgotten. Fix
that.
2018-09-25 12:04:14 +02:00
Lennart Poettering ed689f7894 exec-util: handle putenv() errors
Just paranoia, as putenv() can fail and we should catch it, like we
catch all other errors.

Follow-up for #10073
2018-09-25 12:04:14 +02:00
Zbigniew Jędrzejewski-Szmek 6f48815918 test-journal-syslog: initialize variable
The *priority argument to syslog_parse_priority() needs to be initialized
if the last argument (with_facility) is false.

CID #1394690.
2018-09-25 11:34:52 +02:00
Zbigniew Jędrzejewski-Szmek 8a76031152 udev-builtin-net_id: do not assume "type" attribute exists
It *should*, but who knows, let's be more defensive here.

CID #1395805.
2018-09-25 11:29:54 +02:00
Zbigniew Jędrzejewski-Szmek ccc0ec6f71 journal-upload: fix off-by-one in assert()
CID #1394386.
2018-09-25 11:22:13 +02:00
Zbigniew Jędrzejewski-Szmek ec766a5168 sd-event: use new cleanup function more 2018-09-25 11:15:27 +02:00
Zbigniew Jędrzejewski-Szmek 8c75fe1765 sd-event: remove dead code and use _cleanup_
CID #1393250.
2018-09-25 11:10:12 +02:00
Lennart Poettering 9afd574039 docs: clarify controller mount logic in hybrid cgroups mode
Fixes: #10107
2018-09-25 11:00:57 +02:00
Thiago Macieira 044c2c7a2b Make bzip2 an optional dependency for systemd-importd
Yes, there are still a lot of users of bzip2, but it's fallen out of
favour after LZMA/xz, which can compress a lot more and often
decompresses faster than bzip2 too.
2018-09-25 10:58:09 +02:00
Lennart Poettering 4295fd9e82
Merge pull request #10163 from poettering/inhibit-format-table
systemd-inhibit --list: port to format-table.c
2018-09-25 10:24:30 +02:00
Zbigniew Jędrzejewski-Szmek 3318fd9c24
Merge pull request #10073 from xnox/execve
Execute generators with manager's environment exported
2018-09-25 10:07:23 +02:00
Zbigniew Jędrzejewski-Szmek 1346489f8c DHCPv6: use unsigned for flags 2018-09-25 09:29:36 +02:00
Zbigniew Jędrzejewski-Szmek d00de84373
Merge pull request #10164 from poettering/btrfs-resize-fix
btrfs resize fix
2018-09-25 09:24:14 +02:00
Lennart Poettering 614a8274f2 udev: fix some type sloppiness
We use strtoul() which returns an "unsigned long", but then assign this
to int or unsigned in, i.e. drop 32bit silently on 64bit systems. Let's
clean this up a bit, and retain the right types.
2018-09-25 09:20:16 +02:00
Lennart Poettering 6ac386855c logind: fix blacklist/whitelist confusion in comment (#10165)
Triggered by this:

602a41c22a (r30575293)
2018-09-25 07:02:41 +09:00
Lennart Poettering 7fe96758d1 docs: fix CONTRIBUTING path (#10160) 2018-09-25 06:25:48 +09:00