Commit graph

26652 commits

Author SHA1 Message Date
Lennart Poettering d47f681b28 update TODO 2016-08-04 23:08:05 +02:00
Lennart Poettering 2129011e92 nss-systemd: resolve root/nobody statically
Let's extend nss-systemd to also synthesize user/group entries for the
UIDs/GIDs 0 and 65534 which have special kernel meaning. Given that nss-systemd
is listed in /etc/nsswitch.conf only very late any explicit listing in
/etc/passwd or /etc/group takes precedence.

This functionality is useful in minimal container-like setups that lack
/etc/passwd files (or only have incompletely populated ones).
2016-08-04 23:08:05 +02:00
Lennart Poettering 136dc4c435 core: set $SERVICE_RESULT, $EXIT_CODE and $EXIT_STATUS in ExecStop=/ExecStopPost= commands
This should simplify monitoring tools for services, by passing the most basic
information about service result/exit information via environment variables,
thus making it unnecessary to retrieve them explicitly via the bus.
2016-08-04 23:08:05 +02:00
Lennart Poettering af9d16e10a core: use the correct APIs to determine whether a dual timestamp is initialized 2016-08-04 16:27:07 +02:00
Lennart Poettering 9c1a61adba core: move masking of chroot/permission masking into service_spawn()
Let's fix up the flags fields in service_spawn() rather than its callers, in
order to simplify things a bit.
2016-08-04 16:27:07 +02:00
Lennart Poettering c39f1ce24d core: turn various execution flags into a proper flags parameter
The ExecParameters structure contains a number of bit-flags, that were so far
exposed as bool:1, change this to a proper, single binary bit flag field. This
makes things a bit more expressive, and is helpful as we add more flags, since
these booleans are passed around in various callers, for example
service_spawn(), whose signature can be made much shorter now.

Not all bit booleans from ExecParameters are moved into the flags field for
now, but this can be added later.
2016-08-04 16:27:07 +02:00
Lennart Poettering 992e8f224b util-lib: rework /tmp and /var/tmp handling code
Beef up the existing var_tmp() call, rename it to var_tmp_dir() and add a
matching tmp_dir() call (the former looks for the place for /var/tmp, the
latter for /tmp).

Both calls check $TMPDIR, $TEMP, $TMP, following the algorithm Python3 uses.
All dirs are validated before use. secure_getenv() is used in order to limite
exposure in suid binaries.

This also ports a couple of users over to these new APIs.

The var_tmp() return parameter is changed from an allocated buffer the caller
will own to a const string either pointing into environ[], or into a static
const buffer. Given that environ[] is mostly considered constant (and this is
exposed in the very well-known getenv() call), this should be OK behaviour and
allows us to avoid memory allocations in most cases.

