]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 years agoman: add systemd.environment-generator(7) with two examples
Zbigniew Jędrzejewski-Szmek [Mon, 23 Jan 2017 06:11:45 +0000 (01:11 -0500)] 
man: add systemd.environment-generator(7) with two examples

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

7 years agomanager: run environment generators
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 06:13:47 +0000 (01:13 -0500)] 
manager: run environment generators

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.

7 years agoexec-util: implement a set of callbacks to pass variables around
Zbigniew Jędrzejewski-Szmek [Sat, 11 Feb 2017 02:49:01 +0000 (21:49 -0500)] 
exec-util: implement a set of callbacks to pass variables around

Only tests are added, otherwise the new code is unused.

7 years agobasic/env-util: drop _pure_ from static function
Zbigniew Jędrzejewski-Szmek [Sat, 18 Feb 2017 21:23:03 +0000 (16:23 -0500)] 
basic/env-util: drop _pure_ from static function

7 years agoenv-util,fileio: immediately replace variables in load_env_file_push()
Zbigniew Jędrzejewski-Szmek [Sat, 11 Feb 2017 04:08:53 +0000 (23:08 -0500)] 
env-util,fileio: immediately replace variables in load_env_file_push()

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.

7 years agobasic/fileio: add helper function for a set of two common checks
Zbigniew Jędrzejewski-Szmek [Sat, 11 Feb 2017 03:14:03 +0000 (22:14 -0500)] 
basic/fileio: add helper function for a set of two common checks

7 years agocore/manager: move environment serialization out to basic/env-util.c
Zbigniew Jędrzejewski-Szmek [Sat, 11 Feb 2017 02:44:21 +0000 (21:44 -0500)] 
core/manager: move environment serialization out to basic/env-util.c

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

7 years agocore/manager: fix grammar in comment
Zbigniew Jędrzejewski-Szmek [Fri, 10 Feb 2017 20:41:42 +0000 (15:41 -0500)] 
core/manager: fix grammar in comment

7 years agobasic/exec-util: add support for synchronous (ordered) execution
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 20:22:37 +0000 (15:22 -0500)] 
basic/exec-util: add support for synchronous (ordered) execution

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

7 years agocore/manager: split out creation of serialization fd out to a helper
Zbigniew Jędrzejewski-Szmek [Sat, 11 Feb 2017 23:33:16 +0000 (18:33 -0500)] 
core/manager: split out creation of serialization fd out to a helper

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.

7 years agobasic/strv: allow NULLs to be inserted into strv
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 21:23:24 +0000 (16:23 -0500)] 
basic/strv: allow NULLs to be inserted into strv

All callers of this function insert non-empty strings, so there's no functional
change.

7 years agomanager: fix handling of failure in initialization
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 06:35:33 +0000 (01:35 -0500)] 
manager: fix handling of failure in initialization

We would warn and continue after failure in manager_startup, but there's no
way we can continue. We must fail.

7 years agobasic/def: indentation
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 21:38:01 +0000 (16:38 -0500)] 
basic/def: indentation

7 years agobasic/exec-util: use conf_files_list_strv to list executables
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 19:44:34 +0000 (14:44 -0500)] 
basic/exec-util: use conf_files_list_strv to list executables

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.

7 years agobasic/conf-files: extend conf_files_list() to list unsuffixed files
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 19:16:19 +0000 (14:16 -0500)] 
basic/conf-files: extend conf_files_list() to list unsuffixed files

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.

7 years agobasic/exec-util: split out actual execution to a different function
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 18:06:27 +0000 (13:06 -0500)] 
basic/exec-util: split out actual execution to a different function

This corrects an error in error handling: if execution fails, we should
never use return, but immediately _exit().

7 years agobasic/util: move execute_directory() to separate file
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2017 17:35:08 +0000 (12:35 -0500)] 
basic/util: move execute_directory() to separate file

It's a fairly specialized function. Let's make new files for it and the tests.

