summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* catalog: use https:// in URLsAsciiWolf2017-02-2116-79/+79
|
* docs: use https:// in URLsAsciiWolf2017-02-211-1/+1
|
* Merge pull request #5410 from AsciiWolf/https-urlsZbigniew Jędrzejewski-Szmek2017-02-2146-76/+76
|\ | | | | Use https:// in URLs when possible.
| * man: use https:// in URLsAsciiWolf2017-02-2142-58/+58
| |
| * NEWS: use https:// in URLsAsciiWolf2017-02-211-10/+10
| |
| * README, README.md: use https:// in URLsAsciiWolf2017-02-212-5/+5
| |
| * configure.am: use https:// in URLsAsciiWolf2017-02-211-3/+3
| |
* | NEWS: fix typos, grammar, and small errors (#5407)Martin Pitt2017-02-211-20/+19
|/
* Merge pull request #5406 from poettering/v233-prepMartin Pitt2017-02-215-10/+334
|\ | | | | V233 preparation
| * build-sys: bump package versionLennart Poettering2017-02-212-4/+4
| |
| * start putting together a NEWS entry for 233Lennart Poettering2017-02-212-4/+328
| |
| * systemctl: suffix cmdline options that take arguments with =Lennart Poettering2017-02-211-2/+2
|/ | | | | Just to clarify, that these options expect arguments, following our usual style.
* Merge pull request #5131 from keszybz/environment-generatorsLennart Poettering2017-02-2135-340/+1989
|\ | | | | Environment generators
| * test-env-util: add more tests for "extended syntax"Zbigniew Jędrzejewski-Szmek2017-02-211-0/+30
| | | | | | | | | | This is only the tip of the iceberg. It would be great to test all kinds of nesting, handling of invalid syntax, etc., but I'm leaving that for later.
| * basic: support default and alternate values for env expansionRay Strode2017-02-216-12/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it's useful to provide a default value during an environment expansion, if the environment variable isn't already set. For instance $XDG_DATA_DIRS is suppose to default to: /usr/local/share/:/usr/share/ if it's not yet set. That means callers wishing to augment XDG_DATA_DIRS need to manually add those two values. This commit changes replace_env to support the following shell compatible default value syntax: XDG_DATA_DIRS=/foo:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share} Likewise, it's useful to provide an alternate value during an environment expansion, if the environment variable isn't already set. For instance, $LD_LIBRARY_PATH will inadvertently search the current working directory if it starts or ends with a colon, so the following is usually wrong: LD_LIBRARY_PATH=/foo/lib:${LD_LIBRARY_PATH} To address that, this changes replace_env to support the following shell compatible alternate value syntax: LD_LIBRARY_PATH=/foo/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} [zj: gate the new syntax under REPLACE_ENV_ALLOW_EXTENDED switch, so existing callers are not modified.]
| * basic: add replace_env_n functionRay Strode2017-02-212-3/+9
| | | | | | | | It's like replace_env, but lets you pass in a substring.
| * build-sys: make environment.d support conditionalZbigniew Jędrzejewski-Szmek2017-02-212-3/+16
| | | | | | | | | | | | We have ./configure switches for various parts of non-essential functionality, let's add one for this new stuff too. Support for environment generators is not conditional — if you don't want them, just don't install any.
| * Tighten checking for variable validityZbigniew Jędrzejewski-Szmek2017-02-215-2/+68
| | | | | | | | | | | | In the future we might want to allow additional syntax (for example "unset VAR". But let's check that the data we're getting does not contain anything unexpected.
| * Allow braceless variables to be expandedZbigniew Jędrzejewski-Szmek2017-02-216-11/+91
| | | | | | | | | | | | | | | | (Only in environment.d files.) We have only basic compatibility with shell syntax, but specifying variables without using braces is probably more common, and I think a lot of people would be surprised if this didn't work.
| * basic/env-util: use _cleanup_ in replace_env()Zbigniew Jędrzejewski-Szmek2017-02-211-13/+6
| |
| * build-sys,man: load /etc/environment and describe the new environment.d syntaxRay Strode2017-02-213-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | Add support for /etc/environment and document the changes to the user manager to automatically import environment *.conf files from: ~/.config/environment.d/ /etc/environment.d/ /run/environment.d/ /usr/local/lib/environment.d/ /usr/lib/environment.d/ /etc/environment
| * environment-generator: new generator to peruse environment.dZbigniew Jędrzejewski-Szmek2017-02-218-2/+208
| | | | | | | | | | | | | | | | Why the strange name: the prefix is necessary to follow our own advice that environment generators should have numerical prefixes. I also put -d- in the name because otherwise the name was very easy to mistake with systemd.environment-generator. This additional letter clarifies that this on special generator that supports environment.d files.
| * basic: add new merge_env_file functionRay Strode2017-02-216-7/+131
| | | | | | | | | | | | | | | | | | | | | | | | merge_env_file is a new function, that's like load_env_file, but takes a pre-existing environment as an input argument. New environment entries are merged. Variable expansion is performed. Falling back to the process environment is supported (when a flag is set). Alternatively this could be implemented as passing an additional fallback environment array, but later on we're adding another flag to allow braceless expansion, and the two flags can be combined in one arg, so there's less stuff to pass around.
| * basic: drop unnecessary strempty() call in replace_envRay Strode2017-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | strempty() converts a NULL value to empty string, so that it can be passed on to functions that don't support NULL. replace_env calls strempty before passing its value on to strappend. strappend supports NULL just fine, though, so this commit drops the strempty call.
| * basic: fix strv_env_get_n for unclean arraysRay Strode2017-02-212-1/+12
| | | | | | | | | | | | | | If an environment array has duplicates, strv_env_get_n returns the results for the first match. This is wrong, because later entries in the environment are supposed to replace earlier entries.
| * man: add systemd.environment-generator(7) with two examplesZbigniew Jędrzejewski-Szmek2017-02-216-2/+218
| | | | | | | | | | | | | | | | | | v2: - add example files to EXTRA_DIST v3: - rework for the new scheme where nothing is written to disk v4: - use separate dirs for system and user env generators
| * manager: run environment generatorsZbigniew Jędrzejewski-Szmek2017-02-213-12/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Environment file generators are a lot like unit file generators, but not exactly: 1. environment file generators are run for each manager instance, and their output is (or at least can be) individualized. The generators themselves are system-wide, the same for all users. 2. environment file generators are run sequentially, in priority order. Thus, the lifetime of those files is tied to lifecycle of the manager instance. Because generators are run sequentially, later generators can use or modify the output of earlier generators. Each generator is run with no arguments, and the whole state is stored in the environment variables. The generator can echo a set of variable assignments to standard output: VAR_A=something VAR_B=something else This output is parsed, and the next and subsequent generators run with those updated variables in the environment. After the last generator is done, the environment that the manager itself exports is updated. Each generator must return 0, otherwise the output is ignored. The generators in */user-env-generator are for the user session managers, including root, and the ones in */system-env-generator are for pid1.
| * exec-util: implement a set of callbacks to pass variables aroundZbigniew Jędrzejewski-Szmek2017-02-213-0/+159
| | | | | | | | Only tests are added, otherwise the new code is unused.
| * basic/env-util: drop _pure_ from static functionZbigniew Jędrzejewski-Szmek2017-02-211-1/+1
| |
| * env-util,fileio: immediately replace variables in load_env_file_push()Zbigniew Jędrzejewski-Szmek2017-02-213-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strv_env_replace was calling env_match(), which in effect allowed multiple values for the same key to be inserted into the environment block. That's pointless, because APIs to access variables only return a single value (the latest entry), so it's better to keep the block clean, i.e. with just a single entry for each key. Add a new helper function that simply tests if the part before '=' is equal in two strings and use that in strv_env_replace. In load_env_file_push, use strv_env_replace to immediately replace the previous assignment with a matching name. Afaict, none of the callers are materially affected by this change, but it seems like some pointless work was being done, if the same value was set multiple times. We'd go through parsing and assigning the value for each entry. With this change, we handle just the last one.
| * basic/fileio: add helper function for a set of two common checksZbigniew Jędrzejewski-Szmek2017-02-211-33/+25
| |
| * core/manager: move environment serialization out to basic/env-util.cZbigniew Jędrzejewski-Szmek2017-02-213-26/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | This protocol is generally useful, we might just as well reuse it for the env. generators. The implementation is changed a bit: instead of making a new strv and freeing the old one, just mutate the original. This is much faster with larger arrays, while in fact atomicity is preserved, since we only either insert the new entry or not, without being in inconsistent state. v2: - fix confusion with return value
| * core/manager: fix grammar in commentZbigniew Jędrzejewski-Szmek2017-02-211-4/+3
| |
| * basic/exec-util: add support for synchronous (ordered) executionZbigniew Jędrzejewski-Szmek2017-02-216-47/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The output of processes can be gathered, and passed back to the callee. (This commit just implements the basic functionality and tests.) After the preparation in previous commits, the change in functionality is relatively simple. For coding convenience, alarm is prepared *before* any children are executed, and not before. This shouldn't matter usually, since just forking of the children should be pretty quick. One could also argue that this is more correct, because we will also catch the case when (for whatever reason), forking itself is slow. Three callback functions and three levels of serialization are used: - from individual generator processes to the generator forker - from the forker back to the main process - deserialization in the main process v2: - replace an structure with an indexed array of callbacks
| * core/manager: split out creation of serialization fd out to a helperZbigniew Jędrzejewski-Szmek2017-02-214-13/+34
| | | | | | | | | | | | There is a slight change in behaviour: the user manager for root will create a temporary file in /run/systemd, not /tmp. I don't think this matters, but simplifies implementation.
| * basic/strv: allow NULLs to be inserted into strvZbigniew Jędrzejewski-Szmek2017-02-121-6/+6
| | | | | | | | | | All callers of this function insert non-empty strings, so there's no functional change.
| * manager: fix handling of failure in initializationZbigniew Jędrzejewski-Szmek2017-02-121-1/+3
| | | | | | | | | | We would warn and continue after failure in manager_startup, but there's no way we can continue. We must fail.
| * basic/def: indentationZbigniew Jędrzejewski-Szmek2017-02-121-7/+7
| |
| * basic/exec-util: use conf_files_list_strv to list executablesZbigniew Jędrzejewski-Szmek2017-02-121-50/+25
| | | | | | | | | | | | Essentially the same logic as in conf_files_list() was independently implemented in do_execute(). With previous commit, do_execute() can just call conf_files_list() to get a list of executable paths.
| * basic/conf-files: extend conf_files_list() to list unsuffixed filesZbigniew Jędrzejewski-Szmek2017-02-122-4/+22
| | | | | | | | | | | | | | 5dd11ab5f36ce71138005 did a similar change for conf_files_list_strv(). Here we do the same for conf_files_list() and conf_files_list_nulstr(). No change for existing users. Tests are added.
| * basic/exec-util: split out actual execution to a different functionZbigniew Jędrzejewski-Szmek2017-02-121-25/+35
| | | | | | | | | | This corrects an error in error handling: if execution fails, we should never use return, but immediately _exit().
| * basic/util: move execute_directory() to separate fileZbigniew Jędrzejewski-Szmek2017-02-1211-190/+303
| | | | | | | | It's a fairly specialized function. Let's make new files for it and the tests.
* | coredumpctl: print a hint if any coredumps are in flight (#5393)Zbigniew Jędrzejewski-Szmek2017-02-211-1/+67
| | | | | | Fixes #4685.
* | Merge pull request #5390 from keszybz/coverityLennart Poettering2017-02-217-43/+42
|\ \ | | | | | | Clarifications to make coverity happy
| * | sd-device: replace lstat() + open() with open(O_NOFOLLOW)Zbigniew Jędrzejewski-Szmek2017-02-201-27/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity was complaining about TOCTOU (CID #745806). Indeed, it seems better to open the file and avoid the stat altogether: - O_NOFOLLOW means we'll get ELOOP, which we can translate to EINVAL as before, - similarly, open(O_WRONLY) on a directory will fail with EISDIR, - and finally, it makes no sense to check access mode ourselves: just let the kernel do it and propagate the error. v2: - fix memleak, don't clober input arg
| * | shared/pager: abort if we cannot set environment variablesZbigniew Jędrzejewski-Szmek2017-02-201-3/+5
| | | | | | | | | | | | | | | | | | | | | This most likely means oom, it's better to exit than to run less with incomplete settings. CID #714383.
| * | core/execute: add (void)Zbigniew Jędrzejewski-Szmek2017-02-201-4/+6
| | | | | | | | | | | | CID #778045.
| * | logind: check return value from lseekZbigniew Jędrzejewski-Szmek2017-02-201-5/+4
| | | | | | | | | | | | | | | | | | | | | In practice this doesn't matter much because the read that follows will likely fail, but we'll get a better error message. CID #1368233.
| * | importd: check setenv return valueZbigniew Jędrzejewski-Szmek2017-02-201-2/+5
| | | | | | | | | | | | CID #1368235.
| * | core/killall: add (void)Zbigniew Jędrzejewski-Szmek2017-02-201-1/+2
| | | | | | | | | | | | CID #1368238.