diff options
Diffstat (limited to 'init')
-rwxr-xr-x | init/init.c | 6 | ||||
-rw-r--r-- | init/init.h | 1 | ||||
-rw-r--r-- | init/init_parser.c | 1 | ||||
-rw-r--r-- | init/property_service.c | 15 |
4 files changed, 7 insertions, 16 deletions
diff --git a/init/init.c b/init/init.c index 7b4a963..d10ca47 100755 --- a/init/init.c +++ b/init/init.c @@ -315,7 +315,11 @@ static void service_stop_or_reset(struct service *svc, int how) /* if the service has not yet started, prevent * it from auto-starting with its class */ - svc->flags |= how; + if (how == SVC_RESET) { + svc->flags |= (svc->flags & SVC_RC_DISABLED) ? SVC_DISABLED : SVC_RESET; + } else { + svc->flags |= how; + } if (svc->pid) { NOTICE("service '%s' is being killed\n", svc->name); diff --git a/init/init.h b/init/init.h index 2d98c7c..a91d9d4 100644 --- a/init/init.h +++ b/init/init.h @@ -71,6 +71,7 @@ struct svcenvinfo { #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 NR_SVC_SUPP_GIDS 12 /* twelve supplementary groups */ diff --git a/init/init_parser.c b/init/init_parser.c index fa813b9..13c94eb 100644 --- a/init/init_parser.c +++ b/init/init_parser.c @@ -499,6 +499,7 @@ static void parse_line_service(struct parse_state *state, int nargs, char **args break; case K_disabled: svc->flags |= SVC_DISABLED; + svc->flags |= SVC_RC_DISABLED; break; case K_ioprio: if (nargs != 3) { diff --git a/init/property_service.c b/init/property_service.c index 6733437..687de6d 100644 --- a/init/property_service.c +++ b/init/property_service.c @@ -338,21 +338,6 @@ int property_set(const char *name, const char *value) return 0; } -static int property_list(void (*propfn)(const char *key, const char *value, void *cookie), - void *cookie) -{ - char name[PROP_NAME_MAX]; - char value[PROP_VALUE_MAX]; - const prop_info *pi; - unsigned n; - - for(n = 0; (pi = __system_property_find_nth(n)); n++) { - __system_property_read(pi, name, value); - propfn(name, value, cookie); - } - return 0; -} - void handle_property_set_fd() { prop_msg msg; |