summaryrefslogtreecommitdiff
path: root/src/basic/exec-util.c
Commit message (Collapse)AuthorAge
* tree-wide: port various places over to use new rearrange_stdio()Lennart Poettering2018-05-30
|
* basic/exec-util: use _exit() to return from childZbigniew Jędrzejewski-Szmek2018-05-30
|
* exec-util: cast to void when return value is ignoredYu Watanabe2018-05-30
| | | | CID 1384262.
* process-spec: add another flag FORK_WAIT to safe_fork()Lennart Poettering2018-05-30
| | | | | | | | | This new flag will cause safe_fork() to wait for the forked off child before returning. This allows us to unify a number of cases where we immediately wait on the forked off child, witout running any code in the parent after the fork, and without direct interest in the precise exit status of the process, except recgonizing EXIT_SUCCESS vs everything else.
* exec-util: drop redundant log message in do_spawn()Lennart Poettering2018-05-30
| | | | safe_fork() logs that anyway, hence no need to do this twice.
* process-util: rework wait_for_terminate_and_warn() to take a flags parameterLennart Poettering2018-05-30
| | | | | | | | | | | | | This renames wait_for_terminate_and_warn() to wait_for_terminate_and_check(), and adds a flags parameter, that controls how much to log: there's one flag that means we log about abnormal stuff, and another one that controls whether we log about non-zero exit codes. Finally, there's a shortcut flag value for logging in both cases, as that's what we usually use. All callers are accordingly updated. At three occasions duplicate logging is removed, i.e. where the old function was called but logged in the caller, too.
* process-util: add another fork_safe() flag for enabling LOG_ERR/LOG_WARN loggingLennart Poettering2018-05-30
|
* tree-wide: introduce new safe_fork() helper and port everything overLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new safe_fork() wrapper around fork() and makes use of it everywhere. The new wrapper does a couple of things we previously did manually and separately in a safer, more correct and automatic way: 1. Optionally resets signal handlers/mask in the child 2. Sets a name on all processes we fork off right after forking off (and the patch assigns useful names for all processes we fork off now, following a systematic naming scheme: always enclosed in () – in order to indicate that these are not proper, exec()ed processes, but only forked off children, and if the process is long-running with only our own code, without execve()'ing something else, it gets am "sd-" prefix.) 3. Optionally closes all file descriptors in the child 4. Optionally sets a PR_SET_DEATHSIG to SIGTERM in the child, in a safe way so that the parent dying before this happens being handled safely. 5. Optionally reopens the logs 6. Optionally connects stdin/stdout/stderr to /dev/null 7. Debug logs about the forked off processes.
* Prep v236 : Add missing SPDX-License-Identifier (2/9) src/basicSven Eden2018-03-26
|
* exec-util: initialize `new` before using it (#7471)Evgeny Vereshchagin2017-11-26
| | | | CID #1383004
* basic/exec-utils:do_execute() : Remove "maybe unitialized" warningSven Eden2017-12-11
|
* exec-util,conf-files: skip non-executable files in execute_directories()Lennart Poettering2017-09-25
| | | | Fixes: #6787
* Prep v233.2: Mask unneeded functions and definitions in src/basicSven Eden2017-07-18
|
* Prep v233: Add missing files from upstream and rename formats-util.[hc]Sven Eden2017-07-17
Some functionality has been exported to the following files: - src/basic/env-util.[hc] - src/basic/exec-util.[hc] - src/shared/nsflags.[hc] The content of these files is now needed in elogind, and the files have been added as-is. Cleanup is done later. Further the header src/basic/formats-util.h has been renamed to src/basic/format-util.h