X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Futils%2Fsetup.c;h=b5775fa26bd95952cc0a0f63fadfe490f7fdc717;hb=8f337e674f59cedc85f5bf00018a1315eecf6ba1;hp=84af53594dd06ef1cf2639c44767868573e774f1;hpb=4c2f4825c58abb09b1da16140a4482b6bb7084df;p=citadel.git diff --git a/citadel/utils/setup.c b/citadel/utils/setup.c index 84af53594..b5775fa26 100644 --- a/citadel/utils/setup.c +++ b/citadel/utils/setup.c @@ -1158,8 +1158,9 @@ int main(int argc, char *argv[]) char buf[1024]; char aaa[128]; int info_only = 0; - int relh=0; - int home=0; + int relh = 0; + int home = 0; + int nRetries = 0; char relhome[PATH_MAX]=""; char ctdldir[PATH_MAX]=CTDLDIR; struct passwd *pw; @@ -1230,11 +1231,17 @@ int main(int argc, char *argv[]) /* * Connect to the running Citadel server. */ - serv_sock = uds_connectsock(file_citadel_admin_socket); + while ((serv_sock < 0) && (nRetries < 10)) { + serv_sock = uds_connectsock(file_citadel_admin_socket); + nRetries ++; + if (serv_sock < 0) + sleep(1); + } if (serv_sock < 0) { display_error( - "%s\n", - _("Setup could not connect to a running Citadel server.") + "%s: %s %s\n", + _("Setup could not connect to a running Citadel server."), + strerror(errno), file_citadel_admin_socket ); exit(1); }