]> code.citadel.org Git - citadel.git/blobdiff - appimage/citadel.AppDir/ctdlvisor.c
appimage supervisor is functionally complete
[citadel.git] / appimage / citadel.AppDir / ctdlvisor.c
diff --git a/appimage/citadel.AppDir/ctdlvisor.c b/appimage/citadel.AppDir/ctdlvisor.c
deleted file mode 100644 (file)
index b2e6a18..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/wait.h>
-
-
-
-
-pid_t start_citadel() {
-       pid_t pid = fork();
-       if (pid == 0) {
-               execlp("citserver", "citserver", "-x9", "-h/usr/local/citadel", NULL);
-               exit(1);
-       }
-       else {
-               return(pid);
-       }
-}
-
-
-pid_t start_webcit() {
-       pid_t pid = fork();
-       if (pid == 0) {
-               execlp("/bin/bash", "bash", "-c", "sleep 7", NULL);
-               exit(1);
-       }
-       else {
-               return(pid);
-       }
-}
-
-
-pid_t start_webcits() {
-       pid_t pid = fork();
-       if (pid == 0) {
-               execlp("/bin/bash", "bash", "-c", "sleep 9", NULL);
-               exit(1);
-       }
-       else {
-               return(pid);
-       }
-}
-
-
-
-
-
-main() {
-       int status;
-       pid_t who_exited;
-
-       pid_t citserver_pid = start_citadel();
-       //pid_t webcit_pid = start_webcit();
-       //pid_t webcits_pid = start_webcits();
-
-       do {
-               printf("LD_LIBRARY_PATH = %s\n", getenv("LD_LIBRARY_PATH"));
-               printf("PATH = %s\n", getenv("PATH"));
-
-
-               printf("waiting...\n");
-               who_exited = waitpid(-1, &status, 0);
-               printf("pid=%d exited, status=%d\n", who_exited, status);
-
-               if (who_exited == citserver_pid)        citserver_pid = start_citadel();
-               //if (who_exited == webcit_pid)         webcit_pid = start_webcit();
-               //if (who_exited == webcits_pid)        webcits_pid = start_webcits();
-
-               sleep(1);                               // for sanity
-
-       } while(who_exited >= 0);
-       exit(0);
-}