Commit graph

15913 commits

Author SHA1 Message Date
Lennart Poettering ceab9e2dee Merge pull request #3900 from keszybz/fix-3607
Fix 3607
2016-08-05 17:03:09 +02:00
Zbigniew Jędrzejewski-Szmek 80a58668d9 socket: add helper function to remove code duplication 2016-08-05 08:24:00 -04:00
Zbigniew Jędrzejewski-Szmek ea8f50f808 core/socket: include remote address in the message when dropping connection
Without the address the message is not very useful.

Aug 04 23:52:21 rawhide systemd[1]: testlimit.socket: Too many incoming connections (4) from source ::1, dropping connection.
2016-08-05 08:16:31 -04:00
Zbigniew Jędrzejewski-Szmek 3ebcd323bd systemd: do not serialize peer, bump count when deserializing socket instead 2016-08-05 08:16:31 -04:00
Zbigniew Jędrzejewski-Szmek 9dfb64f87d core/service: serialize and deserialize accept_socket
This fixes an issue during reexec — the count of connections would be lost:

[zbyszek@fedora-rawhide ~]$ systemctl status testlimit.socket | grep Connected
 Accepted: 1; Connected: 1

[zbyszek@fedora-rawhide ~]$ sudo systemctl daemon-reexec
[zbyszek@fedora-rawhide ~]$ systemctl status testlimit.socket | grep Connected
 Accepted: 1; Connected: 0

With the patch, Connected count is preserved.

Also add "Accept Socket" to the dump output for services.
2016-08-05 08:16:31 -04:00
Zbigniew Jędrzejewski-Szmek 166cf510c2 core/socket: rework SocketPeer refcounting
Make functions and definitions that don't need to be shared local to
socket.c.
2016-08-05 08:12:31 -04:00
Lennart Poettering 41bf0590cc util-lib: unify parsing of nice level values
This adds parse_nice() that parses a nice level and ensures it is in the right
range, via a new nice_is_valid() helper. It then ports over a number of users
to this.

No functional changes.
2016-08-05 11:18:32 +02:00
Zbigniew Jędrzejewski-Szmek 1ed1f50f82 networkd: do not set NOARP unconditionally (#3891)
Fixes #3890.
2016-08-05 10:37:10 +02:00
Vito Caputo 82b103a7ce fileio: fix MIN/MAX mixup (#3896)
The intention is to clamp the value to READ_FULL_BYTES_MAX, which
would be the minimum of the two.
2016-08-05 00:09:23 -04:00
Vito Caputo 2604646c05 journal-remote: remove unnecessary gnutls includes (#3895)
journal-(gatewayd,remote).c don't actually utilize libgnutls even when
HAVE_GNUTLS is defined.
2016-08-05 00:05:34 -04:00
Zbigniew Jędrzejewski-Szmek 9a73653c3e systemd: convert peers_by_address to a set 2016-08-04 23:53:07 -04:00
Zbigniew Jędrzejewski-Szmek 163f561e2a basic/set: remove some spurious spaces 2016-08-04 23:53:07 -04:00
0xAX 13811bf909 main: use pager for --dump-configuration-items (#3894) 2016-08-04 22:52:24 +02:00
Vito Caputo c2d11a6302 fileio: fix read_full_stream() bugs (#3887)
read_full_stream() _always_ allocated twice the memory needed, due to
only breaking the realloc() && fread() loop when fread() returned 0,
requiring another iteration and exponentially enlarged buffer just to
discover the EOF condition.

This also caused file sizes >2MiB && <= 4MiB to erroneously be treated
as E2BIG, due to the inappropriately doubled buffer size exceeding
4*1024*1024.

Also made the 4*1024*1024 magic number a READ_FULL_BYTES_MAX constant.
2016-08-04 22:52:02 +02:00
Tobias Jungel ffff9abe1d networkd: apply bridge vlan configuration correct
bridge vlan configuration was applied even if it wasn't configured.

fixes #3876
2016-08-04 17:14:18 +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 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
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
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
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
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
Steve Muir 4dd4cb8fe4 tests: don't run private device tests if running in a container
Private devices don't exist when running in a container, so skip the related
tests.
2016-07-29 14:30:46 -07:00