1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

22634 Commits

Author SHA1 Message Date
Daniel Buch
8b66ad178c sd-pppoe: use strna() instead of strempty()
In cases where we use for instance. log_debug() with a statement + string
it is better to output (Service-name: N/A) instead of (Service-name: )
2015-09-30 23:16:13 +02:00
Felipe Franciosi
4302857b31 Support OP_NOMATCH for TAG key
The TAG key can be used in rules for event matching. At the moment, it
does not support inequality tests. This patch enhances the key test to
validate the rule if it does not contain a given TAG (by TAG!="value").

Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
2015-09-30 22:07:16 +01:00
Lennart Poettering
8abf529156 Merge pull request #1425 from kaysievers/wip
gpt-auto-generator: check fstab for /boot entries
2015-09-30 22:35:58 +02:00
Lennart Poettering
32c6d387bf Merge pull request #1422 from keszybz/sd-daemon-mq-badf
sd-daemon: fix return value for sd_is_mq
2015-09-30 22:33:50 +02:00
Lennart Poettering
23a749f285 Merge pull request #1419 from keszybz/shell-completion
Shell completion tweaks
2015-09-30 22:32:09 +02:00
Lennart Poettering
5c22925a57 core: make sure we expose the empty string when we detect no virtualization
On the bus, stick to exposing the empty string as "no virtualization",
instead of none.

Fixes #1423
2015-09-30 22:26:17 +02:00
Lennart Poettering
e53fc357a9 tree-wide: remove a number of invocations of strerror() and replace by %m
Let's clean up our tree a bit, and reduce invocations of the
thread-unsafe strerror() by replacing it with printf()'s %m specifier.
2015-09-30 22:26:16 +02:00
Lennart Poettering
618234a525 basic: split out cpu set specific APIs into cpu-set-util.[ch] 2015-09-30 22:26:16 +02:00
Lennart Poettering
94d75d6423 conf-parser: make use of DEFINE_PARSER macro to parse mode_t
Let's unify more code.

Also, rework the macro to accept a trailing semicolon, to make the code
prettier.
2015-09-30 22:26:16 +02:00
Lennart Poettering
e5aa2f71b7 util: there cannot be trailing garbage when parsing cpu sets
extract_first() already skips trailing whitespace, hence no reason to
explicitly check for it.
2015-09-30 22:26:16 +02:00
Lennart Poettering
765d143b5f util: rename parse_cpu_set() to parse_cpu_set_and_warn()
It's pretty untypical for our parsing functions to log on their own.
Clarify in the name that this one does.
2015-09-30 22:26:16 +02:00
Lennart Poettering
0e05ee044a log: move log_invalid_utf8() to log.h
Also, make sure it follows the same scheme as log_syntax() does in its
behaviour.
2015-09-30 22:26:16 +02:00
Lennart Poettering
12ca818ffd tree-wide: clean up log_syntax() usage
- Rely everywhere that we use abs() on the error code passed in anyway,
  thus don't need to explicitly negate what we pass in

- Never attach synthetic error number information to log messages. Only
  log about errors we *receive* with the error number we got there,
  don't log any synthetic error, that don#t even propagate, but just eat
  up.

- Be more careful with attaching exactly the error we get, instead of
  errno or unrelated errors randomly.

- Fix one occasion where the error number and line number got swapped.

- Make sure we never tape over OOM issues, or inability to resolve
  specifiers
2015-09-30 22:26:16 +02:00
Lennart Poettering
6ed796c827 Merge pull request #1424 from evverx/journalctl-rotate
journalctl: add --rotate option
2015-09-30 22:25:36 +02:00
Kay Sievers
0b6b6787e3 gpt-auto-generator: check fstab for /boot entries
We need to prevent the creation of the gpt automount unit, which will not
get overridden by the fstab mount unit.

