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

sanitize the graph of the system at every service parsing, remove -F option,...

sanitize the graph of the system at every service parsing, remove -F option, force to use unsupervise command instead of -u at stop command
parent e46e2f84
No related branches found
No related tags found
No related merge requests found
...@@ -106,7 +106,7 @@ char const *help_start = ...@@ -106,7 +106,7 @@ char const *help_start =
" -P: do not propagate signal to its dependencies\n" " -P: do not propagate signal to its dependencies\n"
; ;
char const *usage_stop = "66 stop [ -h ] [ -P ] [ -u ] service..." ; char const *usage_stop = "66 stop [ -h ] [ -P ] service..." ;
char const *help_stop = char const *help_stop =
"\nbring down services\n" "\nbring down services\n"
...@@ -114,7 +114,6 @@ char const *help_stop = ...@@ -114,7 +114,6 @@ char const *help_stop =
"options:\n" "options:\n"
" -h: print this help\n" " -h: print this help\n"
" -P: do not propagate signal to its requiredby\n" " -P: do not propagate signal to its requiredby\n"
" -u: unsupervise service(s)\n"
; ;
char const *usage_env = "66 env [ -h ] [ -c version ] [ -s version ] [ -V|L ] [ -r key=value ] [ -i src,dst ] [ -e editor ] service" ; char const *usage_env = "66 env [ -h ] [ -c version ] [ -s version ] [ -V|L ] [ -r key=value ] [ -i src,dst ] [ -e editor ] service" ;
...@@ -142,7 +141,7 @@ char const *help_init = ...@@ -142,7 +141,7 @@ char const *help_init =
" -h: print this help\n" " -h: print this help\n"
; ;
char const *usage_parse = "66 parse [ -h ] [ -f|F ] [ -I ] service..." ; char const *usage_parse = "66 parse [ -h ] [ -f ] [ -I ] service..." ;
char const *help_parse = char const *help_parse =
"\nparse a frontend service file and install its result to resolve files\n" "\nparse a frontend service file and install its result to resolve files\n"
...@@ -150,7 +149,6 @@ char const *help_parse = ...@@ -150,7 +149,6 @@ char const *help_parse =
"options:\n" "options:\n"
" -h: print this help\n" " -h: print this help\n"
" -f: force to overwrite existing destination\n" " -f: force to overwrite existing destination\n"
" -F: also force to overwrite its dependencies\n"
" -I: do not import modified configuration files from previous version\n" " -I: do not import modified configuration files from previous version\n"
; ;
...@@ -373,6 +371,8 @@ char const *help_tree_up = ...@@ -373,6 +371,8 @@ char const *help_tree_up =
"options:\n" "options:\n"
" -h: print this help\n" " -h: print this help\n"
" -f: fork the process\n" " -f: fork the process\n"
"\n"
"If no tree name are provided, it bring up all enabled trees from the system\n"
; ;
char const *usage_tree_down = "66 tree down [ -h ] [ -f ] tree" ; char const *usage_tree_down = "66 tree down [ -h ] [ -f ] tree" ;
...@@ -383,6 +383,8 @@ char const *help_tree_down = ...@@ -383,6 +383,8 @@ char const *help_tree_down =
"options:\n" "options:\n"
" -h: print this help\n" " -h: print this help\n"
" -f: fork the process\n" " -f: fork the process\n"
"\n"
"If no tree name are provided, it bring down all enabled trees from the system\n"
; ;
char const *usage_tree_unsupervise = "66 tree unsupervise [ -h ] [ -f ] tree" ; char const *usage_tree_unsupervise = "66 tree unsupervise [ -h ] [ -f ] tree" ;
...@@ -393,6 +395,8 @@ char const *help_tree_unsupervise = ...@@ -393,6 +395,8 @@ char const *help_tree_unsupervise =
"options:\n" "options:\n"
" -h: print this help\n" " -h: print this help\n"
" -f: fork the process\n" " -f: fork the process\n"
"\n"
"If no tree name are provided, it unsupervise all enabled trees from the system\n"
; ;
char const *usage_service_wrapper = "66 service [ -h ] status|resolve|state|remove [<command options>] service..." ; char const *usage_service_wrapper = "66 service [ -h ] status|resolve|state|remove [<command options>] service..." ;
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <66/parser.h> #include <66/parser.h>
#include <66/ssexec.h> #include <66/ssexec.h>
#include <66/utils.h> #include <66/utils.h>
#include <66/sanitize.h>
int ssexec_parse(int argc, char const *const *argv, ssexec_t *info) int ssexec_parse(int argc, char const *const *argv, ssexec_t *info)
{ {
...@@ -57,19 +58,12 @@ int ssexec_parse(int argc, char const *const *argv, ssexec_t *info) ...@@ -57,19 +58,12 @@ int ssexec_parse(int argc, char const *const *argv, ssexec_t *info)
force = 1 ; force = 1 ;
break ; break ;
case 'F' :
/** force to rewrite it dependencies */
if (force)
log_usage(info->usage, "\n", info->help) ;
force = 2 ;
break ;
case 'I' : case 'I' :
conf = 1 ; conf = 1 ;
break ; break ;
case 'F' : log_1_warn("deprecated option -- ignoring") ; break ;
case 'c' : log_1_warn("deprecated option -- ignoring") ; break ; case 'c' : log_1_warn("deprecated option -- ignoring") ; break ;
case 'm' : log_1_warn("deprecated option -- ignoring") ; break ; case 'm' : log_1_warn("deprecated option -- ignoring") ; break ;
case 'C' : log_1_warn("deprecated option -- ignoring") ; break ; case 'C' : log_1_warn("deprecated option -- ignoring") ; break ;
...@@ -119,6 +113,8 @@ int ssexec_parse(int argc, char const *const *argv, ssexec_t *info) ...@@ -119,6 +113,8 @@ int ssexec_parse(int argc, char const *const *argv, ssexec_t *info)
parse_service(sa.s + pos, info, force, conf) ; parse_service(sa.s + pos, info, force, conf) ;
} }
sanitize_graph(info) ;
stralloc_free(&sa) ; stralloc_free(&sa) ;
return 0 ; return 0 ;
......
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