summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* logind: drop unused user_tasks_max fieldtasks-max-dynamicZbigniew Jędrzejewski-Szmek2019-11-055-7/+1
| | | | | | | | | We would only write to the field, and take the address. All *readers* were removed in 284149392755f086d0a714071c33aa609e61505e. (The explanation for why the field wasn't removed back then is that the patch underwent a few iterations, with the initial version adding translation back and forth. Later versions of the patch simply emit a warning and ignore the old value. Apparently nobody noticed that the value became unused.)
* core: write cgroup limits as permillesZbigniew Jędrzejewski-Szmek2019-11-051-4/+6
| | | | | | | | We allow expressing configuration as a fraction with granularity of 0.001, but when writing out the unit file, we'd round that up to 0.01. Longer term, I think it'd be nicer to simply use floats and do away with arbitrary restrictions on precision.
* core/dbus-cgroup: use %.*s instead of strndupa()Zbigniew Jędrzejewski-Szmek2019-11-051-6/+4
|
* core/dbus-cgroup: drop unnecessary parensZbigniew Jędrzejewski-Szmek2019-11-055-8/+11
| | | | | 'mask' is a macro parameter, so it cannot have commas. We don't need to parenthesize.
* core: make TasksMax a partially dynamic propertyZbigniew Jędrzejewski-Szmek2019-11-0512-30/+126
| | | | | | | | | | | | | | | | | TasksMax= and DefaultTasksMax= can be specified as percentages. We don't actually document of what the percentage is relative to, but the implementation uses the smallest of /proc/sys/kernel/pid_max, /proc/sys/kernel/threads-max, and /sys/fs/cgroup/pids.max (when present). When the value is a percentage, we immediately convert it to an absolute value. If the limit later changes (which can happen e.g. when systemd-sysctl runs), the absolute value becomes outdated. So let's store either the percentage or absolute value, whatever was specified, and only convert to an absolute value when the value is used. For example, when starting a unit, the absolute value will be calculated when the cgroup for the unit is created. Fixes #13419.
* Merge pull request #13939 from yuwata/network-fix-memleak-and-13938Yu Watanabe2019-11-054-5/+18
|\ | | | | network: fix memleak and invalid free function
| * sd-radv: fix memleakYu Watanabe2019-11-051-0/+7
| |
| * test: add testcase for issue #13938Yu Watanabe2019-11-051-0/+0
| |
| * network: fix memleak in route_prefix_free()Yu Watanabe2019-11-051-1/+2
| |
| * network: fix typoYu Watanabe2019-11-051-1/+2
| |
| * network: fix invalid cleanup functionYu Watanabe2019-11-051-2/+2
| |
| * network: fix memleakYu Watanabe2019-11-051-0/+4
| |
| * network: use fix invalid free functionYu Watanabe2019-11-051-1/+1
| | | | | | | | Fixes #13938.
* | journal: refresh cached credentials of stdout streamsLorenz Bauer2019-11-052-2/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | journald assumes that getsockopt(SO_PEERCRED) correctly identifies the process on the remote end of the socket. However, this is incorrect according to man 7 socket: The returned credentials are those that were in effect at the time of the call to connect(2) or socketpair(2). This becomes a problem when a new process inherits the stdout stream from a parent. First, log messages from the child process will be attributed to the parent. Second, the struct ucred used by journald becomes invalid as soon as the parent exits. Further sendmsg calls then fail with ENOENT. Logs for the child process then vanish from the journal. Fix this by using recvmsg on the stdout stream, and refreshing the cached struct ucred if SCM_CREDENTIALS indicate a new process. Fixes #13708
* | hwdb: add XKB_FIXED_MODEL to the keyboard hwdbSebastian Wick2019-11-052-16/+18
| | | | | | | | | | | | | | | | | | | | | | Chromebook keyboards have a top row which generates f1-f10 key codes but the keys have media symbols printed on them. A simple scan code to key code mapping to the correct media keys makes the f1-f10 inaccessible. To properly use the keyboard a custom key code to symbol mapping in xbk is required (a variant of the chromebook xkb model is already upstream). Other devices have similar problems. This commit makes it possible to specify which xkb model should be used for a specific device by setting XKB_FIXED_MODEL.
* | Merge pull request #13935 from poettering/bootctl-random-seed-mkdirAnita Zhang2019-11-041-0/+8
|\ \ | |/ |/| bootctl: create leading dirs when "bootctl random-seed" is called if …
| * bootctl: create leading dirs when "bootctl random-seed" is called if neededLennart Poettering2019-11-041-0/+8
| | | | | | | | Prompted by: #13603
* | core, job: fix breakage of ordering dependencies by systemctl reload commandHATAYAMA Daisuke2019-11-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, systemctl reload command breaks ordering dependencies if it's executed when its target service unit is in activating state. For example, prepare A.service, B.service and C.target as follows: # systemctl cat A.service B.service C.target # /etc/systemd/system/A.service [Unit] Description=A [Service] Type=oneshot ExecStart=/usr/bin/echo A1 ExecStart=/usr/bin/sleep 60 ExecStart=/usr/bin/echo A2 ExecReload=/usr/bin/echo A reloaded RemainAfterExit=yes # /etc/systemd/system/B.service [Unit] Description=B After=A.service [Service] Type=oneshot ExecStart=/usr/bin/echo B RemainAfterExit=yes # /etc/systemd/system/C.target [Unit] Description=C Wants=A.service B.service Start them. # systemctl daemon-reload # systemctl start C.target Then, we have: # LANG=C journalctl --no-pager -u A.service -u B.service -u C.target -b -- Logs begin at Mon 2019-09-09 00:25:06 EDT, end at Thu 2019-10-24 22:28:47 EDT. -- Oct 24 22:27:47 localhost.localdomain systemd[1]: Starting A... Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Child 967 belongs to A.service. Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Running next main command for state start. Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Passing 0 fds to service Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: About to execute: /usr/bin/sleep 60 Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Forked /usr/bin/sleep as 968 Oct 24 22:27:47 localhost.localdomain systemd[968]: A.service: Executing: /usr/bin/sleep 60 Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Trying to enqueue job A.service/reload/replace Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Merged into running job, re-running: A.service/reload as 1288 Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Enqueued job A.service/reload as 1288 Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Unit cannot be reloaded because it is inactive. Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Job 1288 A.service/reload finished, result=invalid Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Passing 0 fds to service Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: About to execute: /usr/bin/echo B Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Forked /usr/bin/echo as 970 Oct 24 22:27:52 localhost.localdomain systemd[970]: B.service: Executing: /usr/bin/echo B Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Failed to send unit change signal for B.service: Connection reset by peer Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Changed dead -> start Oct 24 22:27:52 localhost.localdomain systemd[1]: Starting B... Oct 24 22:27:52 localhost.localdomain echo[970]: B Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Child 970 belongs to B.service. Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Main process exited, code=exited, status=0/SUCCESS Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Changed start -> exited Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Job 1371 B.service/start finished, result=done Oct 24 22:27:52 localhost.localdomain systemd[1]: Started B. Oct 24 22:27:52 localhost.localdomain systemd[1]: C.target: Job 1287 C.target/start finished, result=done Oct 24 22:27:52 localhost.localdomain systemd[1]: Reached target C. Oct 24 22:27:52 localhost.localdomain systemd[1]: C.target: Failed to send unit change signal for C.target: Connection reset by peer Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Child 968 belongs to A.service. Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Running next main command for state start. Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Passing 0 fds to service Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: About to execute: /usr/bin/echo A2 Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Forked /usr/bin/echo as 972 Oct 24 22:28:47 localhost.localdomain systemd[972]: A.service: Executing: /usr/bin/echo A2 Oct 24 22:28:47 localhost.localdomain echo[972]: A2 Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Child 972 belongs to A.service. Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Changed start -> exited The issue occurs not only in reload command, i.e.: - reload - try-restart - reload-or-restart - reload-or-try-restart commands The cause of this issue is that job_type_collapse() doesn't take care of the activating state. Fixes: #10464
* | journalctl: allow running vacuum on remote journals, tooJan Kundrát2019-11-041-3/+0
|/ | | | | | | | | | | | | Right now the `systemd-journal-remote` service does not constrain its resource usage (I just run out of space on my 100GB partition, for example). This patch does not change that, but it at least makes it possible to run something like: journalctl --directory /var/log/journal/remote --rotate --vacuum-size=90G fixes #2376 Co-authored-by: Mike Auty <ikelos@gentoo.org>
* Merge pull request #13906 from yuwata/drop-missing-take2Zbigniew Jędrzejewski-Szmek2019-11-04243-394/+0
|\ | | | | tree-wide: drop xxx.h when xxx-util.h is included
| * util: drop unnecessary headers from util.cYu Watanabe2019-11-041-22/+0
| |
| * tree-wide: drop double newlineYu Watanabe2019-11-0417-19/+0
| |
| * tree-wide: drop input.h when missing_input.h is includedYu Watanabe2019-11-043-3/+0
| |
| * tree-wide: drop stdio.h when stdio-util.h is includedYu Watanabe2019-11-0425-25/+0
| |
| * tree-wide: drop signal.h when signal-util.h is includedYu Watanabe2019-11-0417-17/+0
| |
| * tree-wide: drop mman.h when missing_mman.h is includedYu Watanabe2019-11-041-1/+0
| |
| * tree-wide: drop magic.h when missing_magic.h is includedYu Watanabe2019-11-042-2/+0
| |
| * tree-wide: drop stat.h or statfs.h when stat-util.h is includedYu Watanabe2019-11-0425-30/+0
| |
| * tree-wide: drop socket.h when socket-util.h is includedYu Watanabe2019-11-0428-28/+0
| |
| * tree-wide: drop mntent.h when fstab-util.h is includedYu Watanabe2019-11-042-2/+0
| |
| * tree-wide: drop libkmod.h when module-util.h is includedYu Watanabe2019-11-044-4/+0
| |
| * tree-wide: drop blkid.h when blkid-util.h is includedYu Watanabe2019-11-044-4/+0
| |
| * tree-wide: drop acl.h when acl-util.h is includedYu Watanabe2019-11-041-3/+0
| |
| * tree-wide: drop pwd.h and grp.h when user-util.h is includedYu Watanabe2019-11-0411-15/+0
| |
| * tree-wide: drop time.h when time-util.h is includedYu Watanabe2019-11-047-7/+0
| |
| * tree-wide: drop capability.h when capability-util.h is includedYu Watanabe2019-11-044-4/+0
| |
| * tree-wide: drop sched.h when missing_sched.h is includedYu Watanabe2019-11-043-3/+0
| |
| * tree-wide: drop gcrypt.h when gcrypt-util.h is includedYu Watanabe2019-11-043-6/+0
| |
| * tree-wide: drop locale.h when locale-util.h is includedYu Watanabe2019-11-047-7/+0
| |
| * tree-wide: drop glob.h when glob-util.h is includedYu Watanabe2019-11-045-5/+0
| |
| * tree-wide: drop dirent.h when dirent-util.h is includedYu Watanabe2019-11-0411-11/+0
| |
| * tree-wide: drop alloca.h when alloc-util.h is includedYu Watanabe2019-11-049-9/+0
| |
| * tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-04167-167/+0
| |
* | sd-boot: Skip adding boot entries when the loader does not existJan Janssen2019-11-041-1/+12
| |
* | allow an empty DefaultInstance= in configuration filesJérémy Rosen2019-11-041-0/+5
| | | | | | | | | | | | It is currently possible to override the DefaultInstance via drop-ins but not remove it completely. Allow to do that by specifying an empty DefaultInstance=
* | man/systemd.net-naming-scheme: fix typoJan Synacek2019-11-041-1/+1
|/
* Merge pull request #13899 from poettering/in-gid-tweakYu Watanabe2019-11-032-16/+45
|\ | | | | user-util: tweak to in_gid()
| * test: add really basic in_gid() testLennart Poettering2019-10-311-0/+11
| |
| * user-util: tweak to in_gid()Lennart Poettering2019-10-311-16/+34
| | | | | | | | | | | | | | | | | | Let's make this robust towards parallel updates to group lists. This is not going to happen IRL, but it makes me sleep better at night: let's iterate a couple of times in case the list is updated while we are at it. Follow-up for: f5e0b942af1e86993c21f4e5c84342bb10403dac
* | Merge pull request #13909 from poettering/env-copy-pidYu Watanabe2019-11-034-16/+25
|\ \ | | | | | | Fixes for the "saved_env" copy logic