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
5994ca8f
Commit
5994ca8f
authored
6 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
s6-rc-update make already a rollback
parent
25bbad4e
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/db_switch_to.c
+14
-12
14 additions, 12 deletions
src/lib66/db_switch_to.c
with
14 additions
and
12 deletions
src/lib66/db_switch_to.c
+
14
−
12
View file @
5994ca8f
...
...
@@ -47,7 +47,7 @@ int db_switch_to(ssexec_t *info, char const *const *envp,unsigned int where)
r
=
backup_cmd_switcher
(
VERBOSITY
,
cmd
,
info
)
;
if
(
r
<
0
)
{
VERBO3
strerr_warnwu2sys
(
"find
origin of db service for
: "
,
info
->
treename
.
s
)
;
VERBO3
strerr_warnwu2sys
(
"find
realpath of symlink for db of tree
: "
,
info
->
treename
.
s
)
;
goto
err
;
}
// point to origin
...
...
@@ -59,13 +59,13 @@ int db_switch_to(ssexec_t *info, char const *const *envp,unsigned int where)
VERBO3
strerr_warnwu2sys
(
"make a backup of db service for: "
,
info
->
treename
.
s
)
;
goto
err
;
}
VERBO3
strerr_warnt3x
(
"switch db s
ervice for
tree: "
,
info
->
treename
.
s
,
" to backup"
)
;
VERBO3
strerr_warnt3x
(
"switch db s
ymlink of
tree: "
,
info
->
treename
.
s
,
" to backup"
)
;
memcpy
(
cmd
+
cmdlen
,
" -s1"
,
4
)
;
cmd
[
cmdlen
+
4
]
=
0
;
r
=
backup_cmd_switcher
(
VERBOSITY
,
cmd
,
info
)
;
if
(
r
<
0
)
{
VERBO3
strerr_warnwu3sys
(
"switch db s
ervice for
: "
,
info
->
treename
.
s
,
" to backup"
)
;
VERBO3
strerr_warnwu3sys
(
"switch db s
ymlink of tree
: "
,
info
->
treename
.
s
,
" to backup"
)
;
goto
err
;
}
if
(
db_ok
(
info
->
livetree
.
s
,
info
->
treename
.
s
))
...
...
@@ -83,11 +83,13 @@ int db_switch_to(ssexec_t *info, char const *const *envp,unsigned int where)
r
=
backup_cmd_switcher
(
VERBOSITY
,
cmd
,
info
)
;
if
(
r
<
0
)
{
VERBO3
strerr_warnwu3sys
(
"switch db s
ervice for
: "
,
info
->
treename
.
s
,
" to source"
)
;
VERBO3
strerr_warnwu3sys
(
"switch db s
ymlink of tree
: "
,
info
->
treename
.
s
,
" to source"
)
;
goto
err
;
}
db
=
stralloc_zero
;
if
(
!
backup_realpath_sym
(
&
db
,
info
,
LONGRUN
))
//db.len = 0 ;
/** in case of crash s6-rc-update copy again the old db to the
* original place, we need to update only the symlink */
/*if (!backup_realpath_sym(&db,info,LONGRUN))
{
VERBO3 strerr_warnwu2sys("find path of db service for: ",info->treename.s) ;
goto err ;
...
...
@@ -97,19 +99,19 @@ int db_switch_to(ssexec_t *info, char const *const *envp,unsigned int where)
VERBO3 strerr_warnwu3sys("switch: ",info->treename.s," to source") ;
VERBO3 strerr_warnwu1sys("unable to rollback the db state, please make a bug report") ;
goto err ;
}
}
*/
}
}
}
else
if
(
r
>
0
&&
!
where
)
{
VERBO3
strerr_warnt3x
(
"switch db s
ervice for
tree: "
,
info
->
treename
.
s
,
" to source"
)
;
VERBO3
strerr_warnt3x
(
"switch db s
ymlink of
tree: "
,
info
->
treename
.
s
,
" to source"
)
;
memcpy
(
cmd
+
cmdlen
,
" -s0"
,
4
)
;
cmd
[
cmdlen
+
4
]
=
0
;
r
=
backup_cmd_switcher
(
VERBOSITY
,
cmd
,
info
)
;
if
(
r
<
0
)
{
VERBO3
strerr_warnwu3sys
(
"switch db s
ervice for
: "
,
info
->
treename
.
s
,
" to source"
)
;
VERBO3
strerr_warnwu3sys
(
"switch db s
ymlink of tree
: "
,
info
->
treename
.
s
,
" to source"
)
;
goto
err
;
}
...
...
@@ -132,8 +134,8 @@ int db_switch_to(ssexec_t *info, char const *const *envp,unsigned int where)
VERBO3
strerr_warnwu3sys
(
"switch db service for: "
,
info
->
treename
.
s
,
" to backup"
)
;
goto
err
;
}
db
=
stralloc_zero
;
if
(
!
backup_realpath_sym
(
&
db
,
info
,
LONGRUN
))
//db.len = 0
;
/*
if (!backup_realpath_sym(&db,info,LONGRUN))
{
VERBO3 strerr_warnwu2sys("find path of db: ",info->treename.s) ;
goto err ;
...
...
@@ -143,7 +145,7 @@ int db_switch_to(ssexec_t *info, char const *const *envp,unsigned int where)
VERBO3 strerr_warnwu3sys("switch: ",info->treename.s," to source") ;
VERBO3 strerr_warnwu1sys("unable to rollback the db state, please make a bug report") ;
goto err ;
}
}
*/
}
}
VERBO3
strerr_warnt2x
(
"make a backup of db service for: "
,
info
->
treename
.
s
)
;
...
...
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