* Found a better way for ctdlmigrate to shut down the master SSH socket. SSH has...
authorArt Cancro <ajc@citadel.org>
Sun, 3 May 2009 03:30:35 +0000 (03:30 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 3 May 2009 03:30:35 +0000 (03:30 +0000)
citadel/ctdlmigrate.c

index ad50ea9d9dfec03bdced89ef60b2b306985b3d09..5f4e8ec7c1e327eaff7c3bc493ea3bee5af853e7 100644 (file)
@@ -308,7 +308,23 @@ FAIL:      if (sourcefp) pclose(sourcefp);
        }
        pclose(sourcefp);
 
-THEEND:        kill(sshpid, SIGKILL);
+THEEND:        if (exitcode == 0) {
+               printf("\n\n *** Citadel migration was successful! *** \n\n");
+       }
+       else {
+               printf("\n\n *** Citadel migration was unsuccessful. *** \n\n");
+       }
+       printf("\nShutting down the socket connection...\n\n");
+       snprintf(cmd, sizeof cmd, "ssh -S %s -N -O exit %s@%s",
+               socket_path, remote_user, remote_host);
+       cmdexit = system(cmd);
+       printf("\n");
+       if (cmdexit != 0) {
+               printf("There was an error shutting down the socket.\n\n");
+               exitcode = cmdexit;
+       }
+
+       /* kill(sshpid, SIGKILL); */
        unlink(socket_path);
        exit(exitcode);
 }