1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 18:27:04 +03:00
Commit Graph

21973 Commits

Author SHA1 Message Date
Lennart Poettering
e9db43d591 units: enable waiting for unit termination in certain cases
The legacy cgroup hierarchy does not support reliable empty
notifications in containers and if there are left-over subgroups in a
cgroup. This makes it hard to correctly wait for them running empty, and
thus we previously disabled this logic entirely.

With this change we explicitly check for the container case, and whether
the unit is a "delegation" unit (i.e. one where programs may create
their own subgroups). If we are neither in a container, nor operating on
a delegation unit cgroup empty notifications become reliable and thus we
start waiting for the empty notifications again.

This doesn't really fix the general problem around cgroup notifications
but reduces the effect around it.

(This also reorders #include lines by their focus, as suggsted in
CODING_STYLE. We have to add "virt.h", so let's do that at the right
place.)

Also see #317.
2015-09-01 17:44:17 +02:00
Lennart Poettering
957c3cf97c unit: suppress unnecessary cgroup empty check
Rework the "service is good" check, to only check the cgroup state if we
really need to instead of always.

This allows us to suppress going to the cgroupfs for an empty check for
the majority of services.

No functional change.
2015-09-01 17:20:56 +02:00
Lennart Poettering
ae2a2c53dd manager: don't write first-boot flag file all the time
Instead, remember that we have already written it.
2015-09-01 17:20:56 +02:00
Lennart Poettering
fc60d8153c sd-login: improve error handling
let's return ENXIO whenever we don't know something rather than ENOENT.

ENOENT suggests this was really about a file or directory, while ENXIO
is a more generic "not found" indicator.
2015-09-01 17:20:56 +02:00
Lennart Poettering
9660efb82f cgtop: properly show "/" instead of empty string in cgroup list 2015-09-01 17:20:56 +02:00
Lennart Poettering
bd9f2fc2d0 set: return NULL on destructors
Like we do it pretty much everywhere else.
2015-09-01 17:20:56 +02:00
Lennart Poettering
3f010fe095 Merge pull request #1066 from ssahani/tunnel
networkd: add support for tunnel encap limit
2015-09-01 12:02:10 +02:00
Lennart Poettering
5c69031f9c Merge pull request #1100 from martinpitt/master
logind: Listen to WMI hotkeys to catch SW_DOCK state/events
2015-09-01 11:34:26 +02:00
Martin Pitt
7577e5181a logind: Listen to WMI hotkeys to catch SW_DOCK state/events
On Dell and HP laptops the dock state/events (SW_DOCK) come from the "{Dell,HP}
WMI hotkeys" input devices. Tag them as power-switch so that login actually
considers them. Use a general match in case this affects other vendors, too.

Thanks to Andreas Schultz for debugging this!

https://launchpad.net/bugs/1450009
2015-09-01 10:51:15 +02:00
Lennart Poettering
d4c8dcc47a Merge pull request #1096 from evverx/systemd-path-bash-completion
shell-completion: bash: add systemd-path completion
2015-09-01 02:09:38 +02:00
David Herrmann
a58a91b6ac Merge pull request #1097 from teg/dhcp-server-2
dhcp-server: make pool configurable
2015-08-31 23:41:34 +02:00
Tom Gundersen
9b3a67c55b networkd: dhcp-server - allow configuration of the pool
The constraints we place on the pool is that it is a contiguous
sequence of addresses in the same subnet as the server address, not
including the subnet nor broadcast addresses, but possibly including
the server address itself. If the server address is included in the
pool it is (obviously) reserved and not handed out to clients.
2015-08-31 21:42:33 +02:00
Tom Gundersen
61986155d2 networkd: dhcp-server - default to manage the whole subnet
Don't restrict yourselves to 32 leases, simply manage the whole subnet by default.
2015-08-31 21:42:11 +02:00
Tom Gundersen
9963469618 sd-dhcp-server: simplify pool creation
Merge sd_dhcp_server_set_address() and sd_dhcp_server_set_lease_pool() into
sd_dhcp_server_configure_pool() as the behavior of the two former depends
on the order they are called in. The flexibility is not needed, so let's
just do this in one call.
2015-08-31 21:34:58 +02:00
Evgeny Vereshchagin
e50e53876f shell-completion: bash: add systemd-path completion 2015-08-31 19:24:16 +00:00
David Herrmann
3df49c2877 login: support user-bus on dbus1
dbus-1.10 was just released, including systemd units to run
`dbus-daemon --session` as systemd user unit. This allows using a
user-bus with dbus1, just like we do per default with kdbus.

