From 23199f6205b059df995599ddf10124010af98d7d Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Fri, 13 Nov 2015 11:26:56 +0100 Subject: [PATCH] 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 --- minix/commands/service/service.c | 21 ++++++++++++++++----- minix/include/minix/rs.h | 2 ++ minix/servers/rs/exec.c | 7 ++----- minix/servers/rs/main.c | 4 +++- minix/servers/rs/manager.c | 25 ++++++++++--------------- minix/servers/rs/proto.h | 4 ++-- minix/usr.bin/trace/service/rs.c | 2 ++ 7 files changed, 37 insertions(+), 28 deletions(-) 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