Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eric Vidal
66
Commits
8a60ce56
Commit
8a60ce56
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
Do not initiate trees services. This is done by start command.
rename up/down subcommand to start/stop.
parent
172933cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/lib66/exec/ssexec_help.c
+7
-7
7 additions, 7 deletions
src/lib66/exec/ssexec_help.c
src/lib66/exec/ssexec_tree_signal.c
+8
-32
8 additions, 32 deletions
src/lib66/exec/ssexec_tree_signal.c
src/lib66/exec/ssexec_tree_wrapper.c
+6
-6
6 additions, 6 deletions
src/lib66/exec/ssexec_tree_wrapper.c
with
21 additions
and
45 deletions
src/lib66/exec/ssexec_help.c
+
7
−
7
View file @
8a60ce56
...
...
@@ -292,7 +292,7 @@ char const *help_signal =
" -r : restart service by sending it a signal(default SIGTERM)
\n
"
;
char
const
*
usage_tree_wrapper
=
"66 tree [ -h ] create|admin|remove|enable|disable|current|status|resolve|
up|down
|unsupervise [<command options>] tree"
;
char
const
*
usage_tree_wrapper
=
"66 tree [ -h ] create|admin|remove|enable|disable|current|status|resolve|
start|stop
|unsupervise [<command options>] tree"
;
char
const
*
help_tree_wrapper
=
"
\n
main sub tools to manages trees
\n
"
...
...
@@ -309,8 +309,8 @@ char const *help_tree_wrapper =
" current: mark tree as current
\n
"
" status: display information about tree
\n
"
" resolve: display resolve file of tree
\n
"
"
up
: bring up all services from tree
\n
"
"
down
: bring down all services from tree
\n
"
"
start
: bring up all services from tree
\n
"
"
stop
: bring down all services from tree
\n
"
" unsupervise: bring down and unsupervise all services from tree
\n
"
"
\n
"
"Use '66 tree <command> -h' to see command options
\n
"
...
...
@@ -428,9 +428,9 @@ char const *help_tree_status =
"If no tree name are provided, it display all trees from the system
\n
"
;
char
const
*
usage_tree_
up
=
"66 tree
up
[ -h ] [ -f ] tree"
;
char
const
*
usage_tree_
start
=
"66 tree
start
[ -h ] [ -f ] tree"
;
char
const
*
help_tree_
up
=
char
const
*
help_tree_
start
=
"
\n
bring up all enabled services of tree
\n
"
"
\n
"
"options:
\n
"
...
...
@@ -440,9 +440,9 @@ char const *help_tree_up =
"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_
stop
=
"66 tree
stop
[ -h ] [ -f ] tree"
;
char
const
*
help_tree_
down
=
char
const
*
help_tree_
stop
=
"
\n
bring down all services of tree
\n
"
"
\n
"
"options:
\n
"
...
...
This diff is collapsed.
Click to expand it.
src/lib66/exec/ssexec_tree_signal.c
+
8
−
32
View file @
8a60ce56
...
...
@@ -45,6 +45,7 @@
#include
<66/svc.h>
//scandir_ok
#include
<66/utils.h>
#include
<66/graph.h>
#include
<66/state.h>
#include
<s6/ftrigr.h>
#include
<s6/ftrigw.h>
...
...
@@ -144,8 +145,8 @@ static inline unsigned int parse_signal (char const *signal, ssexec_t *info)
log_flow
()
;
static
char
const
*
const
signal_table
[]
=
{
"
up
"
,
"
down
"
,
"
start
"
,
"
stop
"
,
"unsupervise"
,
0
}
;
...
...
@@ -524,31 +525,6 @@ static int doit(char const *treename, ssexec_t *sinfo, unsigned int what, tain *
log_warn_return
(
LOG_EXIT_ZERO
,
"You're not allowed to use the tree: "
,
info
.
treename
.
s
)
;
}
if
(
!
tree_isinitialized
(
info
.
base
.
s
,
info
.
treename
.
s
)
&&
!
what
)
{
if
(
!
what
)
{
int
nargc
=
3
;
char
const
*
prog
=
PROG
;
char
const
*
newargv
[
nargc
]
;
unsigned
int
m
=
0
;
newargv
[
m
++
]
=
"signal"
;
newargv
[
m
++
]
=
info
.
treename
.
s
;
newargv
[
m
++
]
=
0
;
PROG
=
"init"
;
if
(
ssexec_init
(
nargc
,
newargv
,
&
info
))
log_warnu_return
(
LOG_EXIT_ZERO
,
"initiate services of tree: "
,
info
.
treename
.
s
)
;
PROG
=
prog
;
}
else
{
log_warn
(
"uninitialized tree: "
,
info
.
treename
.
s
)
;
goto
end
;
}
}
{
stralloc
sa
=
STRALLOC_ZERO
;
...
...
@@ -571,8 +547,8 @@ static int doit(char const *treename, ssexec_t *sinfo, unsigned int what, tain *
stralloc_free
(
&
sa
)
;
}
end:
e
=
0
;
e
=
0
;
err:
ssexec_free
(
&
info
)
;
return
e
;
...
...
@@ -746,7 +722,7 @@ static int async(pidtree_t *apidt, unsigned int i, unsigned int what, ssexec_t *
}
else
{
/** do not notify here, the handle will make it for us */
log_trace
(
"skipping
servic
e: "
,
name
,
" -- already "
,
what
?
"down"
:
"up"
)
;
log_trace
(
"skipping
tre
e: "
,
name
,
" -- already "
,
what
?
"down"
:
"up"
)
;
}
...
...
@@ -790,7 +766,7 @@ static int waitit(pidtree_t *apidt, unsigned int what, graph_t *graph, tain *dea
}
for
(
pos
=
0
;
pos
<
napid
;
pos
++
)
{
for
(
pos
=
0
;
pos
<
napid
;
pos
++
)
{
pid
=
fork
()
;
...
...
@@ -903,7 +879,7 @@ int ssexec_tree_signal(int argc, char const *const *argv, ssexec_t *info)
if
((
svc_scandir_ok
(
info
->
scandir
.
s
))
<=
0
)
log_die
(
LOG_EXIT_SYS
,
"scandir: "
,
info
->
scandir
.
s
,
" is not running"
)
;
graph_build_tree
(
&
graph
,
info
->
base
.
s
,
!
info
->
treename
.
len
?
E_RESOLVE_TREE_MASTER_ENABLED
:
E_RESOLVE_TREE_CONTENTS
)
;
graph_build_tree
(
&
graph
,
info
->
base
.
s
,
!
info
->
treename
.
len
?
E_RESOLVE_TREE_MASTER_ENABLED
:
E_RESOLVE_TREE_
MASTER_
CONTENTS
)
;
if
(
!
graph
.
mlen
)
log_die
(
LOG_EXIT_USER
,
"trees selection is not created -- creates at least one tree"
)
;
...
...
This diff is collapsed.
Click to expand it.
src/lib66/exec/ssexec_tree_wrapper.c
+
6
−
6
View file @
8a60ce56
...
...
@@ -139,19 +139,19 @@ int ssexec_tree_wrapper(int argc, char const *const *argv, ssexec_t *info)
argc
--
;
argv
++
;
}
else
if
(
!
strcmp
(
argv
[
1
],
"
up
"
))
{
}
else
if
(
!
strcmp
(
argv
[
1
],
"
start
"
))
{
info
->
prog
=
PROG
;
info
->
help
=
help_tree_
up
;
info
->
usage
=
usage_tree_
up
;
info
->
help
=
help_tree_
start
;
info
->
usage
=
usage_tree_
start
;
func
=
&
ssexec_tree_signal
;
ctl
++
;
}
else
if
(
!
strcmp
(
argv
[
1
],
"
down
"
))
{
}
else
if
(
!
strcmp
(
argv
[
1
],
"
stop
"
))
{
info
->
prog
=
PROG
;
info
->
help
=
help_tree_
down
;
info
->
usage
=
usage_tree_
down
;
info
->
help
=
help_tree_
stop
;
info
->
usage
=
usage_tree_
stop
;
func
=
&
ssexec_tree_signal
;
ctl
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment