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
cb8008a3
Commit
cb8008a3
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
remove logger supports
parent
8d51c52d
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/include/66/svc.h
+1
-1
1 addition, 1 deletion
src/include/66/svc.h
src/lib66/svc/svc_unsupervise.c
+13
-28
13 additions, 28 deletions
src/lib66/svc/svc_unsupervise.c
with
14 additions
and
29 deletions
src/include/66/svc.h
+
1
−
1
View file @
cb8008a3
...
...
@@ -55,7 +55,7 @@ extern int svc_compute_ns(resolve_service_t *res, uint8_t what, ssexec_t *info,
extern
int
svc_scandir_ok
(
char
const
*
dir
)
;
extern
int
svc_scandir_send
(
char
const
*
scandir
,
char
const
*
signal
)
;
extern
int
svc_send_wait
(
char
const
*
const
*
list
,
unsigned
int
nservice
,
char
**
sig
,
unsigned
int
siglen
,
ssexec_t
*
info
)
;
extern
void
svc_unsupervise
(
unsigned
int
*
alist
,
unsigned
int
alen
,
graph_t
*
g
,
resolve_service_t
*
ares
,
unsigned
int
areslen
)
;
extern
void
svc_unsupervise
(
unsigned
int
*
alist
,
unsigned
int
alen
,
graph_t
*
g
,
resolve_service_t
*
ares
,
unsigned
int
areslen
,
ssexec_t
*
info
)
;
extern
void
svc_send_fdholder
(
char
const
*
socket
,
char
const
*
signal
)
;
#endif
This diff is collapsed.
Click to expand it.
src/lib66/svc/svc_unsupervise.c
+
13
−
28
View file @
cb8008a3
...
...
@@ -15,54 +15,42 @@
#include
<oblibs/log.h>
#include
<oblibs/sastr.h>
#include
<skalibs/genalloc.h>
#include
<66/state.h>
#include
<66/sanitize.h>
#include
<66/graph.h>
#include
<66/svc.h>
#include
<66/enum.h>
#include
<66/symlink.h>
#include
<66/constants.h>
static
void
sanitize_it
(
resolve_service_t
*
res
)
{
log_flow
()
;
ss_state_t
sta
=
STATE_ZERO
;
s
anitize_fdholder
(
res
,
STATE_FLAGS_FALSE
)
;
s
s_state_t
sta
=
STATE_ZERO
;
if
(
!
state_read
(
&
sta
,
res
))
log_dieu
(
LOG_EXIT_SYS
,
"read state file of: "
,
res
->
sa
.
s
+
res
->
name
)
;
sanitize_fdholder
(
res
,
&
sta
,
STATE_FLAGS_FALSE
)
;
state_set_flag
(
&
sta
,
STATE_FLAGS_TOUNSUPERVISE
,
STATE_FLAGS_TRUE
)
;
state_set_flag
(
&
sta
,
STATE_FLAGS_ISUP
,
STATE_FLAGS_FALSE
)
;
if
(
!
state_write
(
&
sta
,
res
))
log_dieu
(
LOG_EXIT_SYS
,
"write state file of: "
,
res
->
sa
.
s
+
res
->
name
)
;
sanitize_scandir
(
res
)
;
sanitize_livestate
(
res
)
;
sanitize_scandir
(
res
,
&
sta
)
;
log_info
(
"Unsupervised successfully: "
,
res
->
sa
.
s
+
res
->
name
)
;
}
static
void
unsupervise_logger
(
unsigned
int
idx
,
resolve_service_t
*
ares
,
unsigned
int
areslen
)
{
log_flow
()
;
state_set_flag
(
&
sta
,
STATE_FLAGS_TOUNSUPERVISE
,
STATE_FLAGS_TRUE
)
;
if
(
ares
[
idx
].
logger
.
want
&&
ares
[
idx
].
type
==
TYPE_CLASSIC
)
{
sanitize_livestate
(
res
,
&
sta
)
;
char
*
name
=
ares
[
idx
].
sa
.
s
+
ares
[
idx
].
logger
.
name
;
int
aresid
=
service_resolve_array_search
(
ares
,
areslen
,
name
)
;
if
(
aresid
<
0
)
log_dieu
(
LOG_EXIT_SYS
,
"find ares id of: "
,
name
,
" -- please make a bug reports"
)
;
if
(
!
symlink_switch
(
res
,
SYMLINK_SOURCE
))
log_dieusys
(
LOG_EXIT_SYS
,
"switch service symlink to source for: "
,
res
->
sa
.
s
+
res
->
name
)
;
sanitize_it
(
&
ares
[
aresid
])
;
}
log_info
(
"Unsupervised successfully: "
,
res
->
sa
.
s
+
res
->
name
)
;
}
/** this function considers that the service is already down */
void
svc_unsupervise
(
unsigned
int
*
alist
,
unsigned
int
alen
,
graph_t
*
g
,
resolve_service_t
*
ares
,
unsigned
int
areslen
)
/** this function considers that the service is already down
except for the logger
*/
void
svc_unsupervise
(
unsigned
int
*
alist
,
unsigned
int
alen
,
graph_t
*
g
,
resolve_service_t
*
ares
,
unsigned
int
areslen
,
ssexec_t
*
info
)
{
log_flow
()
;
...
...
@@ -83,8 +71,6 @@ void svc_unsupervise(unsigned int *alist, unsigned int alen, graph_t *g, resolve
sanitize_it
(
&
ares
[
aresid
])
;
unsupervise_logger
(
aresid
,
ares
,
areslen
)
;
if
((
ares
[
aresid
].
type
==
TYPE_BUNDLE
||
ares
[
aresid
].
type
==
TYPE_MODULE
)
&&
ares
[
aresid
].
dependencies
.
ncontents
)
{
sa
.
len
=
0
,
bpos
=
0
;
...
...
@@ -102,7 +88,6 @@ void svc_unsupervise(unsigned int *alist, unsigned int alen, graph_t *g, resolve
}
}
}
stralloc_free
(
&
sa
)
;
}
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