Skip to content
Snippets Groups Projects
Commit fa09d9dc authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

rename rescan scandir subcommand to check, remove halt scandir subcommand

parent 7293e538
No related branches found
No related tags found
No related merge requests found
Pipeline #13212 passed
......@@ -201,12 +201,10 @@ extern char const *usage_scandir_stop ;
extern char const *help_scandir_stop ;
extern char const *usage_scandir_reconfigure ;
extern char const *help_scandir_reconfigure ;
extern char const *usage_scandir_rescan ;
extern char const *help_scandir_rescan ;
extern char const *usage_scandir_check ;
extern char const *help_scandir_check ;
extern char const *usage_scandir_quit ;
extern char const *help_scandir_quit ;
extern char const *usage_scandir_halt ;
extern char const *help_scandir_halt ;
extern char const *usage_scandir_abort ;
extern char const *help_scandir_abort ;
extern char const *usage_scandir_nuke ;
......
......@@ -185,7 +185,7 @@ char const *help_free =
" -P: do not propagate signal to its dependencies\n"
;
char const *usage_status = "66 status [ -h ] [ -n ] [ -o name,intree,status,... ] [ -g ] [ -d depth ] [ -r ] [ -p nline ] service..." ;
char const *usage_status = "66 status [ -h ] [ -n ] [ -o name,intree,status,... ] [ -g ] [ -d depth ] [ -r ] [ -p nline ] service" ;
char const *help_status =
"\ndisplay services informations\n"
......@@ -207,10 +207,15 @@ char const *help_status =
" status: displays the status\n"
" type: displays the service type\n"
" description: displays the description\n"
" partof: displays the module name for services part of that module\n"
" notify: displays the number of the fd for readiness notification\n"
" maxdeath: displays the number of maximum death\n"
" earlier: tell if service is an earlier one\n"
" source: displays the source of the service's frontend file\n"
" live: displays the service's live directory\n"
" depends: displays the service's dependencies\n"
" requiredby: displays the service(s) which depends on service\n"
" contents: displays services within module\n"
" optsdepends: displays the service's optional dependencies\n"
" start: displays the service's start script\n"
" stop: displays the service's stop script\n"
......@@ -465,7 +470,7 @@ char const *help_tree_unsupervise =
"If no tree name are provided, it unsupervise all services within all trees of the system\n"
;
char const *usage_scandir_wrapper = "66 scandir [ -h ] [ -o owner ] create|remove|start|stop|reconfigure|rescan|quit|halt|abort|nuke|annihilate|zombies [<command options>]" ;
char const *usage_scandir_wrapper = "66 scandir [ -h ] [ -o owner ] create|start|stop|remove|reload|check|quit|abort|nuke|annihilate|zombies [<command options>]" ;
char const *help_scandir_wrapper =
"\nmain subcommands to manage scandir\n"
......@@ -476,13 +481,12 @@ char const *help_scandir_wrapper =
"\n"
"subcommand:\n"
" create: create a scandir\n"
" remove: remove a scandir\n"
" start: start a scandir\n"
" stop: stop a running scandir\n"
" reconfigure: reconfigure a running scandir\n"
" rescan: rescan a running scandir\n"
" remove: remove a scandir\n"
" reload: reload a running scandir\n"
" check: check a running scandir\n"
" quit: quit a running scandir\n"
" halt: halt a running scandir\n"
" abort: abort a running scandir\n"
" nuke: nuke a running scandir\n"
" annihilate: annihilate a running scandir\n"
......@@ -524,8 +528,8 @@ char const *help_scandir_start =
" -d notif: notify readiness on file descriptor notif\n"
" -s rescan: scan scandir every rescan milliseconds\n"
" -e environment: use environment as environment directory\n"
" -b: create scandir (if it not exist yet) for a boot process\n"
" -B: create scandir (if it not exist yet) for a boot process inside a container\n"
" -b: create scandir (if it doesn't exist yet) for a boot process\n"
" -B: create scandir (if it doesn't exist yet) for a boot process inside a container\n"
;
char const *usage_scandir_stop = "66 scandir stop [ -h ]" ;
......@@ -546,10 +550,10 @@ char const *help_scandir_reconfigure =
" -h: print this help\n"
;
char const *usage_scandir_rescan = "66 scandir rescan [ -h ]" ;
char const *usage_scandir_check = "66 scandir check [ -h ]" ;
char const *help_scandir_rescan =
"\nrescan a running scandir to integrate new services\n"
char const *help_scandir_check =
"\ncheck a running scandir for services\n"
"\n"
"options:\n"
" -h: print this help\n"
......@@ -564,15 +568,6 @@ char const *help_scandir_quit =
" -h: print this help\n"
;
char const *usage_scandir_halt = "66 scandir halt [ -h ]" ;
char const *help_scandir_halt =
"\nhalt a running scandir\n"
"\n"
"options:\n"
" -h: print this help\n"
;
char const *usage_scandir_abort = "66 scandir abort [ -h ]" ;
char const *help_scandir_abort =
......
......@@ -57,10 +57,9 @@ static inline unsigned int parse_signal (char const *signal)
{
"start",
"stop", // -t
"reconfigure", // -h or -an
"rescan", // -a
"reload", // -h or -an
"check", // -a
"quit", // -q
"halt", // -qb
"abort", // -b
"nuke", // -n
"annihilate", // -N
......@@ -68,7 +67,7 @@ static inline unsigned int parse_signal (char const *signal)
0
} ;
unsigned int i = lookup(signal_table, signal) ;
if (!signal_table[i]) i = 10 ;
if (!signal_table[i]) i = 9 ;
return i ;
}
......@@ -99,14 +98,14 @@ static int send_signal(char const *scandir, char const *signal)
csig[1] = 0 ;
break ;
case 2: // reconfigure
case 2: // reload
csig[0] = 'h' ;
csig[1] = 0 ;
down = 1 ;
break ;
case 3: // rescan
case 3: // check
csig[0] = 'a' ;
csig[1] = 0 ;
......@@ -119,32 +118,25 @@ static int send_signal(char const *scandir, char const *signal)
csig[1] = 0 ;
break ;
case 5: // halt
csig[0] = 'q' ;
csig[1] = 'b' ;
csig[2] = 0 ;
break ;
case 6: // abort
case 5: // abort
csig[0] = 'b' ;
csig[1] = 0 ;
break ;
case 7: // nuke
case 6: // nuke
csig[0] = 'n' ;
csig[1] = 0 ;
break ;
case 8: // annihilate
case 7: // annihilate
csig[0] = 'N' ;
csig[1] = 0 ;
break ;
case 9: // zombies
case 8: // zombies
csig[0] = 'z' ;
csig[1] = 0 ;
......
......@@ -134,33 +134,23 @@ int ssexec_scandir_wrapper(int argc, char const *const *argv, ssexec_t *info)
info->usage = usage_scandir_reconfigure ;
func = &ssexec_scandir_signal ;
} else if (!strcmp(argv[0], "rescan")) {
} else if (!strcmp(argv[0], "check")) {
nargv[n++] = PROG ;
nargv[n++] = argv[0] ;
info->prog = PROG ;
info->help = help_scandir_rescan ;
info->usage = usage_scandir_rescan ;
info->help = help_scandir_check ;
info->usage = usage_scandir_check ;
func = &ssexec_scandir_signal ;
} else if (!strcmp(argv[0], "quit")) {
nargv[n++] = argv[0] ;
info->prog = PROG ;
info->help = help_scandir_quit ;
info->usage = usage_scandir_quit ;
func = &ssexec_scandir_signal ;
} else if (!strcmp(argv[0], "halt")) {
nargv[n++] = argv[0] ;
info->prog = PROG ;
info->help = help_scandir_halt ;
info->usage = usage_scandir_halt ;
func = &ssexec_scandir_signal ;
} else if (!strcmp(argv[0], "abort")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment