diff --git a/src/lib66/db_switch_to.c b/src/lib66/db_switch_to.c index 144b99f31be88f6a7f03deee19834349f75a1d7c..af175dc7aff3fa2cd3414c142e74716a484ae637 100644 --- a/src/lib66/db_switch_to.c +++ b/src/lib66/db_switch_to.c @@ -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) ;