Began setting up a second server socket that will be used exclusively for admin utilities
[citadel.git] / citadel / server_main.c
index d1b2a4cd3cb4c9edb8f5915adb2bc1d50e08f9c4..ff216ba769fb9f07a2c7ddf01174279a5e4e6eb7 100644 (file)
@@ -1,21 +1,15 @@
 /*
  * citserver's main() function lives here.
  * 
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2012 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 3.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "sysdep.h"
@@ -208,7 +202,7 @@ int main(int argc, char **argv)
        syslog(LOG_NOTICE,
                "*** Citadel server engine v%d.%02d (build %s) ***",
                (REV_LEVEL/100), (REV_LEVEL%100), svn_revision());
-       syslog(LOG_NOTICE, "Copyright (C) 1987-2011 by the Citadel development team.");
+       syslog(LOG_NOTICE, "Copyright (C) 1987-2012 by the Citadel development team.");
        syslog(LOG_NOTICE, "This program is distributed under the terms of the GNU "
                                        "General Public License.");
        syslog(LOG_NOTICE, " ");
@@ -285,7 +279,7 @@ int main(int argc, char **argv)
        }
        
        /*
-        * Bind the server to a Unix-domain socket.
+        * Bind the server to a Unix-domain socket (user client access)
         */
        CtdlRegisterServiceHook(0,
                                file_citadel_socket,
@@ -294,6 +288,17 @@ int main(int argc, char **argv)
                                do_async_loop,
                                CitadelServiceUDS);
 
+       /*
+        * Bind the server to a Unix-domain socket (admin client access)
+        */
+       CtdlRegisterServiceHook(0,
+                               file_citadel_admin_socket,
+                               citproto_begin_session,
+                               do_command_loop,
+                               do_async_loop,
+                               CitadelServiceUDS);
+       chmod(file_citadel_admin_socket, S_IRWXU);      /* for your eyes only */
+
        /*
         * Bind the server to our favorite TCP port (usually 504).
         */