1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 10:25:37 +03:00
Commit Graph

25548 Commits

Author SHA1 Message Date
Evgeny Vereshchagin
e669a55b2c build-sys: add missing -ldl
Fixes #3035
2016-04-14 00:27:04 +00:00
Evgeny Vereshchagin
43bbb8f005 tests: don't rely on the host's systemd-nspawn, don't register test machine (#3023)
Fixes:
$ cd test/TEST-07-ISSUE-1981/
$ sudo make clean setup run
...
timeout: failed to run command ‘systemd-nspawn’: No such file or directory
...
TEST RUN: https://github.com/systemd/systemd/issues/1981 [FAILED]
Makefile:10: recipe for target 'run' failed
make: *** [run] Error 1
2016-04-13 09:57:06 -04:00
Ismo Puustinen
f5faf24679 sd-bus: query pid also when searching for supplementary gids
If the SD_BUS_CREDS_SUPPLEMENTARY_GIDS value is requested, the pid is
queried to find out the supplementary gids value from /proc/pid/status.
Otherwise sd_bus_creds_get_supplementary_gids() won't work unless some
other value in mask triggered fetching the pid information.
2016-04-13 16:18:47 +03:00
Zbigniew Jędrzejewski-Szmek
81d621034b tree-wide: remove useless NULLs from strjoina
The coccinelle patch didn't work in some places, I have no idea why.
2016-04-13 08:56:44 -04:00
Zbigniew Jędrzejewski-Szmek
78e334b50f basic/util: silence stupid gcc warnings about unitialized variable 2016-04-13 08:56:44 -04:00
Martin Pitt
025ef1d226 Merge pull request #2973 from poettering/search-path
Many fixes, in particular to the install logic
2016-04-12 18:20:13 +02:00
Nicolas Braud-Santoni
1116e14c49 load-fragment: Resolve specifiers in DeviceAllow (#3019)
Closes #1602
2016-04-12 18:00:19 +02:00
Lennart Poettering
3c6d8e57e8 systemctl: when we want to know whether there's a native unit file, don't choke on ELOOP
ELOOP indicates that there's a symlink in /etc for a native unit file, and
that's completely OK.
2016-04-12 16:19:57 +02:00
Lennart Poettering
0bed31c103 test-dnssec: drop unused variable 2016-04-12 13:51:28 +02:00
Lennart Poettering
99ef0330e1 core: make sure we always free the list of changes 2016-04-12 13:51:06 +02:00
Lennart Poettering
f6e1bd2c52 man: shorten the list of unit file paths a bit
Let's make this more digestable to read by making the list of documented unit
file paths a bit shorter.

Specifically, let's drop references to $XDG_CONFIG_HOME and $XDG_DATA_HOME, as
their default values are listed too already. Given that the fact that the XDG
basedir spec makes these paths configurable is probably not a strong point of
the spec, let's drop the reference to the env vars, and keep only the literal,
default paths for them in the list. Of course, we do support the full XDG
basedir spec in this regard, but it's one thing to implement it and another one
to recommend it by documenting it.

Replace "$HOME" by "~", because UNIX.
2016-04-12 13:43:33 +02:00
Lennart Poettering
f9ba08fb4f core: keep track of the mtime of the transient unit file we wrote
Otherwise "systemctl status" will immediately report that our unit file is out
of date.
2016-04-12 13:43:33 +02:00
Lennart Poettering
1e555cb52b update TODO 2016-04-12 13:43:33 +02:00
Lennart Poettering
60ca5641b5 sd-lldp: minor whitespace fixes 2016-04-12 13:43:33 +02:00
Lennart Poettering
50724a7afc sd-lldp: drop LLDP ethernet export from sd-lldp.h
We only use it for the Tx code anyway, hence sd-lldp.h shouldn't expose it, as
it only implements Rx.
2016-04-12 13:43:33 +02:00
Lennart Poettering
8e20adcaa0 core: make sure we generate a nicer error when a linked unit is attempted to be enabled
We don't allow using config symlinks to enable units, but the error message we
printed was awful. Fix that, and generate a more readable error.

Fixes #3010.
2016-04-12 13:43:33 +02:00
Lennart Poettering
d94c2b06f9 machinectl: add new "machinectl clean" command
This new command removes all, or all hidden container images that have been
downloaded.
2016-04-12 13:43:33 +02:00
Lennart Poettering
d5bd92bbbe README: document that we only support util-linux built with --enable-libmount-force-mountinfo
Fixes: #2978
2016-04-12 13:43:33 +02:00
Lennart Poettering
cc4e4df49f man: clarify that DefaultDependencies= is in the [Unit] section
This hopefully reduces confusion resulting in issues like #2992.
2016-04-12 13:43:33 +02:00
Lennart Poettering
d2120590ff tests: override XDG_RUNTIME_DIR where we use the user runtime dir
We don#t really support systems where XDG_RUNTIME_DIR is not supported for
systemd --user. Hence, let's always set our own XDG_RUNTIME_DIR for tests that
involve systemd --user, so that we know it is set, and that it doesn't polute
the user's actual runtime dir.
2016-04-12 13:43:33 +02:00
Lennart Poettering
815b09d39b core: optimize unit_write_drop_in a bit
There's no point in first determining the drop-in file name path, then
forgetting it again, and then determining it again. Instead, just generated it
once, and then write to ti directly.
2016-04-12 13:43:33 +02:00
Lennart Poettering
e20b2a867a core: when creating a drop-in snippet, add a comment explaining this to it 2016-04-12 13:43:32 +02:00
Lennart Poettering
344ca7556b core,systemctl: add new "systemctl revert" command
This allows dropping all user configuration and reverting back to the vendor
default of a unit file. It basically undoes what "systemctl edit", "systemctl
set-property" and "systemctl mask" do.
2016-04-12 13:43:32 +02:00
Lennart Poettering
d096025b81 install: fix errno handling 2016-04-12 13:43:32 +02:00
Lennart Poettering
8f9364f98b install: simplify skip_root() a bit
Exit early, so that we can get rid of the large if block.
2016-04-12 13:43:32 +02:00
Lennart Poettering
2c52204c3f nstall: no need to export unit_file_lookup_state() anymore
We only use it inside of install.c, hence let's make it static.
2016-04-12 13:43:32 +02:00
Lennart Poettering
6eb7c172b5 tree-wide: add new SIGNAL_VALID() macro-like function that validates signal numbers
And port all code over to use it.
2016-04-12 13:43:32 +02:00
Lennart Poettering
4c310c073a basic: remove rbtree code, it's unused
it's unused, and should we need it one day we can always resurrect it from git
history.
2016-04-12 13:43:32 +02:00
Lennart Poettering
5ae87056e3 sysv-generator: port to use new unit_file_exists() call
The code previously queries the state of a unit file, but was only interested
in the existance of it, hence let's use unit_file_exists() instead, the same
way the SysV compat code in systemctl does it.
2016-04-12 13:43:32 +02:00
Lennart Poettering
4943d14306 systemctl: don't confuse sysv code with generated units
The SysV compat code checks whether there's a native unit file before looking
for a SysV init script. Since the newest rework generated units will show up in
the unit path, and hence the checks ended up assuming that there always was a
native unit file for each init script: the generated one.

With this change the generated unit file directory is suppressed from the
search path when this check is done, to avoid the confusion.
2016-04-12 13:43:32 +02:00
Lennart Poettering
a69b4fb0f8 path-lookup: move generator_binary_paths() to end of file
Let's keep the code that manipulates LookupPaths together, and move
generator_binary_paths() to the end of the .h and .c files, since it is not
strictly related to that.
2016-04-12 13:43:32 +02:00
Lennart Poettering
c61b443d32 systemctl: add error message when we get unexpected event from waitid()
We should log about everything we don't expect.

Also, add a comment for one case were we do not log, on purpose, and make it
use a separate error code.
2016-04-12 13:43:32 +02:00
Lennart Poettering
cc7cb0ca90 systemctl: fix incorrect errno for error message 2016-04-12 13:43:32 +02:00
Lennart Poettering
e735decc38 systemctl: move check whether a service exists as native unit file to install.c
Move the search path check from the SysV service compat support into install.c
so that we can reuse the usual algorithm instead of rolling a private loop for
this.
2016-04-12 13:43:32 +02:00
Lennart Poettering
27c06cb516 core: rework reboot parameter logic a bit
Always warn if something fails, and clarify that the involved utility functions
do so in their name.

Drop the REBOOT_PARAM_FILE macro. We don't do this for other flag file paths
like this, so don't do this for this one either. The path isn't configurable
anyway, hence let's make this easier to read by avoiding this one indirection.
2016-04-12 13:43:32 +02:00
Lennart Poettering
8612da973d core: be more paranoid when mixing umask and fopen()
Let's be extra careful with the umask when we use simple fopen(), as this
creates files with 0777 by default.
2016-04-12 13:43:32 +02:00
Lennart Poettering
4f4afc88ec core: rework how transient unit files and property drop-ins work
With this change the logic for placing transient unit files and drop-ins
generated via "systemctl set-property" is reworked.

The latter are now placed in the newly introduced "control" unit file
directory. The fomer are now placed in the "transient" unit file directory.

Note that the properties originally set when a transient unit was created will
be written to and stay in the transient unit file directory, while later
changes are done via drop-ins.

This is preparation for a later "systemctl revert" addition, where existing
drop-ins are flushed out, but the original transient definition is restored.
2016-04-12 13:43:32 +02:00
Lennart Poettering
80b1ae32e1 core: introduce a "control" unit file directory
This patch adds a concept of a "control" unit file directory, which is supposed
to be used as place for unit file drop-ins created by "systemctl set-property"
(note that this directory is not actually hooked up to "systemctl set-property"
yet, that's coming in a later patch).

The rationale for this: previously changes made by the user and by "systemctl
set-property" were done in the same directory, which made semantics very
unclear: the changes made by "systemctl set-property" were applied instantly,
and their drop-ins only written to not lose settings on a later "systemctl
daemon-reload", while drop-ins made by the user would only be in effect after
"systemctl daemon-reload". This is particular problematic as the changes made
by "systemctl set-property" would really apply immediately without any respect
for the unit search path. This meant that using "set-property" could have an
effect that is lsot as soon as "daemon-reload" is issued, in case there was a
"later" drop-in already in place.

With this change the directories are seperated, and the "control" directory
always takes the highest priority of all, to avoid any confusion.
2016-04-12 13:43:31 +02:00
Lennart Poettering
9183df707b install: rename generator_paths() → generator_binary_paths()
This is too confusing, as this funciton returns the paths to the generator
binaries, while usually when we refer to the just the "generator path" we mean
the generated unit files. Let's clean this up.
2016-04-12 13:43:31 +02:00
Lennart Poettering
07a7864324 core: move flushing of generated unit files to path-lookup.c
It's very similar to the mkdir and trim operations for the generator dirs,
hence let's unify this at a single place.
2016-04-12 13:43:31 +02:00
Lennart Poettering
d8d410f445 core: minor coding style fix 2016-04-12 13:43:31 +02:00
Lennart Poettering
e46e442243 tests: make sure test-path-lookup can run even when no units are installed on test system 2016-04-12 13:43:31 +02:00
Lennart Poettering
5de344704d localed: downgrade libxkbcommon to an optional runtime dependency
Previously, libxkbcommon was a compile-time option. When enabled the localed
binary would strictly depend on it, thus pulling in libxkbcommon and its
dependencies, which are non-trivial in size.

With this change we dlopen() libxkbcommon when it is available instead. If the
library is available behaviour is as before. However, if it isn't the system is
considered "headless", i.e. without local hardware and all attempts to set the
local keyboard configuration will be refused.

This is useful for general-purpose distributions which want to support
"headless" (such as container systems) and "full" systems with the same build.
2016-04-12 13:43:31 +02:00
Lennart Poettering
198402d3c9 test: bump up log level for install root test 2016-04-12 13:43:31 +02:00
Lennart Poettering
08ce521fb2 shared: add a temporary work-around for kernel header inclusion fuck-up
See: #2864
2016-04-12 13:43:31 +02:00
Lennart Poettering
76adb5b8b5 install: unify checking whether operations may be applied to a unit file in a new function
Let's replace repeated code by a single implementation in a single function.
2016-04-12 13:43:31 +02:00
Lennart Poettering
e4fca67ff0 install: introduce a new unit file state "transient"
Now, that the search path logic knows the unit path for transient units we also
can introduce an explicit unit file state "transient" that clarifies to the
user what kind of unit file he is encountering.
2016-04-12 13:43:31 +02:00
Lennart Poettering
401017e04d install: fix root prefix handling
Previously, we'd execute some operations with the root prefix applied, while
others without (which was a bug). Clean this up: all paths are now prefixed
properly with the root path, and we strip it off when necessary.

(Of course, an alternative option would be to strictly pass around paths
without the prefix prepended and only prepend it right before hitting the disk,
however, I am came to the conclusion this would result in more code.)
2016-04-12 13:43:31 +02:00
Lennart Poettering
a7527131bb path-lookup: make user_runtime_dir() more generic
Let's make the suffix it appends configurable. This way we can reuse it at a second place.
2016-04-12 13:43:31 +02:00
Lennart Poettering
205dd21ecc path-lookup: clean up user_config_home() and user_runtime_dir()
Let's modernize these calls a bit.

Also, don't call them from user_dirs() anymore, as we already have both dirs in
the list a second time via the persistent_config and runtime_config function
parameters.
2016-04-12 13:43:31 +02:00