1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00
Commit Graph

26255 Commits

Author SHA1 Message Date
Lennart Poettering
145fab1eae resolve: port resolve tool to in_addr_ifindex_{from_string_auto|to_string}()
We can reuse some code here, so let's do it.
2016-06-14 23:27:30 +02:00
Zbigniew Jędrzejewski-Szmek
bd8420c518 man: fix option letter in udevadm control -e
-x never worked, so let's just correct the man page.

Fixes #3524.
2016-06-14 17:12:23 -04:00
Zbigniew Jędrzejewski-Szmek
19a29798bc udevadm: trivial simplification 2016-06-14 17:12:23 -04:00
Lennart Poettering
0e2e03c67a update TODO 2016-06-14 20:01:45 +02:00
Lennart Poettering
3f71dec5d7 unit: properly comment generated comments in unit files
Fix-up for 2a9a6f8ac0
2016-06-14 20:01:45 +02:00
Lennart Poettering
a48072b703 sd-ndisc: add missing cast
Apparently newer gcc versions are a bit more forgiving when assigning an
"unsigned char*" pointer to something of a different type. Let's add the
missing cast so that old gcc versions are fine, too.
2016-06-14 20:01:45 +02:00
Lennart Poettering
d58d600efd systemctl: allow percent-based MemoryLimit= settings via systemctl set-property
The unit files already accept relative, percent-based memory limit
specification, let's make sure "systemctl set-property" support this too.

