]> code.citadel.org Git - citadel.git/blobdiff - webcit/webserver.c
* static.local/ is now created
[citadel.git] / webcit / webserver.c
index fe23a84890e90bfad474c72f7c2f34f66b00a2ff..a263c9c9254a7cae6a1ad34466483382a420d8ec 100644 (file)
@@ -44,6 +44,7 @@ int ndirs=2; //sizeof(static_content_dirs);//sizeof(char *);
  */
 char *static_content_dirs[] = {
        "static",                     /** static templates */
+       "static.local",               /** site local static templates */
        "tiny_mce"                    /** the JS editor */
 };
 
@@ -480,21 +481,14 @@ void start_daemon(char *pid_file)
         */
        chdir("/");
 
+       signal(SIGHUP, SIG_IGN);
+       signal(SIGINT, SIG_IGN);
+       signal(SIGQUIT, SIG_IGN);
+
        child = fork();
        if (child != 0) {
-               if (pid_file) {
-                       fp = fopen(pid_file, "w");
-                       if (fp != NULL) {
-                               fprintf(fp, "%d\n", child);
-                               fclose(fp);
-                       }
-               }
                exit(0);
        }
-       
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
 
        setsid();
        umask(0);
@@ -518,6 +512,13 @@ void start_daemon(char *pid_file)
        
                else {
                        signal(SIGTERM, SIG_IGN);
+                       if (pid_file) {
+                               fp = fopen(pid_file, "w");
+                               if (fp != NULL) {
+                                       fprintf(fp, "%d\n", current_child);
+                                       fclose(fp);
+                               }
+                       }
                        waitpid(current_child, &status, 0);
                }
 
@@ -711,7 +712,7 @@ int main(int argc, char **argv)
 
        /** Tell 'em who's in da house */
        lprintf(1, SERVER "\n");
-       lprintf(1, "Copyright (C) 1996-2006 by the Citadel development team.\n"
+       lprintf(1, "Copyright (C) 1996-2007 by the Citadel development team.\n"
                "This software is distributed under the terms of the "
                "GNU General Public License.\n\n"
        );