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
f77a3259
Commit
f77a3259
authored
1 year ago
by
Eric Vidal
💬
Browse files
Options
Downloads
Patches
Plain Diff
fix recognition of earlier service
parent
e19e1b7e
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/sanitize/sanitize_init.c
+12
-10
12 additions, 10 deletions
src/lib66/sanitize/sanitize_init.c
src/lib66/sanitize/sanitize_scandir.c
+3
-1
3 additions, 1 deletion
src/lib66/sanitize/sanitize_scandir.c
with
15 additions
and
11 deletions
src/lib66/sanitize/sanitize_init.c
+
12
−
10
View file @
f77a3259
...
...
@@ -46,7 +46,7 @@ void sanitize_init(unsigned int *alist, unsigned int alen, graph_t *g, resolve_s
ftrigr_t
fifo
=
FTRIGR_ZERO
;
uint32_t
earlier
;
gid_t
gid
=
getgid
()
;
int
is_supervised
=
0
,
is_init
;
int
is_supervised
=
0
,
is_init
=
0
,
gearlier
=
0
;
unsigned
int
pos
=
0
,
nsv
=
0
;
unsigned
int
real
[
alen
]
;
unsigned
int
msg
[
areslen
]
;
...
...
@@ -78,6 +78,8 @@ void sanitize_init(unsigned int *alist, unsigned int alen, graph_t *g, resolve_s
if
(
is_init
<
0
||
service_is
(
&
sta
,
STATE_FLAGS_TOINIT
)
==
STATE_FLAGS_TRUE
)
sanitize_livestate
(
&
ares
[
aresid
])
;
if
(
earlier
)
gearlier
=
aresid
;
/**
* Bundle and module type are not a daemons. We don't need to supervise it.
* Special case for Oneshot, we only deal with the scandir symlink. */
...
...
@@ -101,12 +103,15 @@ void sanitize_init(unsigned int *alist, unsigned int alen, graph_t *g, resolve_s
}
/* down file */
char
downfile
[
scandirlen
+
6
]
;
auto_strings
(
downfile
,
scandir
,
"/down"
)
;
int
fd
=
open_trunc
(
downfile
)
;
if
(
fd
<
0
)
log_dieusys
(
LOG_EXIT_SYS
,
"create file: "
,
downfile
)
;
fd_close
(
fd
)
;
if
(
!
earlier
)
{
char
downfile
[
scandirlen
+
6
]
;
auto_strings
(
downfile
,
scandir
,
"/down"
)
;
int
fd
=
open_trunc
(
downfile
)
;
if
(
fd
<
0
)
log_dieusys
(
LOG_EXIT_SYS
,
"create file: "
,
downfile
)
;
fd_close
(
fd
)
;
}
if
(
!
earlier
&&
is_supervised
)
{
...
...
@@ -166,9 +171,6 @@ void sanitize_init(unsigned int *alist, unsigned int alen, graph_t *g, resolve_s
}
}
if
(
earlier
)
sanitize_scandir
(
&
ares
[
0
])
;
/**
* We pass through here even for Bundle, Module and Oneshot.
* We need to write the state file anyway. Thus can always
...
...
This diff is collapsed.
Click to expand it.
src/lib66/sanitize/sanitize_scandir.c
+
3
−
1
View file @
f77a3259
...
...
@@ -105,6 +105,7 @@ void sanitize_scandir(resolve_service_t *res)
int
r
;
char
*
name
=
res
->
sa
.
s
+
res
->
name
;
uint8_t
earlier
=
0
;
size_t
namelen
=
strlen
(
name
)
;
size_t
livelen
=
strlen
(
res
->
sa
.
s
+
res
->
live
.
livedir
)
;
size_t
scandirlen
=
livelen
+
SS_SCANDIR_LEN
+
1
+
strlen
(
res
->
sa
.
s
+
res
->
ownerstr
)
;
...
...
@@ -126,7 +127,8 @@ void sanitize_scandir(resolve_service_t *res)
compute_supervision_dir
(
res
)
;
if
(
service_is
(
&
sta
,
STATE_FLAGS_ISEARLIER
)
==
STATE_FLAGS_TRUE
)
{
earlier
=
service_is
(
&
sta
,
STATE_FLAGS_ISEARLIER
)
==
STATE_FLAGS_TRUE
?
1
:
0
;
if
(
!
earlier
)
{
if
(
svc_scandir_send
(
svcandir
,
"h"
)
<=
0
)
log_dieu
(
LOG_EXIT_SYS
,
"reload scandir: "
,
svcandir
)
;
...
...
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