Note that $TMPDIR and friends override both /var/tmp and /tmp usage if set.
2016-08-04 16:27:07 +02:00
Lennart Poettering eb18df724b Merge pull request #2471 from michaelolbrich/transient-mounts
allow transient mounts and automounts
2016-08-04 16:16:04 +02:00
Lennart Poettering 07a1734a13 Merge pull request #3885 from keszybz/help-output
Update help for "short-full" and shorten to 80 columns
2016-08-04 16:11:38 +02:00
Susant Sahani 99d2baa2ca networkd: add support to configure NOARP/ARP for interface (#3854)
https://lists.freedesktop.org/archives/systemd-devel/2016-August/037268.html
2016-08-04 10:00:58 -04:00
Susant Sahani 3104883ddc networkd: remove route if carrier is lost (#3831)
Fixes #3669.
2016-08-04 09:56:39 -04:00
Jonathan Boulle 1898a1a5c3 src/test: add tests for parse_percent_unbounded (#3889) 2016-08-04 09:54:10 -04:00
Zbigniew Jędrzejewski-Szmek e9fbae3f68 man: describe list-dependencies --all
Meaning of --all was mentioned in list-dependencies description, but the this
effect should also be mentioned in the description of the option itself.
2016-08-04 09:03:43 -04:00
Zbigniew Jędrzejewski-Szmek 90b4a64d77 nspawn,resolve: short --help output to fit within 80 columns
make dist-check-help FTW!
2016-08-04 09:03:42 -04:00
Zbigniew Jędrzejewski-Szmek 584c6e7050 journalctl,systemctl: add "short-full", "short-unix" mode to --help 2016-08-04 09:03:31 -04:00
David Michael 5124866d73 util-lib: add parse_percent_unbounded() for percentages over 100% (#3886)
This permits CPUQuota to accept greater values as documented.
2016-08-04 13:09:54 +02:00
Zbigniew Jędrzejewski-Szmek 19c8201744 Merge pull request #3820 from poettering/nspawn-resolvconf
nspawn resolv.conf handling improvements, and inherit $TERM all the way through nspawn → console login
2016-08-03 20:14:32 -04:00
Peter Hutterer d26d41f36c hwdb: fix hwdb entry for numeric-only Lenovo *40, *50 and *60 series
Commit e5bc3f4fdc matches on e.g. a T440s, but not a T440 (i.e. the one
without a suffix).
2016-08-04 09:57:36 +10:00
Lennart Poettering 29a753df76 journalctl: add new output mode "short-full" (#3880)
This new output mode formats all timestamps using the usual format_timestamp()
call we use pretty much everywhere else. Timestamps formatted this way are some
ways more useful than traditional syslog timestamps as they include weekday,
month and timezone information, while not being much longer. They are also not
locale-dependent. The primary advantage however is that they may be passed
directly to journalctl's --since= and --until= switches as soon as #3869 is
merged.

While we are at it, let's also add "short-unix" to shell completion.
2016-08-03 19:45:07 -04:00
Lennart Poettering 21b3a0fcd1 util-lib: make timestamp generation and parsing reversible (#3869)
This patch improves parsing and generation of timestamps and calendar
specifications in two ways:

- The week day is now always printed in the abbreviated English form, instead
  of the locale's setting. This makes sure we can always parse the week day
  again, even if the locale is changed. Given that we don't follow locale
  settings for printing timestamps in any other way either (for example, we
  always use 24h syntax in order to make uniform parsing possible), it only
  makes sense to also stick to a generic, non-localized form for the timestamp,
  too.

- When parsing a timestamp, the local timezone (in its DST or non-DST name)
  may be specified, in addition to "UTC". Other timezones are still not
  supported however (not because we wouldn't want to, but mostly because libc
  offers no nice API for that). In itself this brings no new features, however
  it ensures that any locally formatted timestamp's timezone is also parsable
  again.

These two changes ensure that the output of format_timestamp() may always be
passed to parse_timestamp() and results in the original input. The related
flavours for usec/UTC also work accordingly. Calendar specifications are
extended in a similar way.

The man page is updated accordingly, in particular this removes the claim that
timestamps systemd prints wouldn't be parsable by systemd. They are now.

The man page previously showed invalid timestamps as examples. This has been
removed, as the man page shouldn't be a unit test, where such negative examples
would be useful. The man page also no longer mentions the names of internal
functions, such as format_timestamp_us() or UNIX error codes such as EINVAL.
2016-08-03 19:04:53 -04:00
Lukáš Nykrýn 7f5da8bd4f systemctl: consider service running only when it is in active or reloading state (#3874)
Otherwise for example services that are failing on start and have Restart=on-failure
and bigger RestartSec systemctl status will return 0.

Fixes: #3864
2016-08-03 17:08:37 +02:00
Lennart Poettering f7b7b3df9e nspawn: if we can't mark the boot ID RO let's fail
It's probably better to be safe here.
2016-08-03 14:52:16 +02:00
Lennart Poettering 7049382803 execute: don't set $SHELL and $HOME for services, if they don't contain interesting data 2016-08-03 14:52:16 +02:00
Lennart Poettering 6af760f3b2 core: inherit TERM from PID 1 for all services started on /dev/console
This way, invoking nspawn from a shell in the best case inherits the TERM
setting all the way down into the login shell spawned in the container.

Fixes: #3697
2016-08-03 14:52:16 +02:00
Lennart Poettering 43992e57e0 core: drop spurious newline 2016-08-03 14:52:16 +02:00
Lennart Poettering a6b5216c7c nspawn: deprecate --share-system support
This removes the --share-system switch: from the documentation, the --help text
as well as the command line parsing. It's an ugly option, given that it kinda
contradicts the whole concept of PID namespaces that nspawn implements. Since
it's barely ever used, let's just deprecate it and remove it from the options.

It might be useful as a debugging option, hence the functionality is kept
around for now, exposed via an undocumented $SYSTEMD_NSPAWN_SHARE_SYSTEM
environment variable.
2016-08-03 14:52:16 +02:00
Lennart Poettering 3539724c26 nspawn: try to bind mount resolved's resolv.conf snippet into the container
This has the benefit that the container can follow the host's DNS server
changes without us having to constantly update the container's resolv.conf
settings.
2016-08-03 14:52:16 +02:00
Lennart Poettering 5e0bb1a628 Merge pull request #3828 from keszybz/drop-systemd-vconsole-setup-service
Update documentation for systemd-vconsole-setup
2016-08-03 14:38:36 +02:00
Peter Hutterer e5bc3f4fdc hwdb: compress the various Lenovo *40, *50 and *60 series (#3877)
Each series has identical hardware, let's use a glob instead of listing them
one by one.
2016-08-03 13:12:37 +02:00
Peter Hutterer d5c3b228f0 hwdb: add ID_INPUT_TRACKBALL as additional identifier (#3872)
Whether a device is a trackball or not is a physical property so we should
store this globally, in one place. The new property must be set in addition to
ID_INPUT_MOUSE, otherwise existing clients won't detect the device.

No actual code changes required, the default match rule is simply checking for
"Trackball" in the name (in a few versions), other entries need to be added
manually.
2016-08-03 12:34:56 +02:00
Susant Sahani 9d56542764 socket: add support to control no. of connections from one source (#3607)
Introduce MaxConnectionsPerSource= that is number of concurrent
connections allowed per IP.

RFE: 1939
2016-08-02 13:48:23 -04:00
Zbigniew Jędrzejewski-Szmek 87edd2b116 Merge pull request #3858 from jfilak/coredump-containers-v2
Coredump: save information useful for debuging crashes in containers - v2
2016-08-02 13:38:00 -04:00
Jan Synacek 1259186355 test: fix test-execute personality tests on ppc64 and aarch64 (#3825) 2016-08-02 16:22:56 +02:00
Zbigniew Jędrzejewski-Szmek cce9c80af3 gitignore: libsystemd-journal.pc is no more (#3863)
…since 4de282cf93.
2016-08-02 16:04:39 +02:00
Jakub Filak 7ed03ce69e coredump: save process container parent cmdline
Process container parent is the process used to start processes with a new
user namespace - e.g systemd-nspawn, runc, lxc, etc.

There is not standard way how to find such a process - or I do not know
about it - hence I have decided to find the first process in the parent
process hierarchy with a different mount namespace and different
/proc/self/root's inode.

I have decided for this criteria because in ABRT we take special care
only if the crashed process runs different code than installed on the
host. Other processes with namespaces different than PID 1's namespaces
are just processes running code shipped by the OS vendor and bug
reporting tools can get information about the provider of the code
without the need to deal with changed root and so on.
2016-08-02 16:01:18 +02:00
Ismo Puustinen 96694e998b main: load Smack policy before IMA policy (#3859)
IMA wiki says: "If the IMA policy contains LSM labels, then the LSM
policy must be loaded prior to the IMA policy." Right now, in case of
Smack, the IMA policy is loaded before the Smack policy. Move the order
around to allow Smack labels to be used in IMA policy.
2016-08-02 08:58:30 -04:00
Martin Pitt 98d2d46876 units: add graphical-session-pre.target user unit (#3848)
This complements graphical-session.target for services which set up the
environment (e. g. dbus-update-activation-environment) and need to run before
the actual graphical session.
2016-08-02 08:56:45 -04:00
tblume 7633f8ef37 systemd-ask-password: make sure directory watch is started before cryptsetup (#3850)
The password directory watch should get ordered before cryptsetup to make sure
that the password for unlocking the crypt device gets prompted.
2016-08-02 08:55:25 -04:00
Jakub Filak d7032b1fcd coredump: save /proc/[pid]/mountinfo
The file contains information one can use to debug processes running
within a container.
2016-08-02 10:00:46 +02:00
0xAX a912ab0474 machinectl: hide legend in a case when no data (#3839)
For this moment machinectl prints legend and count of machines/images/etc.
But in a case when we have no images,machines,etc., there is no sense to
show legend:

~$ machinectl
MACHINE CLASS SERVICE

0 machines listed.

Let's print only 'No machines', 'No images', 'No transfers' in this case.
2016-08-01 11:39:27 -04:00
Leonardo Brondani Schenkel aa0c34279e virt: detect bhyve (FreeBSD hypervisor) (#3840)
The CPUID and DMI vendor strings do not seem to be documented.
Values were found experimentally and by inspecting the source code.
2016-08-01 09:04:49 -04:00
0xAX 494294d6f8 main: get rid of ACTION_DONE (#3849)
the ACTION_DONE was introduced in the 4288f61921 (dbus: automatically
generate and install introspection files ) commit and was used in
systemd --introspect command.

Later 'introspect' command was removed in the ca2871d9b (bus: remove
static introspection file export) commit and have no users anymore.

So we can remove it.
2016-08-01 12:38:25 +02:00
Peter Hutterer ef892eae20 Merge pull request #3817 from dwassenberg/lenovo-trackpoint-speed-fixes
Lenovo trackpoint speed fixes
2016-08-01 13:15:39 +10:00
Zbigniew Jędrzejewski-Szmek 72ccee50d0 man: move description of kernel vconsole.conf overrides to vconsole.conf(5)
They were outdated, and this way it's less likely that they'll get out of sync
again. Anyway, it's easier for the reader to have the kernel and config file
options next to one another.
2016-07-31 22:52:04 -04:00
Zbigniew Jędrzejewski-Szmek aaa709bbaa vconsole-setup: add lots of debug messages
For error messages, make them more meaningful by printing the tty name.

Follow-up for #3742.
2016-07-31 22:49:07 -04:00
Zbigniew Jędrzejewski-Szmek 2d37cd5356 Add enable_disable() helper
In this patch "enabled" and "disabled" is used exclusively, but "enable" and
"disable" forms are need for the following patch.
2016-07-31 22:48:22 -04:00
Zbigniew Jędrzejewski-Szmek ce5fcc695e Merge pull request 3821 from davide125/fix-tests 2016-07-31 22:06:09 -04:00
Mike Gilbert 6d1e2ddd59 test-path-util: check for /lt-test-path-util or /test-path-util (#3841)
Depending on how binutils was configured and the --enable-fast-install
configure option, the test binary might be called either name.

Fixes: https://github.com/systemd/systemd/issues/3838
2016-07-31 21:50:50 -04:00
Tejun Heo cb3e441759 logind: 0% and 100% should be valid for UserTasksMax (#3836)
config_parse_user_tasks_max() was incorrectly accepting percentage value
between 1 and 99.  Update it to accept 0% and 100%.  This brings it in line
with TasksMax handling in systemd.
2016-07-31 21:38:47 -04:00
Zbigniew Jędrzejewski-Szmek 0d5299ef5a Merge pull request #3843 from maxime1986/minor-systemd.resource-control 2016-07-31 21:15:17 -04:00