Commit Graph

25563 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek fb0c7174e3 man: document size param of sd_journal_add_match
Fixes #1724.
2016-04-21 22:56:44 -04:00
Federico 5f390fc01c hwdb: add trust illuminated mouse gxt 152 (#3085) 2016-04-21 16:27:56 -04:00
Calvin Owens 7797fd2470 units: Add "GuessMainPID=no" to compatibility unit for rc-local (#3018)
With the current "Type=forking", systemd tries to guess the PID it
should wait on at reboot (because we have no "PIDFile="). Depending on
how wrong the guess is, we can end up hanging forever at reboot.

Asking it not to do that eliminates the problem.
2016-04-21 19:16:28 +02:00
Susant Sahani 0c241a378d networkd: When link gets dirty mark manager dirty too (#3080)
If we not marking manager dirty when link is dirty then
the state file is not updated. This is a side effect of
issue 2850
setting CriticalConnection=yes

timesyncd NTP servers given by DHCP server are ignored.
2016-04-21 16:08:07 +02: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
Martin Pitt 48062f072c build: fix test-nss.c build failure with --disable-{resolved,myhostname} (#3081)
When building without resolved and/or myhostname, test-nss.c failed to build
with

  src/test/test-nss.c: In function 'main':
  src/test/test-nss.c:417:32: error: 'MODULE1' undeclared (first use in this function)
           NULSTR_FOREACH(module, MODULE1 MODULE2 MODULE3 MODULE4) {
                                ^

Ensure that all MODULEx are always defined, and empty if the module is not
available (so that it will be a no-op in the string concatenation).
2016-04-21 12:13:08 +02:00
Zbigniew Jędrzejewski-Szmek 42fbdf4586 shared/logs-show: fix memleak in add_matches_for_unit 2016-04-21 00:21:33 -04:00
Zbigniew Jędrzejewski-Szmek 26e00f0e6a loginctl: show linger status in user-status
zbyszek (1002)
           Since: Tue 2016-04-12 23:11:46 EDT; 23min ago
           State: active
        Sessions: *3
          Linger: yes
            Unit: user-1002.slice
                  ├─user@1002.service
                  │ └─init.scope
                  │   ├─38 /usr/lib/systemd/systemd --user
                  │   └─39 (sd-pam)
                  └─session-3.scope
                    ├─   31 login -- zbyszek
                    ├─   44 -bash
                    ├─15076 loginctl user-status zbyszek
                    └─15077 less
2016-04-21 00:21:33 -04:00
Zbigniew Jędrzejewski-Szmek 152199f2d7 logind: allow any user to request lingering
We enable lingering for anyone who wants this. It is still disabled by
default to avoid keeping long-running processes accidentally.
Admins might want to customize this policy on multi-user sites.
2016-04-21 00:21:33 -04: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 95365a576f build-sys: add --without-kill-user-processes configure option 2016-04-21 00:21:32 -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
Zbigniew Jędrzejewski-Szmek a2ed707712 logind: reload config on SIGHUP
v2:
- fix setting of kill_user_processes and
  *_ignore_inhibited settings
2016-04-21 00:20:56 -04:00
Zbigniew Jędrzejewski-Szmek c8a806f2c0 core: prefix selinux messages with "selinux: "
SELinux outputs semi-random messages like "Unknown permission start for class
system", and the user has to dig into message metadata to find out where
they are comming from. Add a prefix to give a hint.
2016-04-21 00:12:29 -04:00
Susant Sahani 964b26fe21 networkd: respect DHCP UseRoutes option (#3075)
This fixes #2282.
2016-04-20 20:36:33 -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
Lennart Poettering f15ab461ec Merge pull request #3074 from keszybz/tmpfiles
systemd-tmpfiles improvements, nspawn -E, honouring $TERM in pid1
2016-04-20 20:26:34 +02:00
Zbigniew Jędrzejewski-Szmek df8dee85da tmpfiles: add new 'e' action which cleans up a dir without creating it
I wanted to add a config line that would empty a directory
without creating it if doesn't exist. Existing actions don't allow
this.

v2: properly add 'e' to needs_glob() and takes_ownership()
2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek 4b743d679b man: try to explain different actions in tmpfiles a bit better
- do not suggest that vendor configuration files should be in
  /etc, use /usr/lib/tmpfiles.d instead
- split the first example, because the text talked about "needing
  two directories", but then a smack attribute was also set, and
  on a different path, which looked like a typo. Replace that
  with the example from original patch [1] which added 't'.
- fix the example for /var/tmp/abrt. The 'x' line was redundant,
  because /var/tmp/abrt/* is already filtered because "d /var/tmp/abrt"
  overrides "d /var/tmp".

[1] http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/25051
2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek 022ffe4cca tmpfiles: shorten some long error messages
Also don't print %m when the message already contains all the info.
2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek f7ac1ed2ca tmpfiles: interpret "-" as stdin 2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek d5ca5e1324 pid1: disable color output when TERM=dumb
This changes the behaviour of pid1 in the following ways:
- obviously $TERM is now checked,
- $SYSTEMD_COLORS is now honoured too, before only SYSTEMD_LOG_COLORS was checked,
- isatty() is run on stdout not stderr.

As requested in #3025.
2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek 4d46e5db15 machinectl: add -E as alias for --setenv 2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek b5911366d0 run: add -E as alias for --setenv 2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek a5f1cb3bad nspawn: add -E as alias for --setenv
v2:
- "=" is required, so remove the <optional> tags that v1 added
2016-04-20 09:00:39 -04:00
Zbigniew Jędrzejewski-Szmek ae5b395887 basic/terminal-util: cache value for colors_enabled
After all it's something that we query over and over.
For example, systemctl calls colors_enabled() four times for each failing
service. The compiler is unable to optimize those calls away because they
(potentially) accesses external and global state through on_tty() and
getenv().
2016-04-20 08:58:53 -04:00
Michał Bartoszkiewicz 129baf1bbf logind: use type to determine graphical sessions (#3071) 2016-04-20 10:06:26 +02:00
Franck Bui 409472cb8c systemctl: hide "following" units if '--all' is not passed (#2967)
No need to dump all the redundant device units on the user, just because he
specified that he wants to see units of a specific state.

This was broken by commit ebc962656c.
2016-04-19 21:18:17 -04:00
Lennart Poettering 0c1792efe4 Merge pull request #3055 from keszybz/preset-fixes
Another bunch of improvements to the installation code
2016-04-19 17:21:18 +02:00
Evgeny Vereshchagin 0c7739039b coredump: create unnamed temporary files if possible (O_TMPFILE) (#3065)
Don't leave temporary files if the coredump service is aborted during
the operation

Yeah, these are temporary files that systemd-coredump needs while
processing the coredumps. Of course, if the coredump service is aborted
during the operation we better shouldn't leave those files around. This
is hence a bug to fix in our coredumping code.
See https://github.com/systemd/systemd/issues/2804#issuecomment-210578147

Another option is to simply use O_TMPFILE, and when it is not available
fall back to the current behaviour. After all, the files are cleaned up
eventually, through normal tmpfiles aging, and the offending file
systems are pretty exotic these days, or not in the upstream kernel.

See https://github.com/systemd/systemd/issues/2804#issuecomment-211496707
2016-04-19 16:59:47 +02:00
Zbigniew Jędrzejewski-Szmek 5cfde70c6e run: change --tty option to --pty as documented
Keep the previous option name as hidden, for compatibility.

Fixes #3054.
2016-04-19 09:03:47 -04:00
Zbigniew Jędrzejewski-Szmek fe4aede922 systemctl: warning about missing install info for template units
The advice string didn't talk about template units at all. Extend
it and print when trying to enable a template unit without install info.

Fixes #2345.
2016-04-19 09:03:47 -04:00
Zbigniew Jędrzejewski-Szmek 1fa0336081 shared/install: change value of _UNIT_FILE_CHANGE_TYPE_INVALID
-1 could be confused with -EPERM. But we still need a negative enum
value to force gcc to use int for the enum type, even though it is
unused. Otherwise we get warnings.
2016-04-19 09:03:47 -04:00
Zbigniew Jędrzejewski-Szmek af3d811352 shared/install,systemctl,core: report offending file on installation error
Fixes #2191:

$ systemctl --root=/ enable sddm
Created symlink /etc/systemd/system/display-manager.service, pointing to /usr/lib/systemd/system/sddm.service.
$ sudo build/systemctl --root=/ enable gdm
Failed to enable unit, file /etc/systemd/system/display-manager.service already exists and is a symlink to /usr/lib/systemd/system/sddm.service.
$ sudo build/systemctl --root= enable sddm
$ sudo build/systemctl --root= enable gdm
Failed to enable unit: File /etc/systemd/system/display-manager.service already exists and is a symlink to /usr/lib/systemd/system/sddm.service.

(I tried a few different approaches to pass the error information back to the
caller. Adding a new parameter to hold the error results in a gigantic patch
and a lot of hassle to pass the args arounds. Adding this information to the
changes array is straightforward and can be more easily extended in the
future.)

In case local installation is performed, the full set of errors can be reported
and we do that. When running over dbus, only the first error is reported.
2016-04-19 08:58:00 -04:00
Vittorio G (VittGam) 490d20e65d sleep: Add debug feature to bypass hibernation memory checks. (#3064)
This new feature bypasses checking if a swap partition is mounted
or if there is enough swap space available for hibernation to
succeed.

This can be useful when a system with a Solid State Disk (SSD)
has no normal swap partition or file configured, and a custom
systemd unit is used to mount a swap file just before hibernating
and unmount it just after resuming.

Signed-off-by: Vittorio Gambaletta <git-systemd@vittgam.net>
2016-04-19 11:18:18 +02:00
Felipe Sateler 673fca32be zsh-completion: remove non-portable uses of \s in awk (#3063) 2016-04-19 00:23:01 -04:00
Zbigniew Jędrzejewski-Szmek 795ff6d5d8 shared/install: add helper function unit_file_changes_have_modification()
As suggested in review of #3049.
2016-04-18 23:38:22 -04:00
Zbigniew Jędrzejewski-Szmek 596fc2636a Various formatting and style fixes 2016-04-18 23:35:51 -04:00
Felipe Sateler c54318c66f Add zsh completion for networkctl (#3062) 2016-04-18 23:27:42 +02:00
mulkieran 9218e2ec22 Master minutes (#3060)
* man: change time unit specifier for minutes to "m", not "min".

To alert the reader to the fact that the ambiguous prefix "m" will be
interpreted as minutes, not months.

* man: change 'journal files' to 'archived journal files'.

So that the user may be reminded why they see log entries in the journal
from a time previous to the one they specified when using --vacuum-time.
2016-04-18 19:38:58 +02:00
Wouter Verhelst 565754a37e Mark nbd as inactive until connected (#2422)
Currently, 99-systemd.rules.in contains a line for network block
devices, which mark them as inactive until the first change event, and
as active from then on forward. This is not correct. A network block
device can be connected or disconnected; this state is signalled by the
presence or absense of a "pid" file, which contains the PID of the
nbd client userspace process that started the connection.

Update the rules file so that it checks for the presence of that file to
decide what to set SYSTEMD_READY to.

Note that current kernels do issue a change event upon connecting the
device, but not yet upon disconnecting. While it's possible to wait
until that's been fixed, the behaviour of the rule with TEST!="pid" in
the absence of a proper uevent is exactly the same as the behaviour of
the old rule; so it should be safe to apply now.

Signed-off-by: Wouter Verhelst <w@uter.be>
2016-04-18 16:29:10 +02:00
michaelolbrich 0b6b45d5e0 basic: user-utils.c needs missing.h for secure_getenv (#3059)
Otherwise building may fail with:

src/basic/user-util.c: In function 'get_home_dir':
src/basic/user-util.c:343:9: error: implicit declaration of function 'secure_getenv' [-Werror=implicit-function-declaration]
2016-04-18 15:28:00 +02:00
Susant Sahani 3fef7a3fcd networkd: allow setting of multicast querier for linux bridge (#3051) 2016-04-18 13:45:52 +02:00
Peter Hutterer c9d73e83f5 hwdb: add touchpad resolutions for the Dell XPS 15 9550 (#3057)
https://bugs.freedesktop.org/show_bug.cgi?id=94773
2016-04-18 08:50:25 +02:00
Dan Nicholson b047c62e66 conf-parser: Set EXTRACT_RETAIN_ESCAPE when extracting words (#2917)
If you reference another unit with an escaped name, the escaped characters
should remain in the extracted word. This used to work correctly prior to
commit 34f253f0.

The problem can be seen when units with escaped names are referenced.

$ cat "/usr/lib/systemd/system/dev-disk-by\x2dlabel-eos\x2dswap.swap"
[Swap]
What=/dev/disk/by-label/eos-swap

[Install]
WantedBy=dev-disk-by\x2dlabel-eos\x2dswap.device

$ systemctl enable "dev-disk-by\x2dlabel-eos\x2dswap.swap"
Created symlink
/etc/systemd/system/dev-disk-byx2dlabel-eosx2dswap.device.wants/dev-disk-by\x2dlabel-eos\x2dswap.swap,
pointing to /usr/lib/systemd/system/dev-disk-by\x2dlabel-eos\x2dswap.swap.

The wants directory should be created with the x2ds escaped with \.
2016-04-17 22:52:45 -04:00
Lubomir Rintel 6f7202cfd5 tree-wide: fall back to now(CLOCK_MONOTONIC) if CLOCK_BOOTTIME unsupported (#3037)
It was added in 2.6.39, and causes an assertion to fail when running in mock
hosted on 2.6.32-based RHEL-6:

Assertion 'clock_gettime(map_clock_id(clock_id), &ts) == 0' failed at systemd/src/basic/time-util.c:70, function now(). Aborting.
2016-04-17 21:45:42 -04:00
Lennart Poettering 746af6e0b5 Merge pull request #3049 from keszybz/preset-fixes
Fixes for preset-all handling and a few related issues
2016-04-17 14:29:41 +02:00
Nicolas Braud-Santoni b50a16af8e man: systemd.exec: Clarify InaccessibleDirectories (#3048) (#3048) 2016-04-17 14:22:17 +02:00