Ignore:
Timestamp:
May 13, 2014, 11:39:04 AM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update trunk to 3.6.23

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/smbd/server.c

    r845 r862  
    2121   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2222*/
    23 #ifdef __OS2__
    24 #define INCL_DOSEXCEPTIONS
    25 #define INCL_DOSPROCESS
    26 #define INCL_DOSMODULEMGR
    27 #define INCL_LOADEXCEPTQ
    28 #define INCL_FORKEXCEPTQ
    29 #include "os2.h"
    30 #include "exceptq.h"
    31 #undef FILE_CREATE
    32 #undef FILE_OPEN
    33 #endif
    3423
    3524#include "includes.h"
     
    120109        change_to_root_user();
    121110        reload_services(msg, smbd_server_conn->sock, False);
    122         if (am_parent) {
    123                 pcap_cache_reload(ev_ctx, msg,
    124                                   &reload_pcap_change_notify);
    125         }
     111        /* printer reload triggered by background printing process */
    126112}
    127113
     
    143129        reload_printers(ev_ctx, msg);
    144130}
     131
     132static void smbd_sig_term_handler(struct tevent_context *ev,
     133                                  struct tevent_signal *se,
     134                                  int signum,
     135                                  int count,
     136                                  void *siginfo,
     137                                  void *private_data)
     138{
     139        exit_server_cleanly("termination signal");
     140}
     141
     142static void smbd_setup_sig_term_handler(void)
     143{
     144        struct tevent_signal *se;
     145
     146        se = tevent_add_signal(smbd_event_context(),
     147                               smbd_event_context(),
     148                               SIGTERM, 0,
     149                               smbd_sig_term_handler,
     150                               NULL);
     151        if (!se) {
     152                exit_server("failed to setup SIGTERM handler");
     153        }
     154}
     155
     156static void smbd_sig_hup_handler(struct tevent_context *ev,
     157                                 struct tevent_signal *se,
     158                                 int signum,
     159                                 int count,
     160                                 void *siginfo,
     161                                 void *private_data)
     162{
     163        struct messaging_context *msg_ctx = talloc_get_type_abort(
     164                private_data, struct messaging_context);
     165        change_to_root_user();
     166        DEBUG(1,("Reloading services after SIGHUP\n"));
     167        reload_services(msg_ctx, smbd_server_conn->sock, false);
     168}
     169
     170static void smbd_setup_sig_hup_handler(struct tevent_context *ev,
     171                                       struct messaging_context *msg_ctx)
     172{
     173        struct tevent_signal *se;
     174
     175        se = tevent_add_signal(ev, ev, SIGHUP, 0, smbd_sig_hup_handler,
     176                               msg_ctx);
     177        if (!se) {
     178                exit_server("failed to setup SIGHUP handler");
     179        }
     180}
     181
    145182
    146183/*******************************************************************
     
    784821                           smb_stat_cache_delete);
    785822        messaging_register(msg_ctx, NULL, MSG_DEBUG, smbd_msg_debug);
    786         messaging_register(msg_ctx, server_event_context(), MSG_PRINTER_PCAP,
    787                            smb_pcap_updated);
    788823        brl_register_msgs(msg_ctx);
    789824
     
    909944        NTSTATUS status;
    910945
    911 #ifdef __OS2__
    912         EXCEPTIONREGISTRATIONRECORD ExRegRec;
    913         LoadExceptq(&ExRegRec, NULL, NULL);
    914 #endif
    915946        /*
    916947         * Do this before any other talloc operation
     
    12641295                exit(1);
    12651296
    1266         /* Publish nt printers, this requires a working winreg pipe */
    1267         pcap_cache_reload(server_event_context(), smbd_messaging_context(),
    1268                           &reload_printers);
    1269 
    12701297        /* only start the background queue daemon if we are
    12711298           running as a daemon -- bad things will happen if
     
    12751302        if (is_daemon && !interactive
    12761303            && lp_parm_bool(-1, "smbd", "backgroundqueue", true)) {
    1277                 start_background_queue(smbd_event_context(),
    1278                                        smbd_messaging_context());
     1304                /* background queue is responsible for printcap cache updates */
     1305                messaging_register(smbd_server_conn->msg_ctx,
     1306                                   smbd_event_context(),
     1307                                   MSG_PRINTER_PCAP, smb_pcap_updated);
     1308                start_background_queue(server_event_context(),
     1309                                       smbd_server_conn->msg_ctx);
     1310        } else {
     1311                DEBUG(3, ("running without background printer process, dynamic "
     1312                          "printer updates disabled\n"));
     1313                /* Publish nt printers, this requires a working winreg pipe */
     1314                pcap_cache_reload(server_event_context(),
     1315                                  smbd_messaging_context(),
     1316                                  &reload_printers_full);
    12791317        }
    12801318
     
    13351373        exit_server_cleanly(NULL);
    13361374        TALLOC_FREE(frame);
    1337 #ifdef __OS2__
    1338         UninstallExceptq(&ExRegRec);
    1339 #endif
    13401375        return(0);
    13411376}
Note: See TracChangeset for help on using the changeset viewer.