All the dbus libraries have already been fixed long ago to use the
user-bus as default. Hence, there's no need to set
DBUS_SESSION_BUS_ADDRESS= if we use the user-bus. However, gdm and
friends continue to spawn a session bus if this variable is not set
(instead of checking for the existence of the user-bus). Hence, we force
the user-bus, if it is available, in pam_systemd. Once gdm and friends
are fixed, we can continue to drop this again. However, that might take
a while.

With this in place, all that is needed to make the user-bus work is:
    `systemctl --global enable dbus.socket`

If dbus.socket is not enabled, the legacy session-bus is still used.

Based on a patch by: Jan Alexander Steffens <jan.steffens@gmail.com>
2015-08-31 18:12:37 +02:00
Daniel Mack
d728d7faa6 Merge pull request #1093 from poettering/unified-prepare
A variety of clean-ups
2015-08-31 13:58:29 +02:00
Lennart Poettering
dcd7199082 cgtop: rework error handling
Never report errors twice.
2015-08-31 13:29:46 +02:00
Lennart Poettering
556c25cf8c sd-event: improve debug message when we fail to remove and fd from an epoll
Let's help users to debug issues with epoll fd removal by printing the
name of the event source.
2015-08-31 13:20:44 +02:00
Lennart Poettering
324496eb25 cgls: pretty print root cgroup path
Make sure show it as "/" rather than empty string.
2015-08-31 13:20:44 +02:00
Lennart Poettering
90990e28c9 manager: remove ask-password fd from sd_event before closing it
Otherwise we might attempt to remove a non-existing fd from epoll.
2015-08-31 13:20:44 +02:00
Lennart Poettering
6d3eefd28e man: document relationship between keys and switches of cgtop 2015-08-31 13:20:44 +02:00
Lennart Poettering
7fcfb7ee2f cgtop: allow toggling of --recursive= and -k at runtime 2015-08-31 13:20:44 +02:00
Lennart Poettering
3cb5beea0c cgtop: recursively count cgroup member tasks
When showing the number of tasks in a cgroup, recursively count tasks in
child cgroups and include them in the number. This ensures that the
number of tasks is cummulative the same way as memory, cpu and IO
resources are.

Old behaviour can be restored by passing the new --recursive=no switch.
2015-08-31 13:20:44 +02:00
Lennart Poettering
41ba8b6e69 cgtop: ignore kernel threads when counting tasks
However, allow them to be counted in by specifying -k
2015-08-31 13:20:44 +02:00
Lennart Poettering
cb88a0a4ae cgls: print the expressive error message we have 2015-08-31 13:20:44 +02:00
Lennart Poettering
a6149b93af process-util: trivial optimization 2015-08-31 13:20:43 +02:00
Lennart Poettering
03af6492f0 cgtop: show resource usage relative to cgroup root only
This way the output is restricted to cgroups from a container when run
in one.
2015-08-31 13:20:43 +02:00
Lennart Poettering
52f448c3ff unit: minor simplification 2015-08-31 13:20:43 +02:00
Lennart Poettering
9797f89bf0 util: treat 'C' and 'POSIX' locale identical 2015-08-31 13:20:43 +02:00
Lennart Poettering
a1b4e6e933 pager: set $LESSCHARSET when we output UTF8 chars
This way we can be sure that less has the same idea of the terminal as
we do.

