Commit Graph

31363 Commits

Author SHA1 Message Date
Jörg Thalheim 2a5fcfae02 more portable perl shebangs (#7701)
same motivation as in #5816:

- distributions have scripts to rewrite shebangs on installation and
  they know what locations to rely on.
- For tests/compilation we should rather rely on the user to have setup
  there PATH correctly.
2017-12-19 11:13:34 +01:00
Zbigniew Jędrzejewski-Szmek dc0a35550e cryptsetup: use uint64_t for keyfile-offset= (#7689)
On 32bit, refuse large offsets. Once https://gitlab.com/cryptsetup/cryptsetup/issues/359
is resolved, we should switch to the new api, whatever it is.

Fixes #7677.
2017-12-19 16:51:12 +09:00
Zbigniew Jędrzejewski-Szmek bf0e0a4df2 analyze: use normal bus connection for "plot" verb (#7685)
We need to connect to hostnamed, so a private bus connection is no good.
It'd be simpler to use the normal bus connection unconditionally, but
that'd mean that e.g. systemd-analyze set-log-level might not work in
emergency mode. So let's keep trying to use the private connection except
for "plot".

Fixes #7667.
2017-12-18 19:35:03 +01:00
Lennart Poettering bd8fdbcfc5
Merge pull request #7687 from hbakken/work/add-missing-features2
Kernel 3.10 compat
2017-12-18 19:29:00 +01:00
Felipe Sateler f9f54413db build-sys: install TRANSIENT-SETTINGS.md and UIDS-GIDS.md (#7690) 2017-12-18 14:58:13 +01:00
Jan Alexander Steffens aff0b1fa7b cryptsetup-generator: Don't mistake NULL input as OOM (#7688)
Since systemd v236, several Arch users complained that
systemd-cryptsetup-generator exits with an OOM error and that it
prevents the boot from continuing.

Investigating the diff of cryptsetup-generator between v235 and v236 I
noticed that create_disk allowed for the `password` and `filtered`
variables to be NULL (they're handled with `strempty()`) but not their
`*_escaped` versions, and returned OOM errors in those cases.

Fix this by checking that the input string is non-NULL before deciding
that `specifier_escape` had an OOM error.

I could not test this fix myself, but some users have reported success.

Downstream bug: https://bugs.archlinux.org/task/56733
2017-12-18 14:47:18 +01:00
Henrik Grindal Bakken ffc01f0680 missing: Add DM_DEFERRED_REMOVE
Also include missing.h in dissect-image.c to pick it up.
2017-12-18 14:15:17 +01:00
Henrik Grindal Bakken 8cbe9f06f4 missing: Define SMACK_MAGIC if it's missing 2017-12-18 14:15:17 +01:00
Henrik Grindal Bakken cacc0d7a78 nspawn: Include missing.h 2017-12-18 14:15:17 +01:00
Henrik Grindal Bakken 1381f244c8 missing: Define EFIVARFS_MAGIC if missing 2017-12-18 14:15:17 +01:00
Henrik Grindal Bakken 56766f99d9 missing: Add MAX_HANDLE_SZ 2017-12-18 14:15:10 +01:00
Sergey Ptashnick 4dfdca3148 catalog: update Russian translation (#7678)
Translated taint message.

Also added a blank line before "Current system is tagged" for better
visual separation between current system state and tags description.
2017-12-18 13:41:43 +01:00
Henrik Grindal Bakken 80ebe5c2a4 missing: Add PR_SET_MM_{ARG,ENV}_{START,END} 2017-12-18 12:32:41 +01:00
Henrik Grindal Bakken 122b79079b missing: Add some more btrfs structs and constants 2017-12-18 11:20:41 +01:00
Henrik Grindal Bakken 895d071656 btrfs: Include missing.h in btrfs-ctree.h 2017-12-18 11:19:32 +01:00
Chris Down e16647c39d condition: Create AssertControlGroupController (#7630)
Up until now, the behaviour in systemd has (mostly) been to silently
ignore failures to action unit directives that refer to an unavailble
controller. The addition of AssertControlGroupController and its
conditional counterpart allow explicit specification of the desired
behaviour when such a situation occurs.

As for how this can happen, it is possible that a particular controller
is not available in the cgroup hierarchy. One possible reason for this
is that, in the running kernel, the controller simply doesn't exist --
for example, the CPU controller in cgroup v2 has only recently been
merged and was out of tree until then. Another possibility is that the
controller exists, but has been forcibly disabled by `cgroup_disable=`
on the kernel command line.

In future this will also support whatever comes out of issue #7624,
`DefaultXAccounting=never`, or similar.
2017-12-18 08:53:29 +01:00
Zbigniew Jędrzejewski-Szmek 292599e2ad
Merge pull request #7665 from poettering/main-cleanup
let's split up main() into more functions, to make it digestable
2017-12-18 08:26:36 +01:00
Piotr Drąg e51292485a catalog: update Polish translation (#7660) 2017-12-16 15:20:34 +01:00
Zbigniew Jędrzejewski-Szmek 876317aee6
Merge pull request #7664 from poettering/fix-integration-tests
Fix integration tests
2017-12-16 15:01:04 +01:00
Alan Jenkins 3f2d136505 man: generalize "binary" to "program" (#7668)
Systemd services are permitted to be scripts, as well as binary
executables.

The same also applies to the underlying /sbin/mount and /sbin/swapon.
It is not necessary for the user to consider what type of program file
these are.  Nor is it necessary with systemd-nspawn, to distinguish between
init as a "binary" v.s. a user-specified "program".

Also fix a couple of grammar nits in the modified sentences.
2017-12-16 11:48:12 +01:00
Franck Bui 6671e818e9 meson: libudev_core and udevadm should have LOG_REALM=LOG_REALM_UDEV (#7666)
Otherwise, setting udev_log=debug in /etc/udev/udev.conf has no effects since
systemd-udevd is built with LOG_REALM=LOG_REALM_UDEV.

However using LOG_REALM_UDEV (for libudev_core) reveals another similar bug for
udevadm which should also define LOG_REALM_UDEV.
2017-12-16 09:36:36 +01:00
Lennart Poettering 8769525f57
Merge pull request #7661 from keszybz/slice-cleanups
Slice cleanups and systemd-mount --owner
2017-12-15 20:55:39 +01:00
Lennart Poettering d72a8f10b6 main: add some more comments for the early initialization phase 2017-12-15 20:52:28 +01:00
Lennart Poettering 625e8690ab main: reorder variable declarations a bit
Let's remove a bit redundancy, and list variables of the same
type/category in one declaration line.
2017-12-15 20:52:28 +01:00
Lennart Poettering aa40ff0703 main: split out 'skip_setup' check into its own functions
And let's optimize it a tiny bit, by only iterating through the argument
list once, instead of twice.
2017-12-15 20:52:28 +01:00
Lennart Poettering b9e90f3aa6 main: do bother with uid_to_name() unless we do debug logging 2017-12-15 20:52:28 +01:00
Lennart Poettering 43db615ba4 main: conditionalize fixup_environment() internally
This code is executed before we parse command line/configuration
parameters, hence let's not use arg_system to figure our how to clean up
things, but instead PID == 1. Let's move that check inside of the
function, to make things a bit more robust abstract from the outside.

Also, let's add a log message about this, that was so far missing.
2017-12-15 20:52:28 +01:00
Lennart Poettering 2d77603838 main: let's move ACTION_RUN test into initialize_runtime()
Let's hide this check inside the function and make it easier to follow
the general control flow of main().
2017-12-15 20:52:28 +01:00
Lennart Poettering 713a88757a mount-setup: fix MNT_CHECK_WRITABLE error handling, and log about the issue
Let's correct the error handling (the error is in errno, not r), and
let's add logging like the rest of the function has it.
2017-12-15 20:52:28 +01:00
Lennart Poettering 3a671cd130 main: tweak timerslack message a bit
Let's clarify that this is a non-issue, by downgrading it to LOG_WARN
and saying "ignoring" in the message.
2017-12-15 20:52:28 +01:00
Lennart Poettering 3c3c6cb95d main: move install_crash_handler() and mount_cgroup_controllers() invocations
Let's place them in initialize_runtime(), where they appear to fit best.
Effectively this is just a move a little bit down, swapping places with
log_execution_mode(), which should require neither call to be done
first.

Note that changes the conditionalization a bit for these calls, from
(PID == 1) to (arg_system && arg_action == ACTION_RUN). At this point this is pretty much the same
however, as we don't allow PID 1 without ACTION_RUN and without
arg_system set, safety_checks() ensures that.
2017-12-15 20:52:28 +01:00
Lennart Poettering db33214b52 core: move arg_show_status fix-up into load_configuration()
It's part of finalizing our runtime parameters, hence let's move this
into load_configuration() after we loaded everything else. This is safe,
since we don't use it between the location where it was and where we
place it now yet.
2017-12-15 20:52:28 +01:00
Lennart Poettering 2e51b31caf main: split out code that sets up the console/terminal and stuff
More refactoring to make main() more digestable.
2017-12-15 20:52:28 +01:00
Lennart Poettering efeb853fbd main: split out code that collects passed fds
More refactoring to make main() more digestable
2017-12-15 20:52:28 +01:00
Lennart Poettering 72c7329b6e main: slight modernizations for status_welcome()
There's no point in duplicating the complex parse_env_file() invocation,
hence let's not do it.
2017-12-15 20:52:28 +01:00
Lennart Poettering fd8c85c652 main: let's move the arg_show_status check into status_welcome()
It's kinda nice to hide this check inside of status_welcome() itself, so
that it handles all this on its own.
2017-12-15 20:52:28 +01:00
Lennart Poettering a70c72a046 main: slightly rearrange serialization fdset, and logging/console setup
Let's merge two if blocks, and move log_close()/log_open() out of the
testing codepath, as there's no reason to have it there.
2017-12-15 20:52:28 +01:00
Lennart Poettering 5a2e0c6257 main: move chdir("/") a bit earlier
There's no need to do this within the block where logging is closed,
hence move it earlier, so that this block can be kept as small as
possible.
2017-12-15 20:52:28 +01:00
Lennart Poettering 6f101b566f main: move initialize_join_controllers() invocation into load_configuration()
This just sets up some variables the loaded configuration will then
modify. Let's invoke it hence right before loading the configuration.

This moves the initialization just a tiny bit later, but that shouldn't
matter, since we never access it in-between.
2017-12-15 20:52:28 +01:00
Lennart Poettering 51e5ff02a8 main: split out taint string logging into its own function
It's sufficiently complex now, let's add our own function for this too.
2017-12-15 20:52:28 +01:00
Lennart Poettering febf46a46c core: add more safety check
Let's make sure that if we are PID 1 we are invoked in ACTION_RUN mode,
and in arg_system mode, as well as the opposite.

Everything else is untested and probably not worth supporting hence
let's bail out early if people try anyway.
2017-12-15 20:52:28 +01:00
Lennart Poettering 263162da6c core: split out test summary output into its own function
More refactoring to make main() shorter.
2017-12-15 20:52:28 +01:00
Lennart Poettering 74da609f0d main: split out security policy loading into its own function
More refactoring to make things more digestable.
2017-12-15 20:52:28 +01:00
Lennart Poettering 5625c18a47 main: invoke pager_open() only at one place
Let's just move this up a few lines and unify the invocation.
2017-12-15 20:52:28 +01:00
Lennart Poettering b0d7c98993 core: split out various startup safety checks from main() into its own function
No functional changes, just some refactoring to make main() more
digestable.
2017-12-15 20:52:28 +01:00
Lennart Poettering 97d1fb94ba main: split out all parsing of command line arguments/kernel arguments/configuration files
Let's shorten main() a bit, and split out everything that loads our
configuration and runtime parameters into a function of its own.

No changes in behaviour.
2017-12-15 20:52:28 +01:00
Lennart Poettering 4dc63c4bc7 main: minor optimization
Let's remove one memory allocation in the common path.
2017-12-15 20:52:28 +01:00
Lennart Poettering c4b0c4599d test: fix TEST-13-NSPAWN-SMOKE
We need to specify a full path to the "ip" binary and busybox "ip" has a
slightly different output than the normal ip, and won't show "DOWN".
hence instead ensure that at lest not "UP" is in there.
2017-12-15 20:51:55 +01:00
Lennart Poettering 3d710b0440 test: make sure "make" in the test directories works again
Fixes: #7648
2017-12-15 19:48:08 +01:00
Zbigniew Jędrzejewski-Szmek fb883e759d generator: add helper function for writing unit files
It doesn't save too much, but it's a common pattern so I think it's worth
to factor this out.
2017-12-15 16:47:11 +01:00