7 years agocore: make sure to destroy all name watching bus slots when we are kicked off the...
Lennart Poettering [Fri, 10 Feb 2017 02:54:48 +0000 (03:54 +0100)] 
core: make sure to destroy all name watching bus slots when we are kicked off the bus (#5294)

Fixes: #4528
7 years agotests: show journal on systemd-resolved.service failures (#5297)
Martin Pitt [Fri, 10 Feb 2017 02:30:44 +0000 (03:30 +0100)] 
tests: show journal on systemd-resolved.service failures (#5297)

In networkd-test.py, show resolved's journal on failure, to debug issues
like https://github.com/systemd/systemd/pull/5283.

7 years agoseccomp: add forgotten munmap() syscall to @file-system (#5291)
Lennart Poettering [Fri, 10 Feb 2017 02:29:33 +0000 (03:29 +0100)] 
seccomp: add forgotten munmap() syscall to @file-system (#5291)

We added mmap() and mmap2(), but forgot munmap(). Fix that.

Pointed out by @lucaswerkmeister:

https://github.com/systemd/systemd/pull/4537#issuecomment-273275298

7 years agoMerge pull request #5293 from poettering/seccomp-docs
Zbigniew Jędrzejewski-Szmek [Fri, 10 Feb 2017 02:28:12 +0000 (21:28 -0500)] 
Merge pull request #5293 from poettering/seccomp-docs

Two doc fixes

7 years agoMerge pull request #5295 from poettering/shutup-canonicalize
Evgeny Vereshchagin [Fri, 10 Feb 2017 01:03:59 +0000 (04:03 +0300)] 
Merge pull request #5295 from poettering/shutup-canonicalize

Shut up canonicalize debug log messages

7 years agodropin: always initialize return parameters on success 5295/head
Lennart Poettering [Thu, 9 Feb 2017 19:10:03 +0000 (20:10 +0100)] 
dropin: always initialize return parameters on success

Just as a matter of coding style: whenever we return successfully, let's
make sure all our return parameters are properly initialized to
something.

7 years agodropin: let's reduce duplicate a bit
Lennart Poettering [Thu, 9 Feb 2017 19:08:58 +0000 (20:08 +0100)] 
dropin: let's reduce duplicate a bit

After generating the template name we can shortcut things and just call
unit_file_find_dirs() from inside itself, just with the new name and
save a good number of duplicate lines.

7 years agodropin: let's prefer strjoina() over strjoin()
Lennart Poettering [Thu, 9 Feb 2017 19:08:44 +0000 (20:08 +0100)] 
dropin: let's prefer strjoina() over strjoin()

7 years agodropin: downgrade logging about paths we cannot canonicalize
Lennart Poettering [Thu, 9 Feb 2017 19:07:00 +0000 (20:07 +0100)] 
dropin: downgrade logging about paths we cannot canonicalize

After all, most units won't have drop-in dirs, hence there's no point in
logging about that.

Fixes: #5252
7 years agoman: update pam_systemd and systemd-logind man pages a bit 5293/head
Lennart Poettering [Thu, 9 Feb 2017 17:40:42 +0000 (18:40 +0100)] 
man: update pam_systemd and systemd-logind man pages a bit

This builds on @utezduyar's #4640, but extends on it.

Fixes: #4550
Replaces: #4640

7 years agoman: improve documentation on seccomp regarding alternative ABIs
Lennart Poettering [Thu, 9 Feb 2017 17:27:02 +0000 (18:27 +0100)] 
man: improve documentation on seccomp regarding alternative ABIs

Let's clarify that RestrictAddressFamilies= and MemoryDenyWriteExecute=
are only fully effective if non-native system call architectures are
disabled, since they otherwise may be used to circumvent the filters, as
the filters aren't equally effective on all ABIs.

Fixes: #5277
7 years agoIntroduce '## ' as internal comment prefix in .in files and filter out a comment...
Zbigniew Jędrzejewski-Szmek [Thu, 9 Feb 2017 15:28:37 +0000 (10:28 -0500)] 
Introduce '## ' as internal comment prefix in .in files and filter out a comment (#5289)

Sometimes we have comments which don't make sense outside of the systemd
codebase, so let's filter them out from the user-visible files.

Fixes #5286.

7 years agoMerge pull request #5287 from poettering/exit-codes
Zbigniew Jędrzejewski-Szmek [Thu, 9 Feb 2017 14:42:43 +0000 (09:42 -0500)] 
Merge pull request #5287 from poettering/exit-codes

rework WorkingDirectory= and RootDirectory= management for services

7 years agoMerge pull request #5255 from poettering/percent-escape
Zbigniew Jędrzejewski-Szmek [Thu, 9 Feb 2017 14:18:41 +0000 (09:18 -0500)] 
Merge pull request #5255 from poettering/percent-escape

fstab-generator: Options= applies specifier expansion

7 years agoexecute: set the right exit status for CHDIR vs. CHROOT 5287/head
Lennart Poettering [Thu, 9 Feb 2017 12:17:00 +0000 (13:17 +0100)] 
execute: set the right exit status for CHDIR vs. CHROOT

Fixes: #5125
7 years agoexecute: use prefix_roota() where appropriate
Lennart Poettering [Thu, 9 Feb 2017 12:16:51 +0000 (13:16 +0100)] 
execute: use prefix_roota() where appropriate

7 years agoexecute: set working directory to /root if User= is not set, but WorkingDirectory...
Lennart Poettering [Thu, 9 Feb 2017 10:58:39 +0000 (11:58 +0100)] 
execute: set working directory to /root if User= is not set, but WorkingDirectory=~ is

Or actually, try to to do the right thing depending on what is
available:

- If we know $HOME from User=, then use that.
- If the UID for the service is 0, hardcode that WorkingDirectory=~ means WorkingDirectory=/root
- In any other case (which will be the unprivileged --user case), use
  get_home_dir() to find the $HOME of the user we are running as.
- Otherwise fail.

Fixes: #5246 #5124
7 years agoRevert "core/execute: set HOME, USER also for root users"
Lennart Poettering [Thu, 9 Feb 2017 10:43:44 +0000 (11:43 +0100)] 
Revert "core/execute: set HOME, USER also for root users"

This reverts commit 8b89628a10af3863bfc97872912e9da4076a5929.

This broke #5246

7 years agonetworkd: add multicast membership to lldp socket (#5282)
27o [Thu, 9 Feb 2017 09:36:13 +0000 (10:36 +0100)] 
networkd: add multicast membership to lldp socket (#5282)

7 years agodhcp-server: always save the ACKed lease address (#5281)
27o [Thu, 9 Feb 2017 09:15:21 +0000 (10:15 +0100)] 
dhcp-server: always save the ACKed lease address (#5281)

7 years agoMerge pull request #5279 from keszybz/man-reverts
Martin Pitt [Thu, 9 Feb 2017 07:35:28 +0000 (08:35 +0100)] 
Merge pull request #5279 from keszybz/man-reverts

A revert and some other tweaks for the man pages

7 years agoMerge pull request #4962 from poettering/root-directory-2
Zbigniew Jędrzejewski-Szmek [Thu, 9 Feb 2017 04:05:05 +0000 (23:05 -0500)] 
Merge pull request #4962 from poettering/root-directory-2

Add new MountAPIVFS= boolean unit file setting + RootImage=

7 years agoman: add more commas for clarify and reword a few sentences 4962/head
Zbigniew Jędrzejewski-Szmek [Thu, 9 Feb 2017 03:53:16 +0000 (22:53 -0500)] 
man: add more commas for clarify and reword a few sentences

7 years agoman: revert documentation about RequiresMountsFor= honoring noauto 5279/head
Zbigniew Jędrzejewski-Szmek [Thu, 9 Feb 2017 01:23:12 +0000 (20:23 -0500)] 
man: revert documentation about RequiresMountsFor= honoring noauto

This effectively reverts commit 5d2abc04fc95f5c5f6d0eaf2f:
Author: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date:   Wed Apr 16 22:15:42 2014 -0400

    man: document relationship between RequiresMountsFor and noauto

    https://bugzilla.redhat.com/show_bug.cgi?id=1088057

Fixes #5249.

7 years agoman: break long lines and update Fedora versions
Zbigniew Jędrzejewski-Szmek [Thu, 9 Feb 2017 01:13:57 +0000 (20:13 -0500)] 
man: break long lines and update Fedora versions

We should try to keep the unbreakable lines below 80 columns.
It's not always possible of course.

Also, use the dl.fp.o alias instead of a specific mirror.

7 years agoMerge pull request #5270 from poettering/seccomp-namespace-fix
Evgeny Vereshchagin [Thu, 9 Feb 2017 00:31:22 +0000 (03:31 +0300)] 
Merge pull request #5270 from poettering/seccomp-namespace-fix

swap seccomp filter params on s390

7 years agoman: fix docs for swap's DefaultDependencies= (#5278)
David Glasser [Wed, 8 Feb 2017 23:12:36 +0000 (15:12 -0800)] 
man: fix docs for swap's DefaultDependencies= (#5278)

There was a missing dependency and one with the wrong type. Additionally, refer
to DefaultDependencies= once instead of twice, without a vague reference in the
first one that doesn't mention that the value matters.

Fixes #5226.

7 years agoupdate TODO 5270/head
Lennart Poettering [Wed, 8 Feb 2017 15:29:05 +0000 (16:29 +0100)] 
update TODO

7 years agoseccomp: on s390 the clone() parameters are reversed
Lennart Poettering [Wed, 8 Feb 2017 15:21:11 +0000 (16:21 +0100)] 
seccomp: on s390 the clone() parameters are reversed

Add a bit of code that tries to get the right parameter order in place
for some of the better known architectures, and skips
restrict_namespaces for other archs.

This also bypasses the test on archs where we don't know the right
order.

In this case I didn't bother with testing the case where no filter is
applied, since that is hopefully just an issue for now, as there's
nothing stopping us from supporting more archs, we just need to know
which order is right.

Fixes: #5241
7 years agosystemctl: make sure that --now is carried out (#5209)
Jan Synacek [Wed, 8 Feb 2017 19:57:08 +0000 (20:57 +0100)] 
systemctl: make sure that --now is carried out (#5209)

When services are already enabled/disabled/masked, make sure
that --now still enforces start/stop.

7 years agosd-event: "when exiting no signal event are pending" is a wrong assertion (#5271)
Franck Bui [Wed, 8 Feb 2017 19:56:22 +0000 (20:56 +0100)] 
sd-event: "when exiting no signal event are pending" is a wrong assertion (#5271)

The code make the following assertion: when freeing a event loop object
(usually it's done after exiting from the main event loop), no signal events
are still queued and are pending.

This assertion can be found in event_unmask_signal_data() with
"assert(!d->current);" assertion.

It appears that this assertion can be wrong at least in a specific case
described below.

Consider the following example which is inspired from udev: a process defines 3
source events: 2 are created by sd_event_add_signal() and 1 is created by
sd_event_add_post().

 1. the process receives the 2 signals consecutively so that signal 'A' source
     event is queued and pending. Consequently the post source event is also
     queued and pending. This is done by sd_event_wait().

 2. The callback for signal 'A' is called by sd_event_dispatch().

 3. The next call to sd_event_wait() will queue signal 'B' source event.

 4. The callback for the post source event is called and calls sd_event_exit().

 5. the event loop is exited.

 6. freeing the event loop object will lead to the assertion failure in
     event_unmask_signal_data().

This patch simply removes this assertion as it doesn't seem to be a
bug if the signal data still reference a signal source at this point.

7 years agosysctl.d: replace URL of SysRq key documentation (#5274)
Peter Körner [Wed, 8 Feb 2017 18:42:43 +0000 (19:42 +0100)] 
sysctl.d: replace URL of SysRq key documentation (#5274)

The kernel documentation page is not distribution specific and also more
likely to be up to date than the Fedora wiki page referenced previously.

7 years agofstab-generator: also convert % → %% for What= 5255/head
Lennart Poettering [Wed, 8 Feb 2017 16:14:58 +0000 (17:14 +0100)] 
fstab-generator: also convert % → %% for What=

Same reasons as the previous patch.

7 years agofstab-generator: Options= applies specifier expansion
Lennart Poettering [Tue, 7 Feb 2017 12:08:56 +0000 (13:08 +0100)] 
fstab-generator: Options= applies specifier expansion

Let's document that this is the case, and properly escape % when we
generate Options= in the generator.

Fixes: #5086
7 years agonspawn: Add support for sysroot pivoting (#5258)
Philip Withnall [Wed, 8 Feb 2017 15:54:31 +0000 (15:54 +0000)] 
nspawn: Add support for sysroot pivoting (#5258)

Add a new --pivot-root argument to systemd-nspawn, which specifies a
directory to pivot to / inside the container; while the original / is
pivoted to another specified directory (if provided). This adds
support for booting container images which may contain several bootable
sysroots, as is common with OSTree disk images. When these disk images
are booted on real hardware, ostree-prepare-root is run in conjunction
with sysroot.mount in the initramfs to achieve the same results.

7 years agotest: Fix a maybe-uninitialised compiler warning (#5269)
Philip Withnall [Wed, 8 Feb 2017 15:53:01 +0000 (15:53 +0000)] 
test: Fix a maybe-uninitialised compiler warning (#5269)

The compiler warning is a false positive, since n_addresses is always
initialised on the success path from parse_argv(), but the compiler
obviously can’t work that out.

Fixes:
   src/test/test-nss.c:426:9: warning: 'n_addresses' may be used uninitialized in this function [-Wmaybe-uninitialized]

7 years agoseccomp: MemoryDenyWriteExecute= should affect both mmap() and mmap2() (#5254)
Lennart Poettering [Wed, 8 Feb 2017 14:14:02 +0000 (15:14 +0100)] 
seccomp: MemoryDenyWriteExecute= should affect both mmap() and mmap2() (#5254)

On i386 we block the old mmap() call entirely, since we cannot properly
filter it. Thankfully it hasn't been used by glibc since quite some
time.

Fixes: #5240
7 years agoMerge pull request #5231 from keszybz/mask-wants
Lennart Poettering [Wed, 8 Feb 2017 13:50:56 +0000 (14:50 +0100)] 
Merge pull request #5231 from keszybz/mask-wants

Mask individual .wants/.requires symlinks

7 years agodissect: don't honour NOAUTO flags when looking for ESP (#5224)
Lennart Poettering [Wed, 8 Feb 2017 03:10:48 +0000 (04:10 +0100)] 
dissect: don't honour NOAUTO flags when looking for ESP (#5224)

The flag is originally defined for "basic data partitions", but not for the
ESP. We reuse it for the various partitions defined by the Discoverable
Partitions Spec, but it isn't defined for the ESP, hence don't check for
it. Instead, do check for GPT_FLAG_NO_BLOCK_IO_PROTOCOL, as that flag
actually is defined for all partition types, and recommended to use by
the UEFI spec.

Fixes: #5218
7 years agotests: add dropin dependency tests 5231/head
Franck Bui [Fri, 27 Jan 2017 15:02:22 +0000 (16:02 +0100)] 
tests: add dropin dependency tests

[zj: tests assertions adjusted to the different logic in which masking
     of a dependency through one name, does not forbid the dependency
     being added through another name.]

7 years agocore/load-dropin: add more sanity checks on .wants/.requires symlinks
Zbigniew Jędrzejewski-Szmek [Sun, 5 Feb 2017 03:36:17 +0000 (22:36 -0500)] 
core/load-dropin: add more sanity checks on .wants/.requires symlinks

Feb 04 22:35:42 systemd[1462]: foo.service: Wants dependency dropin /home/zbyszek/.config/systemd/user/foo.service.wants/diffname.service target ../barbar.service has different name
Feb 04 22:35:42 systemd[1462]: foo.service: Wants dependency dropin /home/zbyszek/.config/systemd/user/foo.service.wants/wrongname is not a valid unit name, ignoring

7 years agocore: drop code that is now unused
Zbigniew Jędrzejewski-Szmek [Sun, 5 Feb 2017 02:32:08 +0000 (21:32 -0500)] 
core: drop code that is now unused

7 years agocore: implement masking of .wants/.requires symlinks
Zbigniew Jędrzejewski-Szmek [Sun, 5 Feb 2017 01:50:44 +0000 (20:50 -0500)] 
core: implement masking of .wants/.requires symlinks

Fixes #1169.
Fixes #4830.

Example log errors:
Feb 04 22:13:28 systemd[1462]: foo.service: Wants dependency on empty_file.service is masked by /home/zbyszek/.config/systemd/user/foo.service.wants/empty_file.service, ignoring
Feb 04 22:13:28 systemd[1462]: foo.service: Wants dependency on masked.service is masked by /home/zbyszek/.config/systemd/user/foo.service.wants/masked.service, ignoring

7 years agocore: when loading .wants and .requires, follow the same logic as .d conf dropins
Zbigniew Jędrzejewski-Szmek [Sun, 5 Feb 2017 01:50:44 +0000 (20:50 -0500)] 
core: when loading .wants and .requires, follow the same logic as .d conf dropins

Essentially, instead of sequentially adding deps based on all symlinks
encountered in .wants and .requires dirs for each name and each unit file load
path, iteratate over the load paths and unit names gathering symlinks, then
order them based on priority, and then iterate over the final list, adding
dependencies.

This patch doesn't change the logic too much, except that the order in which
dependencies are applied might be different. It wasn't defined before, so that
not really a change. Adding filtering on the symlinks is left for later
patches.

7 years agobasic/dirent-util: allow suffix to be omitted for dirent_is_file_with_suffix
Zbigniew Jędrzejewski-Szmek [Wed, 8 Feb 2017 02:06:38 +0000 (21:06 -0500)] 
basic/dirent-util: allow suffix to be omitted for dirent_is_file_with_suffix

7 years agoman: s/--unmount/--umount/g (#5243)
Lennart Poettering [Wed, 8 Feb 2017 00:54:37 +0000 (01:54 +0100)] 
man: s/--unmount/--umount/g (#5243)

The --help text currently uses the "--umount" spelling, hence to the
same in the man page too.

And let's settle on "umount" instead of "unmount" here, since most folks
probably expect that when typing in a command, as util-linux' tool is
called "umount" after all, and so is the symlink "systemd-umount" we
install.

7 years agoMerge pull request #5263 from poettering/install-alias
Zbigniew Jędrzejewski-Szmek [Wed, 8 Feb 2017 00:50:20 +0000 (19:50 -0500)] 
Merge pull request #5263 from poettering/install-alias

7 years agoRevert "fix handling of templates instantiated in /usr/lib (#5263)"
Zbigniew Jędrzejewski-Szmek [Wed, 8 Feb 2017 00:49:47 +0000 (19:49 -0500)] 
Revert "fix handling of templates instantiated in /usr/lib  (#5263)"

This reverts commit 0698b674920aa8a56dbd6a625729a35e5ae9c5df.

It was supposed to be merged, not squashed.

7 years agofix handling of templates instantiated in /usr/lib (#5263)
Lennart Poettering [Wed, 8 Feb 2017 00:48:56 +0000 (01:48 +0100)] 
fix handling of templates instantiated in /usr/lib  (#5263)

Fix handling of templates instantiated in /usr/lib.
All work to fix #5136.

7 years agoman: document *.d/ drop-in file order (#5262)
Lucas Werkmeister [Tue, 7 Feb 2017 23:58:02 +0000 (00:58 +0100)] 
man: document *.d/ drop-in file order (#5262)

7 years agotmpfiles.d: set primary group rights to r-w (#5265)
lewo [Tue, 7 Feb 2017 23:56:55 +0000 (00:56 +0100)] 
tmpfiles.d: set primary group rights to r-w (#5265)

If the /var/log/journal directory is created with rigths 700, the application
of an ACL rules without any primary group right sets it to 0. A chmod 755 on
this file will then only set the ACL mask and let the ACL primary group right
to 0. The directory is then unreadable for the primary group.

This patch explicitly sets the primary group to avoid this problem.

Fixes #5264.

7 years agoMerge pull request #5219 from poettering/run-size-check
Zbigniew Jędrzejewski-Szmek [Tue, 7 Feb 2017 23:37:04 +0000 (18:37 -0500)] 
Merge pull request #5219 from poettering/run-size-check

before reloading, check that /run/systemd has enough space

7 years agoMerge pull request #5259 from lucaswerkmeister/man
Lennart Poettering [Tue, 7 Feb 2017 19:24:43 +0000 (20:24 +0100)] 
Merge pull request #5259 from lucaswerkmeister/man

Manpage improvements

7 years agoMerge pull request #5261 from AsciiWolf/master
Lennart Poettering [Tue, 7 Feb 2017 19:24:05 +0000 (20:24 +0100)] 
Merge pull request #5261 from AsciiWolf/master

l10n: various fixes

7 years agoinstall: remove some unused parameters from various functions in install.c 5263/head
Lennart Poettering [Tue, 7 Feb 2017 19:22:09 +0000 (20:22 +0100)] 
install: remove some unused parameters from various functions in install.c

No need to pass what we don't use.

7 years agoinstall: when a template unit is instantiated via a /usr symlink, consider it enabled
Lennart Poettering [Tue, 7 Feb 2017 19:16:12 +0000 (20:16 +0100)] 
install: when a template unit is instantiated via a /usr symlink, consider it enabled

If a unit foobar@.service stored below /usr is instantiated via a
symlink foobar@quux.service also below /usr, then we should consider the
instance statically enabled, while the template itself should continue
to be considered enabled/disabled/static depending on its [Install]
section.

In order to implement this we'll now look for enablement symlinks in all
unit search paths, not just in the config and runtime dirs.

Fixes: #5136
7 years agol10n: fix file permissions of Indonesian translation 5261/head
AsciiWolf [Tue, 7 Feb 2017 18:02:01 +0000 (19:02 +0100)] 
l10n: fix file permissions of Indonesian translation

7 years agol10n: fix strings formatting in Czech translation
AsciiWolf [Tue, 7 Feb 2017 18:00:24 +0000 (19:00 +0100)] 
l10n: fix strings formatting in Czech translation

7 years agoman: document that systemd-run --on-* cannot be used with --pty 5259/head
Lucas Werkmeister [Tue, 7 Feb 2017 15:25:17 +0000 (16:25 +0100)] 
man: document that systemd-run --on-* cannot be used with --pty

7 years agoinstall: don't enter loop when traversing a template symlinks
Lennart Poettering [Tue, 7 Feb 2017 15:22:49 +0000 (16:22 +0100)] 
install: don't enter loop when traversing a template symlinks

Before this patch, if we'd encounter an instance or template symlink
while traversing a chain of symlinks we'd fill in the instance name and
retry the iteration. This makes no sense if the resulting name is
actually the same as we are coming from, as we'd just spin a couple of
times in the loop, until the UNIT_FILE_FOLLOW_SYMLINK_MAX iteration
limit is hit.

Fix this, by accepted the symlink as it is, if it identical to what we
filled in.

7 years agoman: use systemctl enable --now
Lucas Werkmeister [Thu, 26 Jan 2017 10:03:09 +0000 (11:03 +0100)] 
man: use systemctl enable --now

7 years agoman: add cross-reference
Lucas Werkmeister [Thu, 26 Jan 2017 10:01:28 +0000 (11:01 +0100)] 
man: add cross-reference

The third paragraph of the Description already linked to
systemd.resource-control(5), but it was missing from the list of
additional options for the [Service] section.

7 years agoupdate TODO
Lennart Poettering [Fri, 23 Dec 2016 16:43:58 +0000 (17:43 +0100)] 
update TODO

7 years agodissect: try to read roothash value off user.verity.roothash xattr of image file
Lennart Poettering [Fri, 23 Dec 2016 16:38:12 +0000 (17:38 +0100)] 
dissect: try to read roothash value off user.verity.roothash xattr of image file

This slightly extends the roothash loading logic to first check for a
user.verity.roothash extended attribute on the image file. If it exists,
it is used as Verity root hash and the ".roothash" file is not used.

This should improve the chance that the roothash is retained when the
file is moved around, as the data snippet is attached directly to the
image file. The field is still detached from the file payload however,
in order to make sure it may be trusted independently.

This does not replace the ".roothash" file loading, it simply adds a
second way to retrieve the data.

Extended attributes are often a poor choice for storing metadata like
this as it is usually difficult to discover for admins and users, and
hard to fix if it ever gets out of sync.  However, in this case I think
it's safe as verity implies read-only access, and thus there's little
chance of it to get out of sync.

7 years agocore,nspawn,dissect: make nspawn's .roothash file search reusable
Lennart Poettering [Fri, 23 Dec 2016 16:10:42 +0000 (17:10 +0100)] 
core,nspawn,dissect: make nspawn's .roothash file search reusable

This makes nspawn's logic of automatically discovering the root hash of
an image file generic, and then reuses it in systemd-dissect and in
PID1's RootImage= logic, so that verity is automatically set up whenever
we can.

7 years agocore: add RootImage= setting for using a specific image file as root directory for...
Lennart Poettering [Fri, 23 Dec 2016 13:26:05 +0000 (14:26 +0100)] 
core: add RootImage= setting for using a specific image file as root directory for a service

This is similar to RootDirectory= but mounts the root file system from a
block device or loopback file instead of another directory.

This reuses the image dissector code now used by nspawn and
gpt-auto-discovery.

7 years agodissect: make sure to manually follow symlinks when mounting dissected image
Lennart Poettering [Fri, 23 Dec 2016 10:09:47 +0000 (11:09 +0100)] 
dissect: make sure to manually follow symlinks when mounting dissected image

If the dissected image contains symlinks for the mount points we need we
need to make sure to follow this with chase_symlinks() so that we don't
leave the image.

7 years agocore: actually make "+" prefix in ReadOnlyPaths=, InaccessiblePaths=, ReadWritablePat...
Lennart Poettering [Fri, 23 Dec 2016 00:16:43 +0000 (01:16 +0100)] 
core: actually make "+" prefix in ReadOnlyPaths=, InaccessiblePaths=, ReadWritablePaths= work

5327c910d2fc1ae91bd0b891be92b30379c7467b claimed to add support for "+"
for prefixing paths with the configured RootDirectory=. But actually it
only implemented it in the backend, it did not add support for it to the
configuration file parsers. Fix that now.

7 years agocore: add a per-unit setting MountAPIVFS= for mounting /dev, /proc, /sys in conjuncti...
Lennart Poettering [Thu, 22 Dec 2016 22:34:35 +0000 (23:34 +0100)] 
core: add a per-unit setting MountAPIVFS= for mounting /dev, /proc, /sys in conjunction with RootDirectory=

This adds a boolean unit file setting MountAPIVFS=. If set, the three
main API VFS mounts will be mounted for the service. This only has an
effect on RootDirectory=, which it makes a ton times more useful.

(This is basically the /dev + /proc + /sys mounting code posted in the
original #4727, but rebased on current git, and with the automatic logic
replaced by explicit logic controlled by a unit file setting)

7 years agocore: fix minor memleak in namespace.c
Lennart Poettering [Thu, 22 Dec 2016 16:11:06 +0000 (17:11 +0100)] 
core: fix minor memleak in namespace.c

The source_malloc field wants to be freed, too.

7 years agoMerge pull request #5225 from poettering/seccomp-socket
Evgeny Vereshchagin [Tue, 7 Feb 2017 02:06:54 +0000 (05:06 +0300)] 
Merge pull request #5225 from poettering/seccomp-socket

make RestrictAddressFamilies= officially a NOP on i386

7 years agoMerge pull request #5239 from poettering/notify-access-all
Evgeny Vereshchagin [Mon, 6 Feb 2017 20:59:33 +0000 (23:59 +0300)] 
Merge pull request #5239 from poettering/notify-access-all

man: document that sd_notify() is racy in some cases

7 years agoupdate TODO
Lennart Poettering [Mon, 6 Feb 2017 20:14:31 +0000 (21:14 +0100)] 
update TODO

7 years agoREADME: suffix unit file options with "="
Lennart Poettering [Mon, 6 Feb 2017 20:13:21 +0000 (21:13 +0100)] 
README: suffix unit file options with "="

7 years agoupdate TODO
Lennart Poettering [Mon, 6 Feb 2017 19:26:33 +0000 (20:26 +0100)] 
update TODO

7 years agonotify: document that we fake the PID when sending sd_notify() 5239/head
Lennart Poettering [Mon, 6 Feb 2017 19:01:24 +0000 (20:01 +0100)] 
notify: document that we fake the PID when sending sd_notify()

7 years agoupdate TODO
Lennart Poettering [Mon, 6 Feb 2017 17:37:28 +0000 (18:37 +0100)] 
update TODO

7 years agoman: document that sd_notify() is racy in some cases
Lennart Poettering [Mon, 6 Feb 2017 12:49:44 +0000 (13:49 +0100)] 
man: document that sd_notify() is racy in some cases

7 years agocore: use a memfd for serialization 5219/head
Lennart Poettering [Fri, 3 Feb 2017 15:30:00 +0000 (16:30 +0100)] 
core: use a memfd for serialization

If we can, use a memfd for serializing state during a daemon reload or
reexec. Fall back to a file in /run/systemd or /tmp only if memfds are
not available.

See: #5016

7 years agomanager: refuse reloading/reexecing when /run is overly full
Lennart Poettering [Fri, 3 Feb 2017 11:12:54 +0000 (12:12 +0100)] 
manager: refuse reloading/reexecing when /run is overly full

Let's add an extra safety check: before entering a reload/reexec, let's
verify that there's enough room in /run for it.

Fixes: #5016
7 years agosystemd-mount: add missing fsck argument (#5238)
Lukas Rusak [Mon, 6 Feb 2017 13:25:15 +0000 (05:25 -0800)] 
systemd-mount: add missing fsck argument (#5238)

7 years agoman: Document that RestrictAddressFamilies= doesn't work on s390/s390x/... 5225/head
Lennart Poettering [Fri, 3 Feb 2017 17:33:04 +0000 (18:33 +0100)] 
man: Document that RestrictAddressFamilies= doesn't work on s390/s390x/...

We already say that it doesn't work on i386, but there are more archs
like that apparently.

7 years agoseccomp: RestrictAddressFamilies= is not supported on i386/s390/s390x, make it a NOP
Lennart Poettering [Fri, 3 Feb 2017 17:31:05 +0000 (18:31 +0100)] 
seccomp: RestrictAddressFamilies= is not supported on i386/s390/s390x, make it a NOP

See: #5215