summaryrefslogtreecommitdiffstats
path: root/init/init.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-02-06 20:15:18 -0800
committerElliott Hughes <enh@google.com>2015-02-25 17:55:34 -0800
commit8d82ea05cb0945ba6cb8bf321b9ffbd0b6932745 (patch)
tree2b73c3eac0ffb520609acf1f2b52d609e419f227 /init/init.h
parent5329d3fd54fa875bb7de78a8c40134cc63921c64 (diff)
downloadsystem_core-8d82ea05cb0945ba6cb8bf321b9ffbd0b6932745.tar.gz
system_core-8d82ea05cb0945ba6cb8bf321b9ffbd0b6932745.tar.bz2
system_core-8d82ea05cb0945ba6cb8bf321b9ffbd0b6932745.zip
Implement exec.
Change-Id: I20329bc9b378479d745b498d6a00eca0872cd5ab
Diffstat (limited to 'init/init.h')
-rw-r--r--init/init.h53
1 files changed, 28 insertions, 25 deletions
diff --git a/init/init.h b/init/init.h
index eedec276f..a104af607 100644
--- a/init/init.h
+++ b/init/init.h
@@ -17,13 +17,11 @@
#ifndef _INIT_INIT_H
#define _INIT_INIT_H
+#include <sys/types.h>
+
#include <cutils/list.h>
#include <cutils/iosched_policy.h>
-#include <sys/stat.h>
-
-void handle_control_message(const char *msg, const char *arg);
-
struct command
{
/* list of commands in an action */
@@ -59,8 +57,6 @@ struct action {
struct command *current;
};
-void build_triggers_string(char *name_str, int length, struct action *cur_action);
-
struct socketinfo {
struct socketinfo *next;
const char *name;
@@ -77,27 +73,29 @@ struct svcenvinfo {
const char *value;
};
-#define SVC_DISABLED 0x01 /* do not autostart with class */
-#define SVC_ONESHOT 0x02 /* do not restart on exit */
-#define SVC_RUNNING 0x04 /* currently active */
-#define SVC_RESTARTING 0x08 /* waiting to restart */
-#define SVC_CONSOLE 0x10 /* requires console */
-#define SVC_CRITICAL 0x20 /* will reboot into recovery if keeps crashing */
-#define SVC_RESET 0x40 /* Use when stopping a process, but not disabling
- so it can be restarted with its class */
-#define SVC_RC_DISABLED 0x80 /* Remember if the disabled flag was set in the rc script */
-#define SVC_RESTART 0x100 /* Use to safely restart (stop, wait, start) a service */
-#define SVC_DISABLED_START 0x200 /* a start was requested but it was disabled at the time */
+#define SVC_DISABLED 0x001 // do not autostart with class
+#define SVC_ONESHOT 0x002 // do not restart on exit
+#define SVC_RUNNING 0x004 // currently active
+#define SVC_RESTARTING 0x008 // waiting to restart
+#define SVC_CONSOLE 0x010 // requires console
+#define SVC_CRITICAL 0x020 // will reboot into recovery if keeps crashing
+#define SVC_RESET 0x040 // Use when stopping a process, but not disabling so it can be restarted with its class.
+#define SVC_RC_DISABLED 0x080 // Remember if the disabled flag was set in the rc script.
+#define SVC_RESTART 0x100 // Use to safely restart (stop, wait, start) a service.
+#define SVC_DISABLED_START 0x200 // A start was requested but it was disabled at the time.
+#define SVC_EXEC 0x400 // This synthetic service corresponds to an 'exec'.
#define NR_SVC_SUPP_GIDS 12 /* twelve supplementary groups */
#define COMMAND_RETRY_TIMEOUT 5
struct service {
+ void NotifyStateChange(const char* new_state);
+
/* list of all services */
struct listnode slist;
- const char *name;
+ char *name;
const char *classname;
unsigned flags;
@@ -105,19 +103,19 @@ struct service {
time_t time_started; /* time of last start */
time_t time_crashed; /* first crash within inspection window */
int nr_crashed; /* number of times crashed within window */
-
+
uid_t uid;
gid_t gid;
gid_t supp_gids[NR_SVC_SUPP_GIDS];
size_t nr_supp_gids;
- char *seclabel;
+ const char* seclabel;
struct socketinfo *sockets;
struct svcenvinfo *envvars;
struct action onrestart; /* Actions to execute on restart. */
-
+
/* keycodes for triggering this service via /dev/keychord */
int *keycodes;
int nkeycodes;
@@ -131,7 +129,13 @@ struct service {
char *args[1];
}; /* ^-------'args' MUST be at the end of this struct! */
-void notify_service_state(const char *name, const char *state);
+extern bool waiting_for_exec;
+extern struct selabel_handle *sehandle;
+extern struct selabel_handle *sehandle_prop;
+
+void build_triggers_string(char *name_str, int length, struct action *cur_action);
+
+void handle_control_message(const char *msg, const char *arg);
struct service *service_find_by_name(const char *name);
struct service *service_find_by_pid(pid_t pid);
@@ -147,9 +151,8 @@ void service_restart(struct service *svc);
void service_start(struct service *svc, const char *dynamic_args);
void property_changed(const char *name, const char *value);
-extern struct selabel_handle *sehandle;
-extern struct selabel_handle *sehandle_prop;
-extern int selinux_reload_policy(void);
+int selinux_reload_policy(void);
+
void zap_stdio(void);
#endif /* _INIT_INIT_H */