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
911f13fd
Commit
911f13fd
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
remove new symlink at remove time
parent
7eca6663
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib66/exec/ssexec_remove.c
+11
-17
11 additions, 17 deletions
src/lib66/exec/ssexec_remove.c
with
11 additions
and
17 deletions
src/lib66/exec/ssexec_remove.c
+
11
−
17
View file @
911f13fd
...
...
@@ -15,6 +15,7 @@
#include
<string.h>
#include
<stdint.h>
#include
<stdlib.h>
#include
<unistd.h>
// unlink
#include
<oblibs/log.h>
#include
<oblibs/string.h>
...
...
@@ -46,16 +47,9 @@ static void auto_remove(char const *path)
static
void
remove_service
(
resolve_service_t
*
res
,
ssexec_t
*
info
)
{
int
r
;
char
*
path
=
0
;
char
sym
[
strlen
(
res
->
sa
.
s
+
res
->
path
.
home
)
+
SS_SYSTEM_LEN
+
SS_RESOLVE_LEN
+
SS_SERVICE_LEN
+
1
+
SS_MAX_SERVICE_NAME
+
1
]
;
path
=
realpath
(
res
->
sa
.
s
+
res
->
path
.
servicedir
,
0
)
;
if
(
!
path
)
log_dieusys
(
LOG_EXIT_SYS
,
"retrieve real path of: "
,
res
->
sa
.
s
+
res
->
path
.
servicedir
)
;
auto_remove
(
path
)
;
free
(
path
)
;
auto_remove
(
res
->
sa
.
s
+
res
->
path
.
servicedir
)
;
if
(
res
->
environ
.
envdir
)
auto_remove
(
res
->
sa
.
s
+
res
->
environ
.
envdir
)
;
...
...
@@ -71,13 +65,7 @@ static void remove_service(resolve_service_t *res, ssexec_t *info)
if
(
r
<=
0
)
log_dieusys
(
LOG_EXIT_SYS
,
"read resolve file of: "
,
res
->
sa
.
s
+
res
->
logger
.
name
)
;
path
=
realpath
(
lres
.
sa
.
s
+
lres
.
path
.
servicedir
,
0
)
;
if
(
!
path
)
log_dieusys
(
LOG_EXIT_SYS
,
"retrieve real path of: "
,
lres
.
sa
.
s
+
lres
.
path
.
servicedir
)
;
auto_remove
(
path
)
;
free
(
path
)
;
auto_remove
(
lres
.
sa
.
s
+
lres
.
path
.
servicedir
)
;
auto_remove
(
lres
.
sa
.
s
+
lres
.
logger
.
destination
)
;
...
...
@@ -88,6 +76,9 @@ static void remove_service(resolve_service_t *res, ssexec_t *info)
log_trace
(
"remove symlink: "
,
sym
)
;
unlink_void
(
sym
)
;
log_trace
(
"remove symlink: "
,
lres
.
sa
.
s
+
lres
.
live
.
scandir
)
;
unlink_void
(
lres
.
sa
.
s
+
lres
.
live
.
scandir
)
;
log_info
(
"removed successfully: "
,
lres
.
sa
.
s
+
lres
.
name
)
;
resolve_free
(
lwres
)
;
...
...
@@ -98,10 +89,12 @@ static void remove_service(resolve_service_t *res, ssexec_t *info)
log_trace
(
"remove symlink: "
,
sym
)
;
unlink_void
(
sym
)
;
log_trace
(
"remove symlink: "
,
res
->
sa
.
s
+
res
->
live
.
scandir
)
;
unlink_void
(
res
->
sa
.
s
+
res
->
live
.
scandir
)
;
log_info
(
"removed successfully: "
,
res
->
sa
.
s
+
res
->
name
)
;
}
int
ssexec_remove
(
int
argc
,
char
const
*
const
*
argv
,
ssexec_t
*
info
)
{
log_flow
()
;
...
...
@@ -166,7 +159,7 @@ int ssexec_remove(int argc, char const *const *argv, ssexec_t *info)
if
(
!
state_read
(
&
ste
,
&
res
))
log_dieusys
(
LOG_EXIT_SYS
,
"read state file of: "
,
argv
[
pos
],
" -- please make a bug report"
)
;
if
(
s
ervice_is
(
&
ste
,
STATE_FLAGS_ISSUPERVISED
)
==
STATE_FLAGS_TRUE
)
if
(
s
te
.
issupervised
==
STATE_FLAGS_TRUE
)
if
(
!
sastr_add_string
(
&
sa
,
argv
[
pos
]))
log_dieusys
(
LOG_EXIT_SYS
,
"add service: "
,
argv
[
pos
],
" to selection"
)
;
...
...
@@ -238,6 +231,7 @@ int ssexec_remove(int argc, char const *const *argv, ssexec_t *info)
resolve_free
(
mwres
)
;
}
/** remove directory made by the module at configuration time */
char
dir
[
SS_MAX_PATH_LEN
+
1
]
;
if
(
!
info
->
owner
)
{
...
...
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