Since we want the physical memory size of the destination machine to apply we
pass the percentage in a new set of properties that only exist for this
purpose, and can only be set.
2016-06-14 20:01:45 +02:00
Lennart Poettering
d8cf2ac79b util: introduce physical_memory_scale() to unify how we scale by physical memory
The various bits of code did the scaling all different, let's unify this,
given that the code is not trivial.
2016-06-14 20:01:45 +02:00
Lennart Poettering
799ec13412 core: make sure to use "infinity" in unit files, not "max"
THe latter is a kernelism, we only understand "infinity".
2016-06-14 19:50:38 +02:00
Lennart Poettering
cd0a7a8e58 core: when receiving a memory limit via the bus, refuse 0
When parsing unit files we already refuse unit memory limits of zero, let's
also refuse it when the value is set via the bus.
2016-06-14 19:50:38 +02:00
Lennart Poettering
328583dbc3 man: minor fixes 2016-06-14 19:50:38 +02:00
Lennart Poettering
875ae5661a core: optionally, accept a percentage value for MemoryLimit= and related settings
If a percentage is used, it is taken relative to the installed RAM size. This
should make it easier to write generic unit files that adapt to the local system.
2016-06-14 19:50:38 +02:00
Lennart Poettering
9184ca48ea util-lib: introduce parse_percent() for parsing percent specifications
And port a couple of users over to it.
2016-06-14 19:50:38 +02:00
Lennart Poettering
d9ab2bcf05 util: when determining the amount of memory on this system, take cgroup limit into account
When determining the amount of RAM in the system, let's make sure we also read
the root-level cgroup memory limit into account. This isn't particularly useful
on the host, but in containers it makes sure that whatever memory the container
got assigned is actually used for RAM size calculations.
2016-06-14 19:50:38 +02:00
Susant Sahani
1d7100298c networkd: Tunnel add support to configure key for VTI/VTI6 (#3532)
fixes #3298
2016-06-14 19:11:57 +02:00
Daniel Mack
91bb59b4b1 Merge pull request #3527 from poettering/systemctl-fixes
Systemctl fixes
2016-06-14 14:25:43 +02:00
Lukáš Nykrýn
4892084f09 manager: reduce complexity of unit_gc_sweep (#3507)
When unit is marked as UNSURE, we are trying to find if it state was
changed over and over again. So lets not go through the UNSURE states
again. Also when we find a GOOD unit lets propagate the GOOD state to
all units that this unit reference.

This is a problem on machines with a lot of initscripts with different
starting priority, since those units will reference each other and the
original algorithm might get to n! complexity.

Thanks HATAYAMA Daisuke for the expand_good_state code.
2016-06-14 14:20:56 +02:00
Evgeny Vereshchagin
bbc85a16e1 core: on unified we don't need to check u->pids: we can use proper notifications (#3531)
Fixes: #3483
2016-06-14 14:08:01 +02:00
Andrew Jeddeloh
f4f5e50a0a build: fix missing symbol for old kernel headers (#3530)
Fix issue where IN6_ADDR_GEN_MODE_STABLE_PRIVACY is undefined but
IFLA_INET6_ADDR_GEN_MODE is defined and thus the former does not get
fixed in missing.h. This occurs with kernel headers new enough to have
the IFLA_INET6_ADDR_GEN_MODE but old enough to not yet have
IN6_ADDR_GEN_MODE_STABLE_PRIVACY (e.g. 3.18).
2016-06-14 11:09:06 +02:00
Lennart Poettering
3dced37b7c systemctl: rework "systemctl status" a bit
This reworks "systemctl status" and "systemctl show" a bit. It removes the
definition of the `property_info` structure, because we can simply reuse the
existing UnitStatusInfo type for that.

The "could not be found" message is now printed by show_one() itself (and not
its caller), so that it is shown regardless by who the function is called.
(This makes it necessary to pass the unit name to the function.)

This also adds all properties found to a set, and then checks if any of the
properties passed via "--property=" is mising in it, if so, a proper error is
generated.

Support for checking the PID file of a unit is removed, as this cannot be done
reasonably client side (since the systemd instance we are talking to might sit
on another host)

Replaces: #3411
Fixes: #3425
Also see: #3504
2016-06-13 19:17:14 +02:00
Lennart Poettering
51e22f8851 systemctl: fix assertion hit when showing state of a unit without control group 2016-06-13 18:54:36 +02:00
Lennart Poettering
f256aa8853 unit-name: remove spurious newline 2016-06-13 18:47:42 +02:00
Tom Gundersen
1be3f471e7 Merge pull request #3491 from poettering/hwdb-acpi
hwdb: update UEFI/ACPI/PNP/EISA/EDID database from UEFI web site
2016-06-13 18:41:15 +02:00
Lennart Poettering
9ea8e2ce85 Merge pull request #3498 from poettering/syscall-filter-fixes
Syscall filter fixes, tighter nspawn seccomp sandbox by default
2016-06-13 16:54:21 +02:00
Ivan Shapovalov
dcd6145002 core: parse rd.rescue and rd.emergency as initrd-specific shorthands (#3488)
Typing `rd.rescue` is easier than `rd.systemd.unit=rescue.target`.
2016-06-13 16:28:42 +02:00
Lennart Poettering
68884a0b8a Merge pull request #3384 from keszybz/localed-keymap
More verbose logging in localed, unit tests, and a few tweaks to keymap conversions
2016-06-13 16:27:52 +02:00
Lennart Poettering
54a17e01de nspawn: lock down system call filter a bit
Let's block access to the kernel keyring and a number of obsolete system calls.
Also, update list of syscalls that may alter the system clock, and do raw IO
access. Filter ptrace() if CAP_SYS_PTRACE is not passed to the container and
acct() if CAP_SYS_PACCT is not passed.

This also changes things so that kexec(), some profiling calls, the swap calls
and quotactl() is never available to containers, not even if CAP_SYS_ADMIN is
passed. After all we currently permit CAP_SYS_ADMIN to containers by default,
but these calls should not be available, even then.
2016-06-13 16:25:54 +02:00
Lennart Poettering
4e069746fe units: tighten system call filters a bit
Take away kernel keyring access, CPU emulation system calls and various debug
system calls from the various daemons we have.
2016-06-13 16:25:54 +02:00
Lennart Poettering
1f9ac68b5b core: improve seccomp syscall grouping a bit
This adds three new seccomp syscall groups: @keyring for kernel keyring access,
@cpu-emulation for CPU emulation features, for exampe vm86() for dosemu and
suchlike, and @debug for ptrace() and related calls.

Also, the @clock group is updated with more syscalls that alter the system
clock. capset() is added to @privileged, and pciconfig_iobase() is added to
@raw-io.

Finally, @obsolete is a cleaned up. A number of syscalls that never existed on
Linux and have no number assigned on any architecture are removed, as they only
exist in the man pages and other operating sytems, but not in code at all.
create_module() is moved from @module to @obsolete, as it is an obsolete system
call. mem_getpolicy() is removed from the @obsolete list, as it is not
obsolete, but simply a NUMA API.
2016-06-13 16:25:54 +02:00
Lennart Poettering
50b52222f2 nspawn: order caps to retain alphabetically 2016-06-13 16:25:54 +02:00
Lennart Poettering
0e3f29f03f update TODO 2016-06-13 16:25:54 +02:00
Zbigniew Jędrzejewski-Szmek
aac57b3539 resolved: use single message for both dbus and signal calls (#3515)
Follow-up for #3502.
2016-06-13 16:24:48 +02:00
Lennart Poettering
11dc0a137b Merge pull request #3520 from keszybz/add-release.md
Add RELEASE.md
2016-06-13 16:13:41 +02:00
Lennart Poettering
ca9cdf93af Merge pull request #3518 from keszybz/test-process-util
Enhance test-process-util to take the PID to look at
2016-06-13 16:01:44 +02:00
Susant Sahani
357bb46af6 networkd: fix NULL pointer (#3523)
Not every link has kind associated with it.

(gdb) r
Starting program: /home/sus/tt/systemd/systemd-networkd
Missing separate debuginfos, use: dnf debuginfo-install
glibc-2.23.1-7.fc24.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
vboxnet0: Gained IPv6LL
wlp3s0: Gained IPv6LL
enp0s25: Gained IPv6LL
Enumeration completed

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6e27ade in __strcmp_sse2_unaligned () from /lib64/libc.so.6
(gdb) bt
src/network/networkd-link.c:2008
src/network/networkd-link.c:2059
src/network/networkd-link.c:2442
m=0x555555704a30, userdata=0x55555570bfe0) at src/network/networkd-link.c:2497
at src/libsystemd/sd-netlink/sd-netlink.c:347
src/libsystemd/sd-netlink/sd-netlink.c:402
src/libsystemd/sd-netlink/sd-netlink.c:432
userdata=0x5555556f7470) at src/libsystemd/sd-netlink/sd-netlink.c:739
src/libsystemd/sd-event/sd-event.c:2275
src/libsystemd/sd-event/sd-event.c:2626
timeout=18446744073709551615) at src/libsystemd/sd-event/sd-event.c:2685
bus=0x5555556f9af0, name=0x555555692315 "org.freedesktop.network1",
timeout=30000000,
    check_idle=0x55555556ac84 <manager_check_idle>, userdata=0x5555556f6b20) at
src/shared/bus-util.c:134
src/network/networkd-manager.c:1128
src/network/networkd.c:127
(gdb) f 1
src/network/networkd-link.c:2008
2008            if (link->network->bridge || streq("bridge", link->kind)) {
(gdb) p link->kind
$1 = 0x0
2016-06-13 15:57:38 +02:00
Susant Sahani
1c4b11794b networkd: route priority replace parsing config_parse_uint32 with safe_atou32 (#3522) 2016-06-13 15:57:17 +02:00
Jouke Witteveen
2065ca699b core/execute: pass env vars to PAM session setup (#3503)
Move the merger of environment variables before setting up the PAM
session and pass the aggregate environment to PAM setup. This allows
control over the PAM session hooks through environment variables.

PAM session initiation may update the environment. On successful
initiation of a PAM session, we adopt the environment of the
PAM context.
2016-06-13 12:50:12 +02:00
Zbigniew Jędrzejewski-Szmek
988b3b1765 systemctl: disallow systemctl --user reboot (#3519)
... as well as halt/poweroff/kexec/suspend/hibernate/hybrid-sleep.
Running those commands will fail in user mode, but we try to set the wall
message first, which might even succeed for privileged users. Best to nip
the whole sequence in the bud.

https://github.com/systemd/systemd/pull/3453#issuecomment-225455156
2016-06-13 07:57:28 +03:00
Zbigniew Jędrzejewski-Szmek
d11343ac79 Add RELEASE.md file which lists the steps needed for release
I put it in .github, so it doesn't stand out too much; after all
it's not interesting to most people.
2016-06-12 22:23:57 -04:00
Zbigniew Jędrzejewski-Szmek
476ef627af CONTRIBUTING: ask people to comment after after force-push 2016-06-12 22:21:49 -04:00
Zbigniew Jędrzejewski-Szmek
945c6e7cc0 CONTRIBUTING: remove line wrapping
GitHub displays this file poorly, because it preserves the newlines.
Let's try how things look without any wrapping.
2016-06-12 22:21:49 -04:00
Zbigniew Jędrzejewski-Szmek
4201ce672a process-util: remove broken support for pid==0
Our functions that query /proc/pid/ support using pid==0 to mean
self. get_process_id also seemed to support that, but it was not implemented
correctly: the result should be in *uid, not returned, and also it gave
completely bogus result when called from get_process_gid(). But afaict,
get_process_{uid,gid} were never called with pid==0, so it's not an actual
bug. Remove the broken code to avoid confusion.
2016-06-12 21:15:53 -04:00
Zbigniew Jędrzejewski-Szmek
18dade5aae test-process-util: allow pid to be specified on the command line
This makes it easy to test the query code on "ssh localhost"
and similar.
2016-06-12 21:15:53 -04:00
Zbigniew Jędrzejewski-Szmek
9a140c3564 test-process-util: rework the test function to take pid as argument
This fixes a bunch of copy&paste errors in the output.
2016-06-12 21:15:52 -04:00
Max Prokhorov
ba4cd7e257 util-lib: drop trailing non-printable characters from cmdline (#3512)
If max_length is equal or greater than cmdline length all trailing non-printable
characters are dropped. If max_length is 0 it should do the same.

This should also fix cmdline truncation if the last character is not '\0'.

Fixes #3469.
2016-06-12 21:13:42 -04:00
Peter Hutterer
e7b90ddc34 hwdb: change the Logitech MX500 to 1100 dpi (#3517)
https://bugs.freedesktop.org/show_bug.cgi?id=96225
and specifically the tech specs here:
http://support.logitech.com/en_us/product/corded-mouse-m500
2016-06-12 20:52:48 -04:00
Zbigniew Jędrzejewski-Szmek
af4ddf529e Merge pull request #3502 from poettering/resolved-flush-cache
resolved: allow clients request cache flushes
2016-06-12 18:28:30 -04:00
Zbigniew Jędrzejewski-Szmek
7f401340b0 Merge pull request #3453 from poettering/fix-3353
Fixes #3353.
2016-06-12 15:21:22 -04:00
Tobias Jungel
0e83e7a5a2 networkd: more vlan cleanup (#3506)
use config_parse_vlanid to parse vlan for BridgeFDB entries
2016-06-12 20:01:14 +02:00
Tobias Jungel
ceac40781b networkd: cleanup of bridge vlan code (#3505)
cleanup minor nitpicks mentioned in #3428
2016-06-12 19:59:21 +02:00