summaryrefslogtreecommitdiffstats
path: root/src/shared/exec-util.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* shared/exec-util: modernize execute_strv() and friends a bitMike Yuan2024-10-151-4/+4
| | | | | do_spawn() is also called during execute_strv(), so rename "direxec" to "exec-inner".
* shared/exec-util: minor rearrangement, drop unused EXEC_DIR_NONEMike Yuan2024-10-151-13/+12
|
* core: warn if a generator is world-writableLukas Nykryn2024-10-071-0/+1
| | | | ... because that is obviously a security risk.
* shared/exec-util: add macro to autoinsert sentinel for fork_agent()Zbigniew Jędrzejewski-Szmek2024-07-221-1/+2
|
* exec-util: modernize exec_command_flags_{to,from}_strvMike Yuan2024-07-201-2/+2
| | | | | | - Rename ret params following our coding style - Use assertion where appropriate - Use BIT_FOREACH()
* exec-util: make execute_strv() optionally take root directoryYu Watanabe2023-04-161-0/+1
| | | | Preparation for rewriting kernel-install in C.
* exec-util: introduce EXEC_DIR_SKIP_REMAINING flagYu Watanabe2023-03-171-0/+1
| | | | Will be used in later commits.
* exec-util: extract the core logic of execute_directories() as execute_strv()Yu Watanabe2023-03-171-0/+10
| | | | | | Then, we can use it with a custom enumerator of executables. No functional change, preparation for later commits.
* Revert "basic/fd-util: sort the 'except' array in place"Lennart Poettering2021-10-271-1/+1
| | | | This reverts commit 9c46228b7deb53d6384545535b37b2844a102b2b.
* basic: move freeze() from shared/exec-util.h to basic/process-util.hLennart Poettering2021-10-221-2/+0
| | | | | That way we can use it in other code from basic/. It fits into both headers equally well or badly, hence let's just move this one function.
* Move freeze() into shared/Zbigniew Jędrzejewski-Szmek2021-07-231-0/+2
| | | | | | | | Library code should not call freeze(), this is something that should only be done by "application code", so moving it into shared/ is appropriate. The fallback to call _exit() is dropped: let's trust that the infinite loop is infinite.
* Move fork_agent() into shared/Zbigniew Jędrzejewski-Szmek2021-07-231-0/+2
| | | | | | | Currently it's only used in two places in src/shared/, so the function was already included just once in compiled code. But it seems appropriate to move it there anyway, because library code should have no need to fork agents, so it doesn't belong in basic/.
* shared: use -EINVAL for _EXEC_COMMAND_FLAGS_INVALIDBenjamin Robin2021-02-161-1/+1
| | | | Follow-up of #11484
* core: also set $SYSTEMD_EXEC_PID= for generatorsYu Watanabe2021-01-311-3/+4
|
* Merge pull request #17079 from keszybz/late-exec-resolutionLennart Poettering2020-12-031-0/+2
|\ | | | | Resolve executable paths before execution, use fexecve()
| * core/execute: fall back to execve() for scriptsZbigniew Jędrzejewski-Szmek2020-11-061-0/+2
| | | | | | | | fexecve() fails with ENOENT and we need a fallback. Add appropriate test.
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|/
* core: add ExecStartXYZEx= with dbus support for executable prefixesAnita Zhang2019-05-311-0/+15
| | | | Closes #11654
* core: Allow to configure execute_directories execution behaviorMatthias Klumpp2019-02-181-1/+8
| | | | | | | | | This adds a new bitfield to `execute_directories()` which allows to configure whether to ignore non-zero exit statuses of binaries run and whether to allow parallel execution of commands. In case errors are not ignored, the exit status of the failed script will now be returned for error reposrting purposes or other further future use.
* Move various files that don't need to be in basic/ to shared/Zbigniew Jędrzejewski-Szmek2018-11-201-0/+25
This doesn't have much effect on the final build, because we link libbasic.a into libsystemd-shared.so, so in the end, all the object built from basic/ end up in libsystemd-shared. And when the static library is linked into binaries, any objects that are included in it but are not used are trimmed. Hence, the size of output artifacts doesn't change: $ du -sb /var/tmp/inst* 54181861 /var/tmp/inst1 (old) 54207441 /var/tmp/inst1s (old split-usr) 54182477 /var/tmp/inst2 (new) 54208041 /var/tmp/inst2s (new split-usr) (The negligible change in size is because libsystemd-shared.so is bigger by a few hundred bytes. I guess it's because symbols are named differently or something like that.) The effect is on the build process, in particular partial builds. This change effectively moves the requirements on some build steps toward the leaves of the dependency tree. Two effects: - when building items that do not depend on libsystemd-shared, we build less stuff for libbasic.a (which wouldn't be used anyway, so it's a net win). - when building items that do depend on libshared, we reduce libbasic.a as a synchronization point, possibly allowing better parallelism. Method: 1. copy list of .h files from src/basic/meson.build to /tmp/basic 2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less