Skip to content
Snippets Groups Projects
Commit 5994ca8f authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

s6-rc-update make already a rollback

parent 25bbad4e
No related branches found
No related tags found
No related merge requests found
......@@ -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 service for tree: ",info->treename.s," to backup") ;
VERBO3 strerr_warnt3x("switch db symlink 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 service for: ",info->treename.s," to backup") ;
VERBO3 strerr_warnwu3sys("switch db symlink 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 service for: ",info->treename.s," to source") ;
VERBO3 strerr_warnwu3sys("switch db symlink 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 service for tree: ",info->treename.s," to source") ;
VERBO3 strerr_warnt3x("switch db symlink 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 service for: ",info->treename.s," to source") ;
VERBO3 strerr_warnwu3sys("switch db symlink 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) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment