From: David van Moolenbroek Date: Fri, 13 Nov 2015 10:26:56 +0000 (+0100) Subject: RS: allow service program name to be overridden X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=23199f6205b059df995599ddf10124010af98d7d;p=minix.git RS: allow service program name to be overridden Until now, the program name of a service was always the file name (without directory) of the service binary. The program name is used to, among other things, find the corresponding system.conf entry. With ASR moving to a situation where all rerandomized service binaries are stored in a single directory, this can no longer be maintained. Instead, the service(8) command can now be instructed to override the service program name, using its new -progname option. Change-Id: I981e9b35232c88048d8804ec5eca58d1e4a5db82 --- diff --git a/minix/commands/service/service.c b/minix/commands/service/service.c index b9e44077d..9b185e30c 100644 --- a/minix/commands/service/service.c +++ b/minix/commands/service/service.c @@ -123,6 +123,7 @@ static int known_request_types[] = { * system service */ #define ARG_LABELNAME "-label" /* custom label name */ +#define ARG_PROGNAME "-progname" /* custom program name */ #define ARG_CONFIG "-config" /* name of the file with the resource * configuration */ @@ -149,6 +150,7 @@ static char *req_label = NULL; static char *req_trg_label = NULL; static char *req_path = NULL; static char *req_path_self = SELF_REQ_PATH; +static char *req_progname = NULL; static char *req_args = ""; static int req_major = 0; static int devman_id = 0; @@ -177,14 +179,14 @@ static void print_usage(char *app_name, char *problem) fprintf(stderr, "Warning, %s\n", problem); fprintf(stderr, "Usage:\n"); fprintf(stderr, - " %s [%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s] (up|run|edit|update) [%s ] [%s ] [%s ] [%s ] [%s ] [%s ] [%s ] [%s ] [%s ] [%s