Commit graph

22505 commits

Author SHA1 Message Date
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 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
Daniel Mack 5cfee41459 tree-wide: use strempty() where possible
Also add a Coccinell patch to detect such locations in the future.
2015-09-30 11:41:03 +02:00
Daniel Mack 2ea69f8d5e Merge pull request #1408 from poettering/systemctl-and-more
Systemctl and more
2015-09-29 22:10:40 +02:00
Lennart Poettering 7f96539d45 systemctl: when a shutdown is scheduled, always go via logind 2015-09-29 21:55:53 +02:00
Lennart Poettering 19578bb26b systemctl: minor modernizations 2015-09-29 21:55:53 +02:00
Lennart Poettering e449de8777 systemctl: port verb dispatching to generic verbs.[ch] code
Let's parse the command line the same way in our various tools.
2015-09-29 21:55:53 +02:00
Lennart Poettering 7089051f67 systemctl: prefer shutting down through logind even as root
Otherwise, wall messages will not be generated for root.
2015-09-29 21:55:53 +02:00
Lennart Poettering 57ab90065d systemctl: split out code invoking SetExitCode() into function of its own 2015-09-29 21:55:53 +02:00
Lennart Poettering bcbd61db9f pager: minor modernizations 2015-09-29 21:55:53 +02:00
Lennart Poettering 4057e12315 systemctl: don't assert on the arguments array unnecessarily
In most verbs it's fine to treat the arguments array being NULL is empty
array, hence do so.
2015-09-29 21:55:53 +02:00
Lennart Poettering 14b316ebf8 systemctl: make use of strv_skip() where appropriate 2015-09-29 21:55:53 +02:00
Lennart Poettering 691395d84c systemctl: make use of log_error_errno() where we can
Also adds a couple of "return" statements, where they are missing.
2015-09-29 21:55:52 +02:00
Lennart Poettering 4fbd7192c5 systemctl: rework how we connect to busses
Sometimes we have to connect to the system manager directly (early boot,
initrd, late boot, ...), sometimes through the system bus (unprivileged,
remote, logind, ...). Instead of guessing in advance, which kind of
connection we require (and sometimes guessing incorrectly), let's make
sure each time we need  bus connection we request the right bus
explicitly.

This way, we set up exactly the bus connections require, never guess
incorrectly, and do so only immediately when necessary.

As effect this reworks avoid_bus() into install_client_side(), since
that's all it determines now: whether to install unit files client-side
or server-side (i.e. in PID 1).
2015-09-29 21:55:52 +02:00
Lennart Poettering 8c8da0e0cb core: add a "Requires=" dependency between units and the slices they are located in
We place the processes we fork off in the cgroup anyway, and we probably
shouldn't be able to get that far if we couldn't set up the slice due to
resource problems or unmet conditions. Hence upgrade the dependency
between units and the slices they are located in from Wants= to
Requires=.
2015-09-29 21:55:52 +02:00
Lennart Poettering f0792aae43 update-utmp: flush and close the bus used for connections after use 2015-09-29 21:55:52 +02:00
Lennart Poettering f0960da0fa update-utmp: minor modernizations 2015-09-29 21:55:52 +02:00
Lennart Poettering 266f3e269d bus-util: rename bus_open_transport() to bus_connect_transport()
In sd-bus, the sd_bus_open_xyz() family of calls allocates a new bus,
while sd_bus_default_xyz() family tries to reuse the thread's default
bus. bus_open_transport() sometimes internally uses the former,
sometimes the latter family, but suggests it only calls the former via
its name. Hence, let's avoid this confusion, and generically rename the
call to bus_connect_transport().

Similar for all related calls.

And while we are at it, also change cgls + cgtop to do direct systemd
connections where possible, since all they do is talk to systemd itself.
2015-09-29 21:55:52 +02:00
Lennart Poettering 65359589c2 pager: minor simplification 2015-09-29 21:55:52 +02:00
Lennart Poettering 2cc7b0a25f systemctl: rename parse_time_spec() to parse_shutdown_time_spec()
Let's clarify that this function is specific to shutdown time
specifications, nothing else.
2015-09-29 21:55:52 +02:00
Lennart Poettering eca830bee9 systemctl: conditionalize /dev/initctl fallback on HAVE_SYSV_COMPAT 2015-09-29 21:55:52 +02:00
Lennart Poettering 172d7abfea systemctl: allocate arg_wall only on the heap
Previously, we'd allocate it sometimes from the heap, but otherwise let
it point directly int argv[]. Let's clean this up, so that we know
exactly how to release its resources, and do so at the end.
2015-09-29 21:55:52 +02:00