This solves issues in systems that have locale uninitalized, where
systemd would output UTF-8 but less wouldn't allow it and show them as
control characters.
2015-08-31 13:20:43 +02:00
Lennart Poettering
d79200e26e unit: unify how we assing slices to units
This adds a new call unit_set_slice(), and simplifies
unit_add_default_slice(). THis should make our code a bit more robust
and simpler.
2015-08-31 13:20:43 +02:00
Lennart Poettering
35b7ff80e2 unit: add new macros to test for unit contexts 2015-08-31 13:20:43 +02:00
Lennart Poettering
6513d561ce core: use DUAL_TIMESTAMP_NULL where we can 2015-08-31 13:20:43 +02:00
Lennart Poettering
3f5e811594 core: don't generate stub unit file for transient units
We store the properties for transient units in drop-ins anyway, and
units don't have to have fragment files, hence don't bother with them,
and don't create them.
2015-08-31 13:20:43 +02:00
Lennart Poettering
3850d0505f build-sys: add missing Makefile symlink 2015-08-31 13:09:52 +02:00
Lennart Poettering
abab50081c update TODO 2015-08-31 13:09:29 +02:00
Daniel Mack
f70e92b728 Merge pull request #1091 from marmolak/master
socket: fix setsockopt call. SOL_SOCKET changed to SOL_TCP.
2015-08-31 12:15:35 +02:00
Robin Hack
172cfe8714 socket: fix setsockopt call. SOL_SOCKET changed to SOL_TCP. 2015-08-31 11:45:09 +02:00
Lennart Poettering
bbc19baa50 Merge pull request #1083 from filbranden/configparse1
A few more tweaks to extract_first_word
2015-08-31 11:36:01 +02:00
Susant Sahani
dae398a8c2 man: add man for tunnel encap limit 2015-08-31 13:22:15 +05:30
Susant Sahani
b48288868a networkd: add support for tunnel encap limit
The Tunnel Encapsulation Limit option specifies how many additional
levels of encapsulation are permitted to be prepended to the packet
2015-08-31 13:21:44 +05:30
Daniel Mack
6fb350fbe9 Merge pull request #1088 from filbranden/perltest2
test: udev - Signal that test was skipped when running as non-root
2015-08-31 08:47:49 +02:00
Daniel Mack
cbb14ca063 Merge pull request #1084 from crrodriguez/master
misc bugfixes
2015-08-31 08:46:48 +02:00
Daniel Mack
dd64f53175 Merge pull request #1087 from whot/hwdb-updates
hwdb: Add trackpoint sensitivity setting for Thinkpad X230
2015-08-31 08:44:02 +02:00
Filipe Brandenburger
4d55fc5b21 test: udev - Signal that test was skipped when running as non-root
It is more accurate to report that the test was skipped rather than
succeeded if we did not get to run it because it requires root.

Tested by running `make check` and inspecting the log file:

  $ cat test/udev-test.pl.log
  Must have root permissions to run properly.
  SKIP test/udev-test.pl (exit status: 77)

The `make check` output also reported:

  SKIP: test/udev-test.pl
2015-08-30 22:10:30 -07:00
Peter Hutterer
c10919874e hwdb: move the Performance MX to 1000dpi
Original entry may have been skewed by an earlier setting on the device, we
have a confirmed 1000dpi for a new device.

https://github.com/systemd/systemd/issues/1049
2015-08-31 14:53:07 +10:00
Peter Hutterer
27c43e7ed4 hwdb: Add trackpoint sensitivity setting for Thinkpad X230
https://bugs.freedesktop.org/show_bug.cgi?id=91794
2015-08-31 14:42:38 +10:00
Filipe Brandenburger
8ab00959fb extract_first_word: Refactor EXTRACT_DONT_COALESCE_SEPARATORS handling
Refactor allocation of the result string to the top, since it is
currently done in both branches of the condition.

Remove unreachable code checking for EXTRACT_DONT_COALESCE_SEPARATORS
when state == SEPARATOR (the only place where SEPARATOR is assigned to
state follows a check for EXTRACT_DONT_COALESCE_SEPARATORS that jumps to
the end of the function.)

Tested by running test-util successfully.

Follow up to: 206644aede
2015-08-30 19:48:38 -07:00
Filipe Brandenburger
d3ef6c5560 extract_first_word: Refactor allocation in empty argument case
This covers the case where an argument is an empty string, such as ''.

Instead of allocating the empty string in the individual conditions when
state == VALUE, just always allocate it at the end of state == START, at
which point we know we will have an argument.

Tested that test-util keeps passing after the refactor.

Follow up to: 14e685c29d
2015-08-30 19:48:30 -07:00