1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-23 11:17:06 +03:00
Stefan Metzmacher 9327ec51d1 r4728: split up server_services into:
- stream_socket services
  the smb, ldap and rpc service which sets up a srtam socket end then
  waits for connections
and
- task services
  which this you can create a seperate task that do something
  (this is also going through the process_model subsystem
  so with -M standard a new process for this created
  with -M thread a new thread ...

I'll add datagram services later when we whave support for datagram sockets in lib/socket/

see the next commit as an example for service_task's

metze
(This used to be commit d5fa02746c6569b09b6e05785642da2fad3ba3e0)
2007-10-10 13:08:49 -05:00

71 lines
1.4 KiB
C

#include "includes.h"
#include "dynconfig.h"
/*
* initialize an smb process. Guaranteed to be called only once per
* smbd instance (so it can assume it is starting from scratch, and
* delete temporary files etc)
*/
void smbd_process_init(void)
{
/* possibly reload the services file. */
reload_services(NULL, True);
if (*lp_rootdir()) {
if (sys_chroot(lp_rootdir()) == 0)
DEBUG(2,("Changed root to %s\n", lp_rootdir()));
}
service_cleanup_tmp_files();
}
void init_subsystems(void)
{
/* Do *not* remove this, until you have removed
* passdb/secrets.c, and proved that Samba still builds... */
/* Setup the SECRETS subsystem */
if (!secrets_init()) {
exit(1);
}
smbd_init_subsystems;
}
/****************************************************************************
Reload the services file.
**************************************************************************/
BOOL reload_services(struct smbsrv_connection *smb, BOOL test)
{
BOOL ret;
if (lp_loaded()) {
pstring fname;
pstrcpy(fname,lp_configfile());
if (file_exist(fname, NULL) &&
!strcsequal(fname, dyn_CONFIGFILE)) {
pstrcpy(dyn_CONFIGFILE, fname);
test = False;
}
}
reopen_logs();
if (test && !lp_file_list_changed())
return(True);
ret = lp_load(dyn_CONFIGFILE, False, False, True);
/* perhaps the config filename is now set */
if (!test)
reload_services(smb, True);
reopen_logs();
load_interfaces();
return(ret);
}