https://github.com/systemd/systemd/issues/1378
2015-09-30 22:24:52 +02:00
Evgeny Vereshchagin
b92eb84cc8 man: journalctl: add info about --rotate 2015-09-30 23:02:58 +03:00
Evgeny Vereshchagin
0c66ffd8b9 shell-completion: journalctl: add --rotate 2015-09-30 22:58:05 +03:00
Evgeny Vereshchagin
e3fdfb491f journalctl: add --rotate option
shortcut for `systemctl kill --kill-who main --signal SIGUSR2 systemd-journald`
2015-09-30 22:54:58 +03:00
Zbigniew Jędrzejewski-Szmek
0260d1d542 sd-daemon: fix sd_is_mq for non-mq fds
mq_getattr returns -1/EBADF for file descriptors which are not mq.
But we should return 0 in this case.

We first check that fd is a valid fd, so we can assume that if
mq_getattr returns EBADF, it is simply a non-mq fd. There is a slight
race, but there doesn't seem to be a nice way to fix it.
2015-09-30 14:23:13 -04:00
Daniel Mack
234ae00903 Merge pull request #1421 from keszybz/formatting-fixes
logind: avoid a dot before parenthesis
2015-09-30 18:40:57 +02:00
Daniel Mack
75ec4439ea Merge pull request #1420 from keszybz/doc-updates
Doc updates
2015-09-30 18:37:18 +02:00
Zbigniew Jędrzejewski-Szmek
7bbb5359c0 systemctl: do not set variable to be immediately overwritten 2015-09-30 12:33:31 -04:00
Zbigniew Jędrzejewski-Szmek
6fd5517b11 NEWS: typos 2015-09-30 12:30:30 -04:00
Zbigniew Jędrzejewski-Szmek
9f4092e270 man: update description of exit.target
exit.target is now used for both system and user sessions,
so remove "on user service manager exit". Also reword that
paragraph: services will be killed before the manager exits,
even if they do not conflict with shutdown target, but we
recommend that they conflict with shutdown target so that
systemd schedules them to be stopped immediately when starting
to exit.

In the first paragraph, containers should be mentioned last,
and the more general systems first.
2015-09-30 12:30:30 -04:00
Zbigniew Jędrzejewski-Szmek
f868cb58c1 logind: avoid a dot before parenthesis
systemd-logind[27]: System is rebooting. (Applied kernel updates.)

is changed to

systemd-logind[27]: System is rebooting (Applied kernel updates).

Users should not add a dot in the sentence in --message, i.e. the correct usage is now:
$ systemctl reboot --message "Applied kernel updates"
2015-09-30 12:20:01 -04:00
Zbigniew Jędrzejewski-Szmek
3fd96cb3c0 man: add link to kernel docs for net_cls 2015-09-30 12:14:23 -04:00
Zbigniew Jędrzejewski-Szmek
2206531140 man: use "=" when referring to configuration file settings
This convention is almost universal in systemd man pages, and makes
it easier to visually parse the docs.

Also fix some markup along the way.
2015-09-30 12:14:22 -04:00
Zbigniew Jędrzejewski-Szmek
81eb21b991 man: add link to functionfs docs
Also reword some ungainly grammar constructs.
2015-09-30 12:14:22 -04:00
Daniel Mack
a19c7a4a4b Merge pull request #1415 from aakoskin/bootchart-v2
[v2] bootchart: don't fail if "model name" is missing from cpuinfo
2015-09-30 16:35:49 +02:00
Daniel Mack
6e83375808 Merge pull request #1418 from poettering/base-fs
base-fs: consider inability to create /root non-fatal
2015-09-30 16:01:42 +02:00
Daniel Mack
1115d41706 Merge pull request #1417 from poettering/nspawn-and-more
Various fixes, primarily for nspawn, but other stuff too
2015-09-30 15:55:26 +02:00
Lennart Poettering
6404ecc8a2 base-fs: consider inability to create /root non-fatal
Fixes #1414
2015-09-30 15:52:19 +02:00
Lennart Poettering
6b68a4442e Merge pull request #1394 from steelman/fsck-force-reboot
fsck: start reboot.target irreversibly
2015-09-30 15:39:29 +02:00
Lennart Poettering
2ca2a91cf1 analyze: add new set-log-target subcommand
We already have the property writable, hence let's add a command to set
it.
2015-09-30 15:25:23 +02:00
Lennart Poettering
737af7347c log: properly return -EINVAL from log_set_max_level_from_string()
If we just return the value we got from log_level_from_string() on
failure we'll return -1, which is not a proper error code.

