execute.h revision 7491ccf2cb237a2a88b831b2c7374ba2bb255cba
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#pragma once
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering/***
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering This file is part of systemd.
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering Copyright 2010 Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering systemd is free software; you can redistribute it and/or modify it
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering under the terms of the GNU Lesser General Public License as published by
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering (at your option) any later version.
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering systemd is distributed in the hope that it will be useful, but
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering Lesser General Public License for more details.
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering You should have received a copy of the GNU Lesser General Public License
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering***/
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringtypedef struct ExecStatus ExecStatus;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringtypedef struct ExecCommand ExecCommand;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringtypedef struct ExecContext ExecContext;
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poetteringtypedef struct ExecRuntime ExecRuntime;
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7Harald Hoyertypedef struct ExecParameters ExecParameters;
6482f6269c87d2249e52e889a63adbdd50f2d691Ronny Chevalier
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poettering#include <linux/types.h>
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include <sys/time.h>
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poettering#include <sys/resource.h>
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3Lennart Poettering#include <sys/capability.h>
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include <stdbool.h>
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include <stdio.h>
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include <sched.h>
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "list.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "util.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "set.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "fdset.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "missing.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "namespace.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "bus-endpoint.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringtypedef enum ExecInput {
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_INPUT_NULL,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_INPUT_TTY,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_INPUT_TTY_FORCE,
2b6bf07dd23bb467099d213c97b3875c5e453491Zbigniew Jędrzejewski-Szmek EXEC_INPUT_TTY_FAIL,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_INPUT_SOCKET,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering _EXEC_INPUT_MAX,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering _EXEC_INPUT_INVALID = -1
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering} ExecInput;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringtypedef enum ExecOutput {
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_INHERIT,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_NULL,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_TTY,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_SYSLOG,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_SYSLOG_AND_CONSOLE,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_KMSG,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_KMSG_AND_CONSOLE,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_JOURNAL,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_JOURNAL_AND_CONSOLE,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering EXEC_OUTPUT_SOCKET,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering _EXEC_OUTPUT_MAX,
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering _EXEC_OUTPUT_INVALID = -1
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering} ExecOutput;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
cc3773810855956bad92337cee8fa193584ab62eLennart Poetteringstruct ExecStatus {
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering dual_timestamp start_timestamp;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering dual_timestamp exit_timestamp;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering pid_t pid;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int code; /* as in siginfo_t::si_code */
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int status; /* as in sigingo_t::si_status */
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering};
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringstruct ExecCommand {
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char *path;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char **argv;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering ExecStatus exec_status;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering LIST_FIELDS(ExecCommand, command); /* useful for chaining commands */
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering bool ignore;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering};
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringstruct ExecRuntime {
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int n_ref;
d2e54fae5ca7a0f71b5ac8b356a589ff0a09ea0aKay Sievers
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char *tmp_dir;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering char *var_tmp_dir;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int netns_storage_socket[2];
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering};
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringstruct ExecContext {
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char **environment;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char **environment_files;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering struct rlimit *rlimit[_RLIMIT_MAX];
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char *working_directory, *root_directory;
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering
90b2de37b80603168f4e9c9c81cff7eea4efa21aZbigniew Jędrzejewski-Szmek mode_t umask;
90b2de37b80603168f4e9c9c81cff7eea4efa21aZbigniew Jędrzejewski-Szmek int oom_score_adjust;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int nice;
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering int ioprio;
90b2de37b80603168f4e9c9c81cff7eea4efa21aZbigniew Jędrzejewski-Szmek int cpu_sched_policy;
90b2de37b80603168f4e9c9c81cff7eea4efa21aZbigniew Jędrzejewski-Szmek int cpu_sched_priority;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering cpu_set_t *cpuset;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering unsigned cpuset_ncpus;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering ExecInput std_input;
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen ExecOutput std_output;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering ExecOutput std_error;
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen nsec_t timer_slack_nsec;
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen char *tty_path;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool tty_reset;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool tty_vhangup;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering bool tty_vt_disallocate;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool ignore_sigpipe;
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering /* Since resolving these names might might involve socket
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen * connections and we don't want to deadlock ourselves these
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen * names are resolved on execution only and in the child
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen * process. */
88231eb62cafc8bb51406919c8cf6019dc1ac916Thomas Hindoe Paaboel Andersen char *user;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char *group;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char **supplementary_groups;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char *pam_name;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering char *utmp_id;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering bool selinux_context_ignore;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char *selinux_context;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool apparmor_profile_ignore;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering char *apparmor_profile;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char **read_write_dirs, **read_only_dirs, **inaccessible_dirs;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering unsigned long mount_flags;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering uint64_t capability_bounding_set_drop;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering cap_t capabilities;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering int secure_bits;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int syslog_priority;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering char *syslog_identifier;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool syslog_level_prefix;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool cpu_sched_reset_on_fork;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool non_blocking;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool private_tmp;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool private_network;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool private_devices;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering ProtectSystem protect_system;
c7b5eb98e8eeafe63a079ee3c51e9670872437aeLennart Poettering ProtectHome protect_home;
c7b5eb98e8eeafe63a079ee3c51e9670872437aeLennart Poettering
de0671ee7fe465e108f62dcbbbe9366f81dd9e9aZbigniew Jędrzejewski-Szmek bool no_new_privileges;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
de0671ee7fe465e108f62dcbbbe9366f81dd9e9aZbigniew Jędrzejewski-Szmek /* This is not exposed to the user but available
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering * internally. We need it to make sure that whenever we spawn
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering * /bin/mount it is run in the same process group as us so
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering * that the autofs logic detects that it belongs to us and we
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering * don't enter a trigger loop. */
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool same_pgrp;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering unsigned long personality;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering Set *syscall_filter;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering Set *syscall_archs;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int syscall_errno;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool syscall_whitelist:1;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering Set *address_families;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool address_families_whitelist:1;
de0671ee7fe465e108f62dcbbbe9366f81dd9e9aZbigniew Jędrzejewski-Szmek
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char **runtime_directory;
de0671ee7fe465e108f62dcbbbe9366f81dd9e9aZbigniew Jędrzejewski-Szmek mode_t runtime_directory_mode;
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool oom_score_adjust_set:1;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool nice_set:1;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool ioprio_set:1;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool cpu_sched_set:1;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool no_new_privileges_set:1;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering /* custom dbus enpoint */
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering BusEndpoint *bus_endpoint;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering};
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering#include "cgroup.h"
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
cc3773810855956bad92337cee8fa193584ab62eLennart Poetteringstruct ExecParameters {
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering char **argv;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int *fds; unsigned n_fds;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char **environment;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool apply_permissions;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool apply_chroot;
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering bool apply_tty_stdin;
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering bool confirm_spawn;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering bool selinux_context_net;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering CGroupControllerMask cgroup_supported;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering const char *cgroup_path;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering const char *runtime_prefix;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering const char *unit_id;
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering usec_t watchdog_usec;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int *idle_pipe;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering char *bus_endpoint_path;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering int bus_endpoint_fd;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering};
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringint exec_spawn(ExecCommand *command,
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering const ExecContext *context,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering const ExecParameters *exec_params,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering ExecRuntime *runtime,
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering pid_t *ret);
cc3773810855956bad92337cee8fa193584ab62eLennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringvoid exec_command_done(ExecCommand *c);
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poetteringvoid exec_command_done_array(ExecCommand *c, unsigned n);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringvoid exec_command_free_list(ExecCommand *c);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringvoid exec_command_free_array(ExecCommand **c, unsigned n);
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poetteringchar *exec_command_line(char **argv);
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poettering
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poetteringvoid exec_command_dump(ExecCommand *c, FILE *f, const char *prefix);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykrynvoid exec_command_dump_list(ExecCommand *c, FILE *f, const char *prefix);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykrynvoid exec_command_append_list(ExecCommand **l, ExecCommand *e);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykrynint exec_command_set(ExecCommand *c, const char *path, ...);
cc3773810855956bad92337cee8fa193584ab62eLennart Poetteringint exec_command_append(ExecCommand *c, const char *path, ...);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykryn
eecd1362f7f4de432483b5d77c56726c3621a83aLennart Poetteringvoid exec_context_init(ExecContext *c);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykrynvoid exec_context_done(ExecContext *c);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykrynvoid exec_context_dump(ExecContext *c, FILE* f, const char *prefix);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykryn
cc3773810855956bad92337cee8fa193584ab62eLennart Poetteringint exec_context_destroy_runtime_directory(ExecContext *c, const char *runtime_root);
a34faf579d2be139b0b9e8cd0c73ad4d918ef736Lukas Nykryn
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringint exec_context_load_environment(const ExecContext *c, const char *unit_id, char ***l);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
527b7a421ff3927d4f3f170b1b143452e88ae1dcLennart Poetteringbool exec_context_may_touch_console(ExecContext *c);
527b7a421ff3927d4f3f170b1b143452e88ae1dcLennart Poettering
527b7a421ff3927d4f3f170b1b143452e88ae1dcLennart Poetteringvoid exec_status_start(ExecStatus *s, pid_t pid);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringvoid exec_status_exit(ExecStatus *s, ExecContext *context, pid_t pid, int code, int status);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringvoid exec_status_dump(ExecStatus *s, FILE *f, const char *prefix);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringint exec_runtime_make(ExecRuntime **rt, ExecContext *c, const char *id);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart PoetteringExecRuntime *exec_runtime_ref(ExecRuntime *r);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart PoetteringExecRuntime *exec_runtime_unref(ExecRuntime *r);
527b7a421ff3927d4f3f170b1b143452e88ae1dcLennart Poettering
527b7a421ff3927d4f3f170b1b143452e88ae1dcLennart Poetteringint exec_runtime_serialize(ExecRuntime *rt, Unit *u, FILE *f, FDSet *fds);
527b7a421ff3927d4f3f170b1b143452e88ae1dcLennart Poetteringint exec_runtime_deserialize_item(ExecRuntime **rt, Unit *u, const char *key, const char *value, FDSet *fds);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringvoid exec_runtime_destroy(ExecRuntime *rt);
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringconst char* exec_output_to_string(ExecOutput i) _const_;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart PoetteringExecOutput exec_output_from_string(const char *s) _pure_;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poetteringconst char* exec_input_to_string(ExecInput i) _const_;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart PoetteringExecInput exec_input_from_string(const char *s) _pure_;
f8e2fb7b14e53f5a4bcfd66d26910af1dee185c6Lennart Poettering