Commit Graph

2550 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek b920500ef1 Merge pull request #3190 from poettering/logind-fixes 2016-05-05 20:28:23 -04:00
Lennart Poettering c5a11ae268 logind: enforce a limit on inhibitors we hand out
For similar reasons as the recent addition of a limit on sessions.

Note that we don't enforce a limit on inhibitors per-user currently, but
there's an implicit one, since each inhibitor takes up one fd, and fds are
limited via RLIMIT_NOFILE, and the limit on the number of processes per user.
2016-05-05 22:50:09 +02:00
Lennart Poettering 183e073842 logind: enforce a limit on current user sessions
We really should put limits on all resources we manage, hence add one to the
number of concurrent sessions, too. This was previously unbounded, hence set a
relatively high limit of 8K by default.

Note that most PAM setups will actually invoke pam_systemd prefixed with "-",
so that the return code of pam_systemd is ignored, and the login attempt
succeeds anyway. On systems like this the session will be created but is not
tracked by systemd.
2016-05-05 22:50:09 +02:00
Lennart Poettering 1f15ce2846 core: change default trigger limits for socket units
Let's lower the default values a bit, and pick different defaults for
Accept=yes and Accept=no sockets.

Fixes: #3167
2016-05-05 22:34:47 +02:00
Lennart Poettering 5119d304ff Merge pull request #3156 from keszybz/duid-settings
Rework DUID setting
2016-05-04 11:31:59 +02:00
Lennart Poettering 1ed7ebcfca Merge pull request #3170 from poettering/v230-preparation-fixes
make virtualization detection quieter, rework unit start limit logic, detect unit file drop-in changes correctly, fix autofs state propagation
2016-05-04 10:46:13 +02:00
Susant Sahani b5834a0b38 networkd: Add support to configure IPv6 preferred lifetime (#3102)
Closes #2166.

We only allow 0, infinity and forever.
infinity and forever is same.
2016-05-03 15:54:26 -04:00
Zbigniew Jędrzejewski-Szmek 6e2d0795b3 Merge pull request #3132 from ssahani/route-table
networkd: add support to set route table
2016-05-03 15:50:21 -04:00
Susant Sahani c953b24c65 networkd: add support to set route table
networkd: add support to set route table
1. add support to configure the table id.
   if id is less than 256 we can fit this in the header of route as
   netlink property is a char. But in kernel this proepty is a
   unsigned 32. Hence if greater that 256 add this as RTA_TABLE
attribute.

2. we are not setting the address family now. Now set this property.
2016-05-03 23:18:21 +05:30
Zbigniew Jędrzejewski-Szmek e2e08e77cc man: add a description of DUIDType and DUIDRawData
This is essentially a revert of f38e0cce75 (which
removed the documentation of DUIDType on purpose). The description is heavily
updated for the new semantics.

This addresses #3127 § 4.
2016-05-03 12:26:43 -04:00
Zbigniew Jędrzejewski-Szmek 23caf9baf2 man: s/similar/similarly/ 2016-05-03 12:26:43 -04:00
Evgeny Vereshchagin db985064b6 man: rename TriggerLimitIntervalBurst to TriggerLimitBurst (#3181)
[/etc/systemd/system/test.socket:2] Unknown lvalue 'TriggerLimitIntervalBurst' in section 'Socket'

Follow-up for 8b26cdbd2a
2016-05-03 11:33:38 +02:00
Zbigniew Jędrzejewski-Szmek 8ad54a0182 Merge pull request #3153 from poettering/async-clone
machined: make "clone" asynchronous, and support copy-based fall-back
2016-05-02 13:56:07 -04:00
Lennart Poettering 072993504e core: move enforcement of the start limit into per-unit-type code again
Let's move the enforcement of the per-unit start limit from unit.c into the
type-specific files again. For unit types that know a concept of "result" codes
this allows us to hook up the start limit condition to it with an explicit
result code. Also, this makes sure that the state checks in clal like
service_start() may be done before the start limit is checked, as the start
limit really should be checked last, right before everything has been verified
to be in order.

The generic start limit logic is left in unit.c, but the invocation of it is
moved into the per-type files, in the various xyz_start() functions, so that
they may place the check at the right location.

Note that this change drops the enforcement entirely from device, slice, target
and scope units, since these unit types generally may not fail activation, or
may only be activated a single time. This is also documented now.

Note that restores the "start-limit-hit" result code that existed before
6bf0f408e4 already in the service code. However,
it's not introduced for all units that have a result code concept.

Fixes #3166.
2016-05-02 13:08:00 +02:00
Lennart Poettering d13febb1e0 man: slightly extend the machinectl clone documentation 2016-05-02 11:17:07 +02:00
Zbigniew Jędrzejewski-Szmek bc1d8669b8 Merge pull request #3152 from poettering/aliasfix
Refuse aliases to non-aliasable units in more places

Fixes #2730.
2016-04-30 18:00:46 -04:00
Zbigniew Jędrzejewski-Szmek 26ccc1d087 Merge pull request #3151 from keszybz/pr3149-2
Assorted fixes #3149 + one commit tacked on top
2016-04-29 14:27:23 -04:00
Lennart Poettering f4bf8d2f45 man: document that some unit types do not support unit aliases via symlinks 2016-04-29 18:06:12 +02:00
Lennart Poettering 2985700185 core: make parsing of RLIMIT_NICE aware of actual nice levels 2016-04-29 16:27:49 +02:00
Lennart Poettering f0367da7d1 core: rename StartLimitInterval= to StartLimitIntervalSec=
We generally follow the rule that for time settings we suffix the setting name
with "Sec" to indicate the default unit if none is specified. The only
exception was the rate limiting interval settings. Fix this, and keep the old
names for compatibility.

Do the same for journald's RateLimitInterval= setting
2016-04-29 16:27:48 +02:00
Lennart Poettering 7629ec4642 core: move start ratelimiting check after condition checks
With #2564 unit start rate limiting was moved from after the condition checks
are to before they are made, in an attempt to fix #2467. This however resulted
in #2684. However, with a previous commit a concept of per socket unit trigger
rate limiting has been added, to fix #2467 more comprehensively, hence the
start limit can be moved after the condition checks again, thus fixing #2684.

Fixes: #2684
2016-04-29 16:27:48 +02:00
Lennart Poettering 8b26cdbd2a core: introduce activation rate limiting for socket units
This adds two new settings TriggerLimitIntervalSec= and TriggerLimitBurst= that
define a rate limit for activation of socket units. When the limit is hit, the
socket is is put into a failure mode. This is an alternative fix for #2467,
since the original fix resulted in issue #2684.

In a later commit the StartLimitInterval=/StartLimitBurst= rate limiter will be
changed to be applied after any start conditions checks are made. This way,
there are two separate rate limiters enforced: one at triggering time, before
any jobs are queued with this patch, as well as the start limit that is moved
again to be run immediately before the unit is activated. Condition checks are
done in between the two, and thus no longer affect the start limit.
2016-04-29 16:27:48 +02:00
Lennart Poettering 14e2baa369 man: document that RemainAfterExit= doesn't make much sense for repetitive timers
Fixes #3122
2016-04-29 13:37:33 +02:00
Lennart Poettering 076ea6f6d2 networkd: clean up DUID code a bit
Let's move DUID configuration into the [DHCP] section, since it only makes
sense in a DHCP context, and should be close to the configuration of
ClientIdentifier= and suchlike.

This really shouldn't be a section of its own, we don't have any for any of our
other per-protocol specific identifiers...

Follow-up for #2890 #2943
2016-04-29 12:23:34 +02:00
Lennart Poettering dfe85b38d2 man: minor wording fixes
As suggested in:

https://github.com/systemd/systemd/pull/3124#discussion_r61068789
2016-04-29 12:23:34 +02:00
tblume 959718c621 core: set start job timeout from the kernel commandline (#3112)
Add the boot parameter: systemd.default_timeout_start_sec to allow modification
of the default start job timeout at boot time.
2016-04-26 17:10:36 +02:00
Zbigniew Jędrzejewski-Szmek a109d2e204 Merge pull request #3124 from poettering/small-journal-fixes 2016-04-26 09:52:55 -04:00
Zbigniew Jędrzejewski-Szmek 25eb92e14f Revert "smaller journal fixes (#3124)"
This reverts commit 6e3930c40f.

Merge got squashed by mistake.
2016-04-26 09:52:30 -04:00
Lennart Poettering d7fe83bbc2 Merge pull request #3093 from poettering/nspawn-userns-magic
nspawn automatic user namespaces
2016-04-26 14:57:04 +02:00
Lennart Poettering 6e3930c40f smaller journal fixes (#3124)
* sd-journal: detect earlier if we try to read an object from an invalid offset

Specifically, detect early if we try to read from offset 0, i.e. are using
uninitialized offset data.

* journal: when dumping journal contents, react nicer to lines we can't read

If journal files are not cleanly closed it might happen that intermediaery
journal entries cannot be read. Handle this nicely, skip over the unreadable
entries, and log a debug message about it; after all we generally follow the
logic that we try to make the best of corrupted files.

* journal-file: always generate the same error when encountering corrupted files

Let's make sure EBADMSG is the one error we throw when we encounter corrupted
data, so that we can neatly test for it.

* journal-file: when iterating through a partly corruped journal file, treat error like EOF

When we linearly iterate through a corrupted journal file, and we encounter a
read error, don't consider this fatal, but merely as EOF condition (and log
about it).

* journal-file: make seeking in corrupted files work

Previously, when we used a bisection table for seeking through a corrupted
file, and the end of the bisection table was corrupted we'd most likely fail
the entire seek operation. Improve the situation: if we encounter invalid
entries in a bisection table, linearly go backwards until we find a working
entry again.

* man: elaborate on the automatic systemd-journald.socket service dependencies

Fixes: #1603
2016-04-26 14:38:45 +02:00
Lennart Poettering 28c75e2501 man: elaborate on the automatic systemd-journald.socket service dependencies
Fixes: #1603
2016-04-26 12:00:49 +02:00
Lennart Poettering 2aab2fabbd man: document the new by-fd journal calls
Also, remove documentation for sd_journal_open_container() as we consider it
deprecated now.
2016-04-25 19:29:01 +02:00
Lennart Poettering 4706fbaa17 man: don't include history sections in man pages
I am pretty sure we shouldn't carry history sections in man pages, since it's
very hard to keep them correctly updated, the current ones are very
out-of-date, and they tend to make APIs appear unnecessarily complex.
2016-04-25 19:29:01 +02:00
Lennart Poettering ccabee0d64 nspawn: make -U a tiny bit smarter
With this change -U will turn on user namespacing only if the kernel actually
supports it and otherwise gracefully degrade to non-userns mode.
2016-04-25 12:16:02 +02:00
Lennart Poettering d2e5535f9d man: document the new user namespacing options 2016-04-25 12:16:02 +02:00
Evgeny Vereshchagin 07bd0e02ef man: document the default for systemd.timer's Persistent flag (#3099)
Closes #3096
2016-04-22 20:49:47 -04:00
Lennart Poettering b9a049b1fb man: don't claim systemd would connect stdout/stderr of daemons with /dev/null 2016-04-22 16:17:00 +02:00
Lennart Poettering 991e274b61 journalctl: add --no-hostname switch
This suppresses output of the hostname for messages from the local system.

Fixes: #2342
2016-04-22 16:16:59 +02:00
Lennart Poettering bb321ed9a3 journalctl: add output mode where time is shown in seconds since 1st Jan 1970 UTC
aka "UNIX time".

Fixes: #2120
2016-04-22 16:16:59 +02:00
Torstein Husebø 4f25723c14 treewide: fix typos (#3092) 2016-04-22 14:18:05 +02:00
Lennart Poettering fcf008f866 Merge pull request #3084 from keszybz/preset-fixes
Nicer error message is symlinking chokes on an existing file
2016-04-22 10:56:43 +02:00
Zbigniew Jędrzejewski-Szmek ccddd104fc tree-wide: use mdash instead of a two minuses 2016-04-21 23:00:13 -04:00
Zbigniew Jędrzejewski-Szmek fb0c7174e3 man: document size param of sd_journal_add_match
Fixes #1724.
2016-04-21 22:56:44 -04:00
Zbigniew Jędrzejewski-Szmek 39207373dd systemctl,pid1: do not warn about missing install info with "preset"
When "preset" was executed for a unit without install info, we'd warn similarly
as for "enable" and "disable". But "preset" is usually called for all units,
because the preset files are provided by the distribution, and the units are under
control of individual programs, and it's reasonable to call "preset" for all units
rather then try to do it only for the ones that can be installed.
We also don't warn about missing info for "preset-all". Thus it seems reasonable
to silently ignore units w/o install info when presetting.

(In addition, when more than one unit was specified, we'd issue the warning
only if none of them had install info. But this is probably something to fix
for enable/disable too.)
2016-04-21 20:04:21 -04:00
Lennart Poettering 52b9b66b7d Merge pull request #3005 from keszybz/kill-user-proceses
Kill user session scope by default
2016-04-21 12:29:36 +02:00
Zbigniew Jędrzejewski-Szmek 921f831d3e logind: make KillOnlyUsers override KillUserProcesses
Instead of KillOnlyUsers being a filter for KillUserProcesses, it can now be
used to specify users to kill, independently of the KillUserProcesses
setting. Having the settings orthogonal seems to make more sense. It also
makes KillOnlyUsers symmetrical to KillExcludeUsers.
2016-04-21 00:21:33 -04:00
Zbigniew Jędrzejewski-Szmek 97e5530cf2 logind: flip KillUserProcesses to on by default
This ensures that users sessions are properly cleaned up after.
The admin can still enable or disable linger for specific users to allow
them to run processes after they log out. Doing that through the user
session is much cleaner and provides better control.

dbus daemon can now be run in the user session (with --enable-user-session,
added in 1.10.2), and most distributions opted to pick this configuration.
In the normal case it makes a lot of sense to kill remaining processes.
The exception is stuff like screen and tmux. But it's easy enough to
work around, a simple example was added to the man page in previous
commit. In the long run those services should integrate with the systemd
users session on their own.

https://bugs.freedesktop.org/show_bug.cgi?id=94508
https://github.com/systemd/systemd/issues/2900
2016-04-21 00:21:32 -04:00
Zbigniew Jędrzejewski-Szmek 65eb37f8fc man: expand description of lingering and KillUserProcesses setting
The description in the man page was wrong, KillUserProcesses does
not kill all processes of the user. Describe what the setting
does, and also add links between the relavant sections of the
manual.

Also, add an extensive example which shows how to launch screen
in the background.
2016-04-21 00:21:32 -04:00
Zbigniew Jędrzejewski-Szmek 4eac7f5ccc man: reformat examples using <example> 2016-04-21 00:21:32 -04:00
Susant Sahani 439689c6ec networkd: bump MTU to 1280 for interfaces which have IPv6 enabled (#3077)
IPv6 protocol requires a minimum MTU of 1280 bytes on the interface.
This fixes #3046.

Introduce helper link_ipv6_enabled() to figure out whether IPV6 is enabled.
Introduce network_has_static_ipv6_addresses() to find out if any static
ipv6 address configured.
If IPv6 is not configured on any interface that is SLAAC, DHCPv6 and static
IPv6 addresses not configured, then IPv6 will be automatically disabled for that
interface, that is we write "1" to /proc/sys/net/ipv6/conf//disable_ipv6.
2016-04-20 20:34:13 -04:00