log_set_target_from_string() did get this right already, hence let's fix
this here too.
2015-09-30 15:25:23 +02:00
Lennart Poettering
d8fc6a000f nspawn: mount /sys as tmpfs, and then mount only select subdirs of the real sysfs below it
This way we can hide things like /sys/firmware or /sys/hypervisor from
the container, while keeping the device tree around.

While this is a security benefit in itself it also allows us to fix
issue #1277.

Previously we'd mount /sys before creating the user namespace, in order
to be able to mount /sys/fs/cgroup/* beneath it (which resides in it),
which we can only mount outside of the user namespace. To ensure that
the user namespace owns the network namespace we'd set up the network
namespace at the same time as the user namespace. Thus, we'd still see
the /sys/class/net/ from the originating network namespace, even though
we are in our own network namespace now. With this patch, /sys is
mounted before transitioning into the user namespace as tmpfs, so that
we can also mount /sys/fs/cgroup/* into it this early. The directories
such as /sys/class/ are then later added in from the real sysfs from
inside the network and user namespace so that they actually show whatis
available in it.

Fixes #1277
2015-09-30 15:19:33 +02:00
Aaro Koskinen
f2d28e80bc bootchart: use get_proc_field and PROC_CPUINFO_MODEL
Use get_proc_field and PROC_CPUINFO_MODEL to get the CPU type. Also don't
fail if it missing, instead restore the old behaviour and print "Unknown".

Fixes the following error seen with v225 on powerpc:

	Unable to read module name from cpuinfo.
	Error generating svg file: No such file or directory
2015-09-30 15:57:55 +03:00
Aaro Koskinen
8cf3a4a3c5 architecture.h: define PROC_CPUINFO_MODEL
Define PROC_CPUINFO_MODEL to indicate the CPU model field in /proc/cpuinfo.
2015-09-30 15:57:55 +03:00
Aaro Koskinen
c4cd1d4d93 fileio: make get_status_field() more generic
All users of get_status_field() expect the field pattern to occur in
the beginning of a line, and the delimiter is ':'.

Hardcode this into the function, and also skip any whitespace before ':'
to support fields in files like /proc/cpuinfo. Add support for returning
the full field value (currently stops on first whitespace).

Rename the function so it's easier to ensure all callers switch to new
semantics.
2015-09-30 15:57:55 +03:00
Daniel Mack
5e6ad75f25 fix typos in NEWS 2015-09-30 14:03:14 +02:00
Lennart Poettering
403af78c80 nspawn: fix user namespace support
We didn#t actually pass ownership of /run to the UID in the container
since some releases, let's fix that.
2015-09-30 12:48:17 +02:00
Daniel Mack
b5a684e3a1 update NEWS 2015-09-30 12:46:00 +02:00
Daniel Mack
21d86c613d update NEWS 2015-09-30 12:40:44 +02:00
Daniel Mack
de896126ea Add Coccinelle patch for strempty() usage 2015-09-30 12:24:16 +02:00
Lennart Poettering
db3b1dedb2 nspawn: order includes 2015-09-30 12:24:06 +02:00
Lennart Poettering
ee30f6ac32 nspawn: make sure mount_legacy_cgroup_hierarchy() can deal with NULL root directories 2015-09-30 12:23:33 +02:00
Lennart Poettering
eb7ec83860 update TODO 2015-09-30 12:23:33 +02:00
Lennart Poettering
a4420f7b8e systemctl: when reading legacy -t argument for shutdown, don't drop following parameter
We currently completely ignore the following parameter, but we really
should not, as that is actually the time to shut down on.
2015-09-30 12:23:33 +02:00
Lennart Poettering
45519fd630 systemctl: various modernizations 2015-09-30 12:23:32 +02:00
Lennart Poettering
68382f22d7 Merge pull request #1412 from zonque/strempty
tree-wide: use strempty() where possible
2015-09-30 12:00:46 +02:00