s3-smbd: Publish nt printers.
authorAndreas Schneider <asn@samba.org>
Tue, 10 Aug 2010 11:45:55 +0000 (13:45 +0200)
committerSimo Sorce <idra@samba.org>
Fri, 13 Aug 2010 16:20:10 +0000 (12:20 -0400)
Reloading of the printers requires rpc services up and running! The
first call in reload_services will be skipped.

Signed-off-by: Simo Sorce <idra@samba.org>
source3/smbd/server.c
source3/smbd/server_reload.c

index ca6f6c8e16b2fcc8cb62b74dc9947c1d7c1dda58..1c614dad0b0985b2d0ece9af90a36a04a1934334 100644 (file)
@@ -982,8 +982,17 @@ extern void build_options(bool screen);
        if (smbd_messaging_context() == NULL)
                exit(1);
 
-       if (!reload_services(smbd_messaging_context(), False))
-               return(-1);     
+       /*
+        * Reloading of the printers will not work here as we don't have a
+        * server info and rpc services set up. It will be called later.
+        */
+       if (!reload_services(smbd_messaging_context(), False)) {
+               exit(1);
+       }
+
+       /* ...NOTE... Log files are working from this point! */
+
+       DEBUG(3,("loaded services\n"));
 
        init_structs();
 
@@ -1002,8 +1011,6 @@ extern void build_options(bool screen);
        }
 #endif
 
-       DEBUG(3,( "loaded services\n"));
-
        if (!is_daemon && !is_a_socket(0)) {
                if (!interactive)
                        DEBUG(0,("standard input is not a socket, assuming -D option\n"));
@@ -1156,6 +1163,9 @@ extern void build_options(bool screen);
 
        static_init_rpc;
 
+       /* Publish nt printers, this requires a working winreg pipe */
+       reload_printers(smbd_messaging_context());
+
        /* only start the background queue daemon if we are 
           running as a daemon -- bad things will happen if
           smbd is launched via inetd and we fork a copy of 
index 7512f8e482fa5b2a0478e80244157c9309e108bc..e1d563d09d0481707d3b47365c6d7a8f335318fd 100644 (file)
@@ -44,7 +44,7 @@ void reload_printers(struct messaging_context *msg_ctx)
 
        status = make_server_info_system(talloc_tos(), &server_info);
        if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(0, ("reload_printers: "
+               DEBUG(3, ("reload_printers: "
                          "Could not create system server_info\n"));
                /* can't remove stale printers before we
                 * are fully initilized */