summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* portable: add 'reattach' verb and DBUS interfaceLuca Boccassi2021-02-1014-26/+480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'reattach' verb to portablectl, and corresponding DBUS interface to systemd-portabled. Takes the same parameters as 'attach', but it will do a 'detach' (and it will refuse to proceed if it cannot be done) first, matching on the unversioned prefix of the new image. Eg: portablectl reattach /tmp/foo_2.raw will cause foo_1.raw to be detached, and foo_2.raw to be attached. The key difference with a manual 'detach old' plus 'attach new' is that the running units are not disturbed until after the attach completed, and if --now is passed they are then restarted. A 'detach' is not allowed normally if the units are running. By using a restart-after-deploy method, 'reattach' allows for minimal interruption of service and also for features that only work on restart (eg: file descriptor store) to work as intended. The DBUS interface returns two lists: first the removals from the detach that were not immediately re-added in the attach, so that the caller can stop the relevant units, and then the list of additions that are either new or updates, so that the caller can restart/enable the relevant units. portablectl already implements this with the existing --now/--enable switches.
* portable: allow Detach to match images with different version suffixesLuca Boccassi2021-02-101-4/+12
|
* test: setup var/tmp in the test image as wellLuca Boccassi2021-02-101-1/+1
|
* test: add empty /etc/resolv.conf in test imageLuca Boccassi2021-02-101-0/+1
| | | | | Portable services have a BindPath pointing to it, so it needs to be available in the image
* test-50-dissect: move minimal image setup to common setup functionLuca Boccassi2021-02-103-21/+54
| | | | | | So that it can be re-used for other tests by simply setting TEST_INSTALL_VERITY_MINIMAL=1 in test.sh, without having to replicate the setup commands.
* Merge pull request #18542 from yuwata/bash-completion-updateZbigniew Jędrzejewski-Szmek2021-02-102-3/+5
|\ | | | | bash-completion: add missing options
| * bash-completion: loginctl: add -P optionYu Watanabe2021-02-101-2/+2
| |
| * bash-completion: coredumpctl: add --json and -n optionsYu Watanabe2021-02-101-1/+3
| |
* | Merge pull request #18536 from poettering/uid-refs-simplifyYu Watanabe2021-02-102-37/+23
|\ \ | | | | | | dynamic uid/gid reference handling simplifications
| * | core: fix manager_ref_gid() parameter name in headerLennart Poettering2021-02-101-1/+1
| | | | | | | | | | | | It should match what we do for manager_ref_uid() and in the .c file.
| * | manager: simplify uid-ref/gid-ref a code a bitLennart Poettering2021-02-101-36/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let's drop unused function arguments, and needless double pointers where we can. no actual change in behaviour, just simplifications (I tried to track down #14026 without success, and this came out of it)
* | | Merge pull request #11484 from keszybz/udevadm-error-logsYu Watanabe2021-02-10179-460/+471
|\ \ \ | |_|/ |/| | Use real return codes in _from_string() functions
| * | test-string-util: add missing commaZbigniew Jędrzejewski-Szmek2021-02-101-1/+1
| | | | | | | | | | | | Coverity CID#1446368.
| * | resolved: rework a few functions to return early on errorZbigniew Jędrzejewski-Szmek2021-02-101-67/+39
| | | | | | | | | | | | | | | | | | | | | The implementation is a bit ugly because we set the output variable twice. But we were already doing this on error, so this is not significantly worse. Doing this allows us to avoid goto's, and the compiler should be able to figure this out and only set once.
| * | machinectl: write arg_* only after verifying the valueZbigniew Jędrzejewski-Szmek2021-02-101-12/+12
| | |
| * | tree-wide: propagate error code from _from_string() functionsZbigniew Jędrzejewski-Szmek2021-02-1027-81/+62
| | | | | | | | | | | | Now that we know we have something useful, no need to make an answer up.
| * | Return -EINVAL from _from_string() functionsZbigniew Jędrzejewski-Szmek2021-02-105-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'd return -1 (-EPERM), even though we have a general rule to use real errno values. The particular case that caught my attention was: $ sudo udevadm control -l asdf Failed to parse log priority 'asdf': Operation not permitted ... but "git grep 'r =.*_from_string' src/" return 110 hits. Confusingly, some of the _from_string functions already return a proper errno value, so not all of those are broken, but probably quite a few.
| * | tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-10139-245/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
| * | udev: make sure UdevBuiltinCommand is properly convertedZbigniew Jędrzejewski-Szmek2021-02-103-2/+44
| | |
| * | sd-bus: drop some bitfields in sd_bus_slotZbigniew Jędrzejewski-Szmek2021-02-101-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A hole was/is present after the booleans, so changing them to be one byte each doesn't change the structure size (122 bits on amd64). If we add more stuff later, it might make sense to turn some of those into bitfields again. For now, let's take the easy route. EINVAL fits into type now. Code size it minimally reduced: -rwxrwxr-x 1 zbyszek zbyszek 4109792 Feb 10 14:00 build/libsystemd.so.0.30.0 -rwxrwxr-x 1 zbyszek zbyszek 4109712 Feb 10 14:01 build/libsystemd.so.0.30.0
| * | sd-netlink: pahole optimization of sd_netlink_slotZbigniew Jędrzejewski-Szmek2021-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By rearranging the fields, we can avoid one of the holes (on amd64). By adding more space for .type, -EINVAL can be used as a value later on. The structure is reduced from 96 to 88 bytes (on amd64). Text size is also smaller: -rwxrwxr-x 1 zbyszek zbyszek 4109832 Feb 9 19:50 build/libsystemd.so.0.30.0 -rwxrwxr-x 1 zbyszek zbyszek 4109792 Feb 9 19:51 build/libsystemd.so.0.30.0
| * | shared/json: make JsonVariant.type field widerZbigniew Jędrzejewski-Szmek2021-02-101-4/+4
| | | | | | | | | | | | | | | pahole shows that this doesn't make a difference, but we can fit -EINVAL into .type without warnings.
| * | sd-event: drop one bitfield from sd_event_sourceZbigniew Jędrzejewski-Szmek2021-02-101-1/+1
| | | | | | | | | | | | | | | pahole analysis confirms that the structure size does not change (there was/is a hole after the sequence of bitfields anyway).
| * | core: drop bitfields in Manager objectZbigniew Jędrzejewski-Szmek2021-02-101-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every bitfield may make the object a little smaller, but requires additional code when accessing the field. So it only makes sense in objects that are created in many many copies. The Manager is pretty much a singleton. -rwxrwxr-x 1 zbyszek zbyszek 4443840 Feb 9 16:14 build/systemd -rwxrwxr-x 1 zbyszek zbyszek 4442552 Feb 9 16:42 build/systemd We save 1288 bytes of code by "wasting" a few bytes on storage. (The speed advantages are probably more important, but harder to measure…)
| * | Add comma in structured initialization in a few placesZbigniew Jędrzejewski-Szmek2021-02-103-3/+3
| | | | | | | | | | | | It just looks nicer…
| * | core: do not initialize variable which is unconditionally set belowZbigniew Jędrzejewski-Szmek2021-02-102-2/+2
| | |
| * | test-tables: make the assert more readableZbigniew Jędrzejewski-Szmek2021-02-101-3/+7
| | | | | | | | | | | | | | | | | | Doing it all in one line and with negation in front seemed like a good idea at some point, but I think it is vastly easier to understand when it is split out a bit.
| * | test-tables: fix warning about NULL used in printfZbigniew Jędrzejewski-Szmek2021-02-101-1/+1
| | | | | | | | | | | | | | | With the simplified asserts, newer gcc is able to (correctly) figure out that NULL was being passed.
* | | test: count call instructions as wellFrantisek Sumsal2021-02-101-1/+1
| | | | | | | | | | | | | | | | | | Binaries on the latest Arch Linux use `call` instructions instead of `callq`, which breaks the ASan detection and eventually the image building process (due to insufficient space).
* | | Translations update from Weblate (#18537)Weblate (bot)2021-02-101-6/+6
| | | | | | | | | Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
* | | ci: build on Fedora ELN as wellFrantisek Sumsal2021-02-101-0/+2
| | | | | | | | | | | | | | | ELN builds with a slightly different content set and RHEL-like options, which should, theoretically, help a bit with RHEL stuff.
* | | Merge pull request #18506 from keszybz/fuzz-systemctl-parse-argvYu Watanabe2021-02-1010-23/+96
|\ \ \ | | | | | | | | Fuzzer for systemctl argline parsing
| * | | systemctl: remove comment about --failed being deprecatedZbigniew Jędrzejewski-Szmek2021-02-091-1/+1
| | | | | | | | | | | | | | | | Follow-up for bef19548a2430909019d7cff095b8600c796c3ef.
| * | | fuzz-systemctl-parse-argv: a new fuzzerZbigniew Jędrzejewski-Szmek2021-02-095-2/+70
| | | | | | | | | | | | | | | | | | | | | | | | Does what the name suggests. Obviously inspired by sudoers, but note that our tools are not supposed to be installed suid, so there is no privilege boundary to cross here.
| * | | xdg-autostart-generator: sort header includesZbigniew Jędrzejewski-Szmek2021-02-081-1/+1
| | | |
| * | | systemctl: move telinit execcing out of parse_argv()Zbigniew Jędrzejewski-Szmek2021-02-084-5/+18
| | | | | | | | | | | | | | | | | | | | With this change, parse_argv() does parsing, without any real actions. Fully untested ;)
| * | | core: drop references to UpstartZbigniew Jędrzejewski-Szmek2021-02-073-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last release of Upstart was July 2014 [1], and there have been no new commits to the repo. We should move on too. [1] https://lists.ubuntu.com/archives/upstart-devel/2014-July/003313.html The only real support was in the code that looked for $PREVLEVEL. https://codesearch.debian.net/search?q=PREVLEVEL&literal=1&perpkg=1 shows this string in our own code (or the copy in elogind), our own man pages, and init scripts for two packages (brltty, salt), which shouldn't be used with systemd. (And both *check* for PREVLEVEL, and don't set it. So most likely nothing at all sets it.)
* | | | Merge pull request #18521 from poettering/coredumpctl-tableLennart Poettering2021-02-104-102/+335
|\ \ \ \ | |_|_|/ |/| | | coredumpctl improvements (mostly about table formatting)
| * | | coredumpctl: include coredump size in outputLennart Poettering2021-02-101-32/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the output of the "list" and "info" verbs and adds coredump size information to the output. For doing that a common helper function is added that analyzes the coredump file on disk.
| * | | man: document new coredumpctl featuresLennart Poettering2021-02-101-7/+9
| | | |
| * | | coredumpctl: modernize table outputLennart Poettering2021-02-101-64/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's use our table formatter for generating the coredump table. Bring support up to our current standards, with a bit of color, JSON output and so on. Also adds supports for setting a max for the number of lines to generate. (with the new -n switch) The existing -1 switch now becomes a synonym for "-n 1 --reverse" Fixes: #3271
| * | | format-table: when generating json, synthesize "null" for invalid ifindexLennart Poettering2021-02-101-0/+3
| | | | | | | | | | | | | | | | This matches what we do for other cell types that have an invalid value.
| * | | format-table: make UID/GID/PID fields first class citizens + add signal cell ↵Lennart Poettering2021-02-102-10/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type This way we can display invalid UIDs/GIDs/PIDs as n/a while still storing them as is. Also, let's add a new cell type for unix signal, that is stored as integer, but displayed as signal name string.
* | | | github: expressly ask for logs in github issue templateLennart Poettering2021-02-101-0/+12
| | | | | | | | | | | | | | | | | | | | Apparently it's not obvious that logs are a good thing to provide, hence let's explicitly ask for them.
* | | | clock-util: modernize settimeofday() timezone callsLennart Poettering2021-02-101-26/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's use structured initialization, and avoid the weird `tv_null` indirection. No changes in behaviour, just some clean-ups.
* | | | Fix coverity warning in test-string-util.cLuca Boccassi2021-02-101-1/+1
|/ / / | | | | | | | | | CID 1446368: Incorrect expression (MISSING_COMMA)
* | | analyze: slightly reword PrivatTmp= messageLennart Poettering2021-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | Apparently there way confusion about "does not apply". Let's say "is not appropriate". Fixes: #13095
* | | Merge pull request #18518 from poettering/inhibit-limit-columnsLennart Poettering2021-02-092-2/+2
|\ \ \ | |_|/ |/| | put a width limit on the "systemd-inhibit --list" table
| * | inhibit: cut off overly long "who" fieldsLennart Poettering2021-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | systemd-inhibit when invoked with a command line will put the whole command line in the "who" field of the inhibitor lock. This can get extremely long for shell expressions, making the table "systemd-inhibit --list" shows ridiculously weirdly formatted. Let's put a limit on the column width: half of the screen, not more.
| * | format-table: don't hit assert if column got less width than it asked forLennart Poettering2021-02-091-2/+1
|/ / | | | | | | | | | | | | If one field in a specific column has a maximum size limit, other fields in the same column might affected by it and get less than they asked for. Let's make sure we can handle this, and don't assert on this because surprisingly we got less than what we asked for.