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
271096f2
Commit
271096f2
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
do not crash if service does not exist at stop process
parent
c8aada78
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib66/exec/ssexec_signal.c
+14
-3
14 additions, 3 deletions
src/lib66/exec/ssexec_signal.c
src/lib66/exec/ssexec_stop.c
+9
-2
9 additions, 2 deletions
src/lib66/exec/ssexec_stop.c
with
23 additions
and
5 deletions
src/lib66/exec/ssexec_signal.c
+
14
−
3
View file @
271096f2
...
...
@@ -241,9 +241,20 @@ int ssexec_signal(int argc, char const *const *argv, ssexec_t *info)
for
(;
*
argv
;
argv
++
)
{
int
aresid
=
service_resolve_array_search
(
ares
,
areslen
,
*
argv
)
;
if
(
aresid
<
0
)
log_die
(
LOG_EXIT_USER
,
"service: "
,
*
argv
,
" not available -- did you parse it?"
)
;
/** The service may not be supervised, for example serviceB depends on
* serviceA and serviceB by unsupervised by the user. So it will be ignored
* by the function graph_build_service. In this case, the service does not
* exist at array.
*
* At stop process, just ignore it as it already down anyway */
if
(
aresid
<
0
)
{
if
(
what
&&
data
[
1
]
!=
'r'
||
data
[
1
]
!=
'h'
)
{
log_warn
(
"service: "
,
*
argv
,
" not available -- ignoring it?"
)
;
continue
;
}
else
{
log_die
(
LOG_EXIT_USER
,
"service: "
,
*
argv
,
" not available -- did you parse it?"
)
;
}
}
graph_compute_visit
(
*
argv
,
visit
,
list
,
&
graph
,
&
napid
,
requiredby
)
;
}
...
...
This diff is collapsed.
Click to expand it.
src/lib66/exec/ssexec_stop.c
+
9
−
2
View file @
271096f2
...
...
@@ -105,9 +105,16 @@ int ssexec_stop(int argc, char const *const *argv, ssexec_t *info)
for
(;
n
<
argc
;
n
++
)
{
int
aresid
=
service_resolve_array_search
(
ares
,
areslen
,
argv
[
n
])
;
if
(
aresid
<
0
)
log_die
(
LOG_EXIT_USER
,
"service: "
,
argv
[
n
],
" not available -- did you started it?"
)
;
/** The service may not be supervised, so it will be ignored by the
* function graph_build_service. In this case, the service does not
* exist at array.
*
* This the stop process, just ignore it as it already down anyway */
if
(
aresid
<
0
)
{
log_warn
(
"service: "
,
argv
[
n
],
" is already stopped or unsupervised -- ignoring it?"
)
;
continue
;
}
graph_compute_visit
(
argv
[
n
],
visit
,
list
,
&
graph
,
&
nservice
,
1
)
;
